CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

UART Data Problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
daveonline



Joined: 10 Jul 2010
Posts: 2

View user's profile Send private message

UART Data Problem
PostPosted: Sat Jul 10, 2010 2:48 am     Reply with quote

Guys,

I have set up 2 XBEE wireless modules in AT mode, one co-ordinator and one router/end device.

There is data communication between them, however the data in and out just isn't correct.

The baud rate on both is 9600, with an 8N1 setup. I am unsure why the data would be scrambled.

I have included a file that shows in the first column what the coordinator is sending, the second column shows the data i am recieving.

Can anyone understand why it is not correct?

Thanks
Dave
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Jul 10, 2010 5:47 am     Reply with quote

Quote:
I have included a file that ...
No, you have not.

You don't provide enough information for us to help you. Descibe your hardware setup in more detail. For example, which device is generating the data, how are you receiving this data, and how can you see it is wrong? You are posting on this forum, so I guess there is a PIC processor involved? You don't mention where it is located in your setup.
Post the type numbers of you XBEE modules.
etc.
daveonline



Joined: 10 Jul 2010
Posts: 2

View user's profile Send private message

PostPosted: Sat Jul 10, 2010 2:14 pm     Reply with quote

Hi,

You are right, apologies for that i guess i was in a rush and didn't really give much away.
I am currently sending data from the coordinator using the PC and the XBEE supplied software, the end device is connected to the default UART pins on a PIC18F6680. The TX pin is connected to the XBEE through a level shifter to 3v3, as required. The RX pin is also connected to level shift to allow the 3v3 from the XBEE to be switched to 5V. The level shifter is done with transistors, so nice and simple.

I am monitoring the data on the pic using the fget() cmd, and using the MPLAB ICD breaking the code on data IN, and observing the data in a watch window.

The XBEE modules are series 2, using 2.5 protocol.

I hope this extra information helps.

Thanks
Dave

Data from file is below:
First column: Data OUT from PC
Second column: Data IN at PIC


    a = 0x4F
    b = 0x27
    c = 0x4E
    d = 0x13
    e = 0x4D
    f = 0x26
    g = 0x4C
    h = 0x08
    i = 0x4B
    j = 0x25
    k = 0x4A
    l = 0x12
    m = 0x49
    n = 0x24
    o = 0x48
    p = 0x04
    q = 0x47
    r = 0x23
    s = 0x46
    t = 0x11
    u = 0x45
    v = 0x22
    w = 0x44
    x = 0x08
    y = 0x43
    z = 0x21

    A = 0x5F
    B = 0x2F
    C = 0x5E
    D = 0x17
    E = 0x5D
    F = 0x2E
    G = 0x5C
    H = 0x0B
    I = 0x5B
    J = 0x2D
    K = 0x5A
    L = 0x16
    M = 0x59
    N = 0X2C
    O = 0x58
    P = 0x05
    Q = 0x57
    R = 0x2B
    S = 0x56
    T = 0x15
    U = 0x55
    V = 0x2A
    W = 0x54
    X = 0x0A
    Y = 0x53
    Z = 0x29

    0 = 0x06
    1 = 0x67
    2 = 0x33
    3 = 0x66
    4 = 0x19
    5 = 0x65
    6 = 0x32
    7 = 0x64
    8 = 0x0C
    9 = 0x63
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group