LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices



Reply
 
Search this Thread
Old 06-25-2013, 11:35 AM   #1
backbencher
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
Interface 1-wire DS18B20 over GPIO pin using AM3359


Dear All,

I am using phytec phyCore AM3359 board and would like to access DS18B20 at GPIO pin. I have configured the board as briefly explained in following:


a)
done kernel configuration with "ptxdist kernelconfig" and enabled "GPIO 1-wire busmaster" and "Thermal Family Implentation" like:

Device Drivers>
* Dallas 1-wire Support>
1-wire Bus Masters->
* GPIO 1-wire busmaster
1-wire Slaves->
*Thermal family implentation
b)
modified the the soruce calss of the board (board-pcm051.c):

Code:
static struct pinmux_config w1_gpio_pin_mux[] = {
        {"gpmc_csn1.gpio1_31",  OMAP_MUX_MODE7|AM33XX_PIN_OUTPUT},
        {NULL, 0},
};   

#define PCM051_W1_PIN   GPIO_TO_PIN(1, 31)
static struct w1_gpio_platform_data w1_gpio_pdata={
       .pin =PCM051_W1_PIN,
        .is_open_drain = 0,
};
static struct platform_device w1_device = {
         .name = "w1-gpio",
         .id = -1,
         .dev.platform_data = &w1_gpio_pdata, 
};
static void __init pcm051_w1_init(void)
{
           int err;
           setup_pin_mux(w1_gpio_pin_mux);
           err = platform_device_register(&w1_device);
            if(err)
             {
               pr_err(" failed to register temp sensor device: DS18B \n");
              }
             else
              {
              printk("successfull: temp sensor");
              }
}

static void __init pcm051_init(void)
{
......
pcm051_w1_init();
}
I also modified the mux.c (u-boot/boards/phyTec/mux.c):

...
Code:
{OFFSET(gpmc_csn1.gpio1_31), MODE(7) | RXACTIVE |PULLUDEN}
...

Result: I can see that master pulls the bus low for specific time interval and then slave pulls the bus low for a specific interval. These time intervals are exactly according to the initialization of DS18B20 as described in data sheet. It means that initialization is performed successfully. But I am not able to see any directory for this temperature sensor in the sysfs.I can see only following:

driver w1_master_pointer
power w1_master_pullup
subsystem w1_master_remove
uevent w1_master_search
w1_master_add w1_master_slave_count
w1_master_attempts w1_master_slaves
w1_master_max_slave_count w1_master_timeout
w1_master_name


Please help me to sort out this problem.

Regards,

Irfan

Last edited by onebuck; 06-26-2013 at 09:21 AM. Reason: Please use VBcode tags, mod edit to clean post
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interface GPIO driven matrix keypad linux_ Linux - Newbie 4 09-15-2013 02:11 AM
Adding dallas 1-wire over GPIO support vbsaltydog Linux - Embedded & Single-board computer 0 04-11-2013 11:45 PM
GPIO access on a Fujitsu Mini-ITX Industrial Mainboard, PCI Driver for GPIO mechatrix Linux - Embedded & Single-board computer 3 11-20-2011 04:57 PM
Receive IRQ from a GPIO pin maus Linux - Embedded & Single-board computer 1 06-22-2009 11:02 AM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 08:52 AM


All times are GMT -5. The time now is 08:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration