PDA

View Full Version : xbee transmitter & receiver



hell_pk
- 3rd September 2010, 05:36
I am using xbee pro with 18F1320.
A transmitter(Xbee) with 18F1320 transmits ADC value at 9600 baud.
A receiver(Xbee) with 18F1320 receives ADC value. It then sends & displays it on PC using MAX232.
All goes well while i was using same power supply to power up transmitter, receiver & max232.
As i tried to use a separate power supply for transmitter the communication stopped.
As soon as i connect the grounds of transmitter & receiver power supply communication starts.
Is there anything i don't know about wireless communication?

rsocor01
- 3rd September 2010, 06:42
That's odd. Are you using the voltages recommended in the datasheets? Try connecting an oscilloscope to the transmitter output when the communication is working, and then do the same when it stops working. That might give you some hints.

Robert

hell_pk
- 27th October 2010, 11:34
Dear all,
My design is working.There was something wrong with 3.3V supply. But there is another problem now.
Pic18F1320 on transmitter board gives some data to xbee transmitter.It then sends data to xbee receiver.Value is received correctly by xbee receiver on receiver board.I can check it on hyper terminal.Now I want to do calculations on this data via another 18F1320 on receiver board.
The problem is for some strange reason 18F1320 pulls the voltage level down of serial data to almost 1.3V. A soon as I remove controller from circuit or reset it permanently the voltage level of serial data goes up to correct 3.3V. I have changed the controller & related circuitry as well as breadboard but to no avail?
D0 of Xbee is connected to RX of 18F1320.
any suggestions.

Ioannis
- 27th October 2010, 12:29
Well, I can only guess. You may have not set correctly I/O, ADC or other parameters of the chip yoy are using...

Ioannis

Acetronics2
- 27th October 2010, 14:05
Well, I can only guess. You may have not set correctly I/O, ADC or other parameters of the chip yoy are using...

Ioannis

As those modules can sink or source 2mA ...

no doubt it's some wrong config of the I/Os ... or some damaged input due to previous adventures ...

Alain

hell_pk
- 28th October 2010, 07:37
I already have changed the chip & verified the code and chip on another board. It just has to receive the data from Xbee receiver on its Rx pin,do some calculations & send it through Tx pin to LCD. Both Xbee & 18F1320 work fine when separated. As soon as 18F1320 is inserted in circuit something weird goes on.

Ioannis
- 28th October 2010, 09:51
Hmm, then an exorcism might help...

Ioannis

Acetronics2
- 28th October 2010, 10:26
I already have changed the chip & verified the code and chip on another board. It just has to receive the data from Xbee receiver on its Rx pin,do some calculations & send it through Tx pin to LCD. Both Xbee & 18F1320 work fine when separated. As soon as 18F1320 is inserted in circuit something weird goes on.

Hi, Hell_pk

as your code and scheme might be rather simple ...

Would be easy for you to provide both Here.

just for us to talk about REAL things. ;)

Alain

hell_pk
- 29th October 2010, 05:51
'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

Ioannis
- 29th October 2010, 12:40
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

hell_pk
- 1st November 2010, 05:21
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.