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

ex_Rs232_485 test hardware

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



Joined: 17 Oct 2005
Posts: 26

View user's profile Send private message

ex_Rs232_485 test hardware
PostPosted: Mon Oct 09, 2006 8:33 am     Reply with quote

hi has anyone got a schematic drawing of the hardware to allow me to try out this example


many thanks Andrew
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 09, 2006 4:09 pm     Reply with quote

CCS doesn't post their manuals for downloading, but it's possible to
figure out the schematic from the example and driver files.

In ex_rs232_485.c, they create a hardware UART on pins B2 and B1.
Code:

#include <16F627A.h>
#use rs232(baud=9600, xmit=PIN_B2, rcv=PIN_B1, stream=PC)



In RS485.c, they create a soft UART on pins B3 and B0, with pins
B4 and B5 used as the enables.
Code:

#define RS485_RX_PIN       PIN_B0   // Data receive pin
#define RS485_TX_PIN       PIN_B3   // Data transmit pin
#define RS485_ENABLE_PIN   PIN_B4   // Controls DE pin.
#define RS485_RX_ENABLE    PIN_B5   // Controls RE pin.


They likely have an RS-232 level converter chip connected to the
hardware UART, and a RS-485 driver connected to the software UART.

Download the schematic for the MeLabs Lab-X1 board.
http://www.melabs.com/downloads/labx1sch.pdf
In the lower right corner of page 2, they show driver chips for RS-232
and RS-485. The schematic doesn't exactly fit the CCS example
program, but it still should give some idea of how to connect everything.

For example, the MAX232 chip should go to pins B2 and B1 on the
16F627A in the CCS example. The SN75176A should go to the pins
listed above for RS-485 (and not to pins C6 and C7 as shown in the
schematic). Also, the DE and RE pins should go to the pins listed above
and not as they are shown in the schematic. The standard value for
resistor R12 is 120 ohms.
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