www.8devices.com
View unanswered posts | View active topics It is currently 23 Jan 2018, 02:28



Reply to topic  [ 23 posts ]  Go to page 1, 2, 3  Next
 Carambola and 1-wire 
Author Message

Joined: 25 Mar 2012, 17:37
Posts: 45
Hiya,

I've just got one-wire to work on my Carambola. It only requires a single extra pull-up-resistor on a GPIO (I used an 1K to the 3v3 power supply) and a fairly small patch to the linux-kernel.

Apply this patch on the kernel. If the kernel source isn't there yet, you may need to run 'make' to get it.
Code:
cd carambola/build_dir/linux-ramips_rt305x/linux-2.6.39.4
patch -p1 </location/of/downloaded/diff/carambola-w1.diff


Then run a 'make kernel_menuconfig' and make sure to select 'machine selection -> Ralink RT350x machine selection -> Enable 1wire support on GPIO14'. If you want different drivers, also look under 'Device Drivers -> Dallas's 1-wire support' and select what you want. Then re-build openwrt by running make, and install the resulting firmware image to a Carambola. Finally, solder the pull-up between GPIO14 and 3V3, connect some one-wire devices between GPIO14 and ground and start the Carambola.

Now you should have a dir in /sys with all the attached one-wire devices in it. Cat 'w1_slave' in the directory to see what the device returns. For example, I have a string of 5 DS1820 temperature sensors connected to it. As you can see, at the moment it's about 21 degrees celcius in my room:
Code:
root@OpenWrt:/# cat /sys/devices/w1\ bus\ master/10-000800*/w1_slave           
2a 00 4b 46 ff ff 0f 10 40 : crc=40 YES                                         
2a 00 4b 46 ff ff 0f 10 40 t=20812                                             
2a 00 4b 46 ff ff 0b 10 7b : crc=7b YES                                         
2a 00 4b 46 ff ff 0b 10 7b t=21062                                             
2a 00 4b 46 ff ff 0d 10 d1 : crc=d1 YES                                         
2a 00 4b 46 ff ff 0d 10 d1 t=20937                                             
2b 00 4b 46 ff ff 07 10 75 : crc=75 YES                                         
2b 00 4b 46 ff ff 07 10 75 t=21312                                             
2a 00 4b 46 ff ff 0a 10 bf : crc=bf YES                                         
2a 00 4b 46 ff ff 0a 10 bf t=21125                                             


25 Mar 2012, 18:23
Profile ICQ WWW

Joined: 22 Mar 2012, 22:23
Posts: 19
Cool -- I mean hot!

Are you using parasitic power, or connecting 3.3v to the 1-wire devices too?


26 Mar 2012, 01:27
Profile

Joined: 25 Mar 2012, 17:37
Posts: 45
At the moment, I'm using parasitic power - though I think the DS1820s need to have a bit more power than the parasitic pull-up can deliver... that's why I lowered the pull-up to 1K myself. It still works, although I get a CRC error every now and then, but I intend just to filter those out in software.


26 Mar 2012, 06:23
Profile ICQ WWW

Joined: 21 Mar 2012, 12:26
Posts: 2
patch file is empty...


27 Mar 2012, 20:11
Profile

Joined: 25 Mar 2012, 17:37
Posts: 45
Hmm, that's not right... moment, I'll see if I can find out what went wrong...


27 Mar 2012, 20:18
Profile ICQ WWW

Joined: 25 Mar 2012, 17:37
Posts: 45
Ok, no idea why the file ended up being zero-bytes, but I re-diffed and re-uploaded; it should be OK now.


27 Mar 2012, 20:28
Profile ICQ WWW

Joined: 22 Mar 2012, 22:23
Posts: 19
I got this working too, thanks to your instructions.

My kernel seems to be linux-3.2.13, not the linux-2.6.39.4 you mention, but the patch still applied and works (with a pair of DS1820s).

Am I misinterpreting the version number somehow?

Tom


25 Apr 2012, 12:35
Profile

Joined: 25 Mar 2012, 17:37
Posts: 45
That's possible, perhaps they've updated the git repo. I'll take a look at it when I have the time.


25 Apr 2012, 16:08
Profile ICQ WWW

Joined: 22 May 2012, 08:47
Posts: 18
Hi All,

Currently testing with a DS1990A and the latest kernel but no luck so far :-( The iButton is not seen by the Carambola.
I will keep hammering away at it.

BTW any reason you went for 3.3v instead of 5v ?

Serge


05 Jun 2012, 22:16
Profile

Joined: 25 Mar 2012, 17:37
Posts: 45
Hmm, I'll try to check it out with the new kernel when I'm done with the LCD driver. I've connected it to 3.3V because iirc the Carambolas inouts aren't 5V compatible.


05 Jun 2012, 23:21
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 23 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.