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 CCS Technical Support

master/slave w/CCS questions

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



Joined: 09 Aug 2005
Posts: 0
Location: New Orleans

View user's profile Send private message

master/slave w/CCS questions
PostPosted: Tue Aug 09, 2005 11:19 am     Reply with quote

So I am currently working on my first uC project. I am using 16F88�s and Olimex�s MCP-USB programmer. I just received the PCW compiler last week. I need to use 4 ADCs and 2 digital output pins per microcontroller and I am planning on using the UART to interface with the computer through RS485 and 232 and the internal oscillator. I�ve been reading a lot of the forums and I still have a few issues that I cannot grasp. I just need the 16F88�s to output high or low when I tell them to, and to give me and A/D conversion after turning on some other devices.

1. My system will require up to 32 16F88�s so obviously I�ll need to do some master/slave protocol. When/how do I assign a unique address to each microcontroller?

2. How would I go about making sure that the RS232 line is clear before sending information on it? Do I use something like kbhit() ?

3. I get how to put which pin to use with READ_ADC and OUTPUT_HIGH/LOW, but how would I broadcast the specific microcontroller address that I am trying to communicate with?

4. Since the CCS compiler has functions like READ_ADC and OUTPUT_HIGH, when it comes to actually programming the uC, do I just have to initialize the UART, A/D pins, and I/O pins to what they need to be and then that�s it? Or do I still have to program out the process in MPLAB for the A/D conversion and stuff like that?

I realize some of these questions might require rather lengthy explanations so any help at all that you guys could provid would be greatly appreciated. I�ve been reading the stuff on microchip�s website, I mainly just can�t figure out the big picture on using the microcontrollers with CCS. Sorry to be another annoying new guy asking simple yet long questions.

Thanks
Eric
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 09, 2005 1:00 pm     Reply with quote

These are the CCS driver and example files for a RS485 multi-drop bus:
c:\program files\picc\examples\ex_rs232_485.c
c:\program files\picc\drivers\rs485.c
Guest








PostPosted: Fri Aug 18, 2006 2:30 am     Reply with quote

PCM programmer wrote:
These are the CCS driver and example files for a RS485 multi-drop bus:
c:\program files\picc\examples\ex_rs232_485.c
c:\program files\picc\drivers\rs485.c
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Fri Aug 18, 2006 5:03 am     Reply with quote

PCM programmer:

What do you think about the EX_PBUSR.C solution?
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