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

modifying the example CCS one wire protocol

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



Joined: 09 Jul 2009
Posts: 11

View user's profile Send private message

modifying the example CCS one wire protocol
PostPosted: Fri Aug 07, 2009 5:08 am     Reply with quote

Hi all,

I am trying to modify the CCS example one wire interface to communciate between pics. The pics being used are the pic24f16a101.
The one wire will be connected to the rx uart on both pics. Unfortunately the pin selection is fixed as the hardware is already created.

If possible I might make use of the rx uart however I will start out with the bit bashed software version to get something working. My problem is that I am not connecting to the external interrupt pin on the pics.

I am not sure if I can easily modify the code to configure the pin to:

- receive a interrupt and fix the ISR accordingly to sense a change in level on the pin

- receive the corresponding data in software (or hardware using the rx uart hardware) on the rx uart pin

- transmit on on the same pin

I am guessing all of this is possible but I just have to write more clever C to deal with the change in configuration.

Any help would be much appreciated!!

Cheers
Mike
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Aug 07, 2009 6:33 am     Reply with quote

Quote:
The one wire will be connected to the rx uart on both pics
There are two UARTs on 24F16KA101.

The most critical function that is needed for one wire slave is to react in time on input change, particularly falling edge. You need an interrupt to achieve this.

Because the said chip can configure the input change interrupt to arbitrary pins, you have an easy solution.

In my opinion, a bidirectional "one wire" UART protocol would work faster and with less effort on the said pins.
mikem



Joined: 09 Jul 2009
Posts: 11

View user's profile Send private message

PostPosted: Mon Aug 10, 2009 2:01 am     Reply with quote

Hi FVM,

Thanks for your feedback. I agree that just using a bit bashed software implementation for the one wire interface is probably easiest.

Thanks again for your help.

Mike
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