Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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 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.

Latest threads

New Articles From Microcontroller Tips

Back
Top