xbee transmitter & receiver


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    37


    Did you find this post helpful? Yes | No

    Default files

    'Receiver side code

    DEFINE OSC 8


    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 12 ' 9600 Baud @ 8MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically



    TRISB = %00000000 ' Set RX (PortB.4) to output

    char var byte
    i var byte
    TrisA= %00000000 'All PORTA pins configured as output
    ADCON1= %11111111 'All PORTA pins configured as digital




    loop:
    'RCSTA = $90 ' Enable serial port & continuous receive
    'TXSTA = $20 ' Enable transmit, BRGH = 0
    'SPBRG = 12 ' 9600 Baud @ 8MHz, 0.16%


    for i=1 to 6
    Hserin [char] ' Get a char from serial port
    next i

    Pause 850 ' Delay for 1 usec,use larger delay for real device


    'RCSTA = $90 ' Enable serial port & continuous receive
    'TXSTA = $24 ' Enable transmit, BRGH = 1
    'SPBRG = 25 ' 19200 Baud @ 8MHz, 0.16%

    for i=1 to 6
    Hserout [char]
    next i
    Pause 850
    Goto loop ' Go back to loop and blink LED forever
    ;End
    Attached Images Attached Images  

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    I really cannot follow your thinking.

    You send 16 times the same character char and also receive 16 times a character into the same variable char.

    Why is that?

    What are you trying o do? It just doesn't make sense...

    Ioannis

  3. #3
    Join Date
    Jun 2006
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    Does it matter......it receives chars wirelessly & sends it to hyper terminal on PC via serial port. Its just to check for chars i receive wirelessly.
    Anyways I modified my design and am doing calculations on transmitter side. No microcontroller on receiver side now so the problem is resolved from my point of view. But still I have no idea how the original problem started.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts