View previous topic :: View next topic |
Author |
Message |
asunca
Joined: 09 Sep 2005 Posts: 36
|
rs232 problem |
Posted: Tue Oct 04, 2005 8:26 am |
|
|
i am sending data on rs232, printf("hello") and made all necessary things but i cannot see it on pc. iam using tty terminal program.
for the serial port of pc (6 and 4 short, 7-8 short ). dtr- dsr shorted and rts-cts shorted. the TX pin of microcontroller is held at 3.4 volts and receive pin of PC is held at -2.4 volts. is there a problem ??
and how can i use this serial data on my other c program on PC. |
|
|
valemike Guest
|
|
Posted: Tue Oct 04, 2005 8:33 am |
|
|
Look at page 20 (the .pdf's page, not the printed page) and the schematic to hook up to an RS232 chip is shown. This is the PICDEM-2 Plus user's manual. Verify those connections. If it still doesn't work, then post your small program, and specify what is the actual crystal frequency you are using, as well as which PIC.
http://ww1.microchip.com/downloads/en/DeviceDoc/51275b.pdf |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
|
asunca
Joined: 09 Sep 2005 Posts: 36
|
|
Posted: Wed Oct 05, 2005 9:14 pm |
|
|
all the connections are verified but still no action though i ve changed the max232 with a new one. how should understand the transmit action of pic with using multi meter because i have no scope.. i ve no time, this is so urgent... pc settings are 9600 baud, 8 data bits, no parity, 1 stop bit.
i dont know which option should i set flow control;
Xon-Xoff or hardware or none?? |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Wed Oct 05, 2005 9:34 pm |
|
|
I troubleshoot serial problems from the PIC outward.
Make a simple transmission detector: Solder a 220-470 ohm resistor to either the anode or cathode of a LED you know is operational. You will use this to touch on the TX pin (anode) and ground (cathode).
Write a small loop program that that transmits a number of 0x00 characters then a number of 0xFF characters, over and over...
Code: |
while (TRUE) {
for(i = 0; i < 50; i++) putc(0x00);
for(i = 0; i < 50; i++) putc(0xFF);
}
|
Ensure that you've got something like this:
Code: |
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,errors,BRGH1oK,errors)
|
Run the program and use your LED contraption to see if any thing is being transmitted (it should blink.)
Reply with the results of the first step, and we'll go from there.....
Good luck,
John |
|
|
|