PDA

View Full Version : PC Serial comms



Bill Legge
- 13th December 2009, 04:20
I'm using a VDrive2 module that communicates by RS232 at 9600 Baud. The problem is:

1. Using PBP code on a PIC16F877A connected to the VDrive2 works properly. The VDrive module responds to commands and returns data correctly.

2. Connecting the VDrive module to the PC by a RS232 converter chip works OK - but only for the first command, after that the VDrive2 will only send 'Bad Command.' Cycle the power and again it accepts one command, returns the correct data but won't respond to a second command, jut 'Bad Command' again.

I'm not using RTS or CTS on either set-up.

What's different between the PIC RS232 and the Max chip to the PC?

Regards Bill Legge

mackrackit
- 13th December 2009, 04:35
Do you have CTS , PIN 10 I think, connected to the zero rail?

Bill Legge
- 13th December 2009, 05:13
Sorry - I guess I am using CTS - it is connected to ground!

Regards Bill Legge

mackrackit
- 13th December 2009, 05:25
What's different between the PIC RS232 and the Max chip to the PC?
The PIC does TTL and the MAX does RS232.

What is the command you are sending that causes trouble or does it matter which one?

Bill Legge
- 13th December 2009, 09:10
All of the Vdrive2 commands work but once only and then the power needs cycling.

I think it's some CTR/RTS thing?

Regards Bill Legge

Bill Legge
- 13th December 2009, 09:44
I've just tried a different terminal program - and it all works OK.

The terminal program incorporated in PBP won't work?

Regards Bill Legge

mackrackit
- 13th December 2009, 10:11
Just to the right of the send button in the MCS terminal is a place to set the CR-LF on send.
Maybe that is setup wrong??

Bill Legge
- 13th December 2009, 23:37
I'm using Microcode Studio Plus and I can't find the button to set the CR-LF option?

Regards Bill legge