CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Dallas 1 wire aka touch

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

Dallas 1 wire aka touch
PostPosted: Mon Aug 13, 2012 11:31 am     Reply with quote

The issue is that timing is critical. Now the CCS routines touch.c have a heavy reliance on delay_xx to conform to the timing of the 1 wire bus.
This is all well and good for a PIC dedicated to the 1 wire bus. I'm adding a Dallas temperature sensor 1820 type to a PIC pin. The PIC is also via isr linked to a CAN bus. I find I need to disable interrupts during the read of the 1820 to get the 1 wire timing working. Disabling interrupts in turn creates latency with incoming CAN bus traffic into a circular buffer.
Now I could just dedicate another PIC to the 1 wire bus letting it do the work of acquiring the temp and have a second PIC poll it for a 1 byte transfer.
The alternative would be a non blocking version of touch.c......has anyone looked into this.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Aug 13, 2012 12:31 pm     Reply with quote

I haven't done any Dallas One-Wire stuff in a long time (was one of my first PIC projects actually!).

You are correct - timing is critical. I remember playing with those aspects of the DOW bus protocol for fun.

you could do (and I've heard some talk about) doing something interrupt based which allows for a more non-blocking environment...

I've never implemented an ISR for collecting DOW data though..

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Tue Aug 14, 2012 3:23 am     Reply with quote

It is probably easier to use a I2C temp sensor on hardware I2C pins.
For the 1 wire non blocking interface to a 1820 temp sensor I was contemplating using the the PIC's rs232 hardware to develop the 1 wire pulses by both varying the baud rate and the char to send Ex 0xFF would get a long pulse at a slow baud rate. With the char representing the pulse in the Rs232 buffer the main code isn't blocked and with isr's on RDA and TBE and some state flags it might just work.
I was hoping someone had tried this before.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group