Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Getting wrong data on RX(USART PIC16) while signal is right.

Status
Not open for further replies.

KiPoD

Newbie level 3
Joined
Sep 16, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
Hello everyone,
Working on some complex project, but in a simple model it looks like that:
I`m tying to receive data from PC through COM port via max232 and receive it with USART of PIC16f873.
Sending for example 0x55
Signal on RC7 looks normally: Photo0252.jpg
You can see on the snapshot start bit and the signal bits of the right data.
data that arrives to RXREG is 0xD5

I understand that it`s very simple but I still can`t understand why is it so, why the signal is right but the data received is wrong? :roll:
please help me If someone have any ideas.
Patiently waiting for your responses.
 

It's apparently an inverted UART signal with low idle state, as send over RS232. It's not the right polarity to be read by the UART pin.
 

    V

    Points: 2
    Helpful Answer Positive Rating
If that scope trace is the signal on RC7 then the signal is inverted and has too many bits. (EDIT: FvM got there first)

At RC7 pin, the signal would normally be high, then goes low for the start bit.

Have you maybe selected 9 bits plus parity on your PC?

I am guessing that you would have set your PIC to receive 8 bits with no parity?
 

    V

    Points: 2
    Helpful Answer Positive Rating
At RC7 pin, the signal would normally be high, then goes low for the start bit.

I've totally forgot about this, due to you founded the root of the problem!
**broken link removed**
Because that the signal NORMALLY LOW in my case, PIC can't see the start bit therefore it detect first switch from high to low as start bit, and part of stop bit attach to the data flow.
pictiure_with_timeline_1.PNG
That's why data arrived corrupted, and now I see explanation HOW is it corrupted.

I suppose that eternal pull-up should solve the problem...
Thanks a lot for good ideas and your time
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top