View previous topic :: View next topic |
Author |
Message |
eblancha
Joined: 09 Aug 2005 Posts: 0 Location: New Orleans
|
master/slave w/CCS questions |
Posted: Tue Aug 09, 2005 11:19 am |
|
|
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
|
|
Posted: Tue Aug 09, 2005 1:00 pm |
|
|
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
|
|
Posted: Fri Aug 18, 2006 2:30 am |
|
|
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
|
|
Posted: Fri Aug 18, 2006 5:03 am |
|
|
PCM programmer:
What do you think about the EX_PBUSR.C solution? |
|
|
|