16f877A - Problems with rs 232

Status
Not open for further replies.

agamemnon

New Member
Hi people,

I´m having a problem with a pic 16f877a. I´m conecting to a PC and sending some data (i´ve program using the ccsc compiler). The data receive by the PC is'nt the same data as i´m sending. Example, i send 0x55 and the computer receive 0x2b, for all 0x55 the computer are receiving 0x2b, and so on, for each byte i send, there is one equivalent being received by the computer.

I Have used the intel 8051, this is my first time with pic, so i apreciate any help

-> The conection is 9600, no parity, byte with 8 bits and no parity, one stop bit... The pic is using an 20 Mhz Cristal (but i also have tested with a 4mhz ressonator)
 
I´m using a max 232 between the pc and the pic... I am not able to use
the flag INVERT in the #use rs232 command...

Is it possible to be inverted? Should i try using without the max 232?

csaba911 said:
Maybe it is INVERTED :?:


STEVE
 
I believe it's with the same settings, at least both sides are configured to work with 9600 bps, no parity, and byte with 8 bits...

I just was'nt able to set the stopbits in PIC, but, even changing it in the computer i could'nt get the right values...

StupidDum said:
No, not inverted.
make sure the setting is identical in both computer and pic
 
Check the PIC clock setting.
I forgot if the PIC use stop bit by default.
If u dont use handshaking, remember to set that on pc too
 
It might be inverted... either try to send your serial data in TRUE mode (non-inverted) or don't use the MAX232 (if allowed by microcontroller) and hookup straight.

Using the MAX232 is recommended so I would try the first one first
Ivancho
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…