Maker Pro
Maker Pro

Send serial data from A device to B through AVR

Dada Krauter

Feb 22, 2015
28
Joined
Feb 22, 2015
Messages
28
Hello everyone, :)

I want to connect two devices to one FT232RL(A device: AVR | B device: xBee).

I want to make two modes:
First: Debug mode > PC communicates only with AVR.
Second: Configure mode > X-CTU program configures xBee through AVR (It sends data to AVR, AVR sends to xBee, xBee sends data back to AVR and than AVR sends back to FT232RL, PC)

Im working with Atmel Studio 6 C code;

See my attachment for detailed schematic>>>

Thanks ;)

DADA
 

Attachments

  • 10.jpg
    10.jpg
    49.9 KB · Views: 151

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,719
Joined
Nov 17, 2011
Messages
13,719
That should be entirely possible.
What is your question?
 

Dada Krauter

Feb 22, 2015
28
Joined
Feb 22, 2015
Messages
28
Thank you Harald Kapp for your fast reply :)

So I want to write this function in C language. Only one part, where AVR sends to xBee received data from FT232RL and where AVR sends data back to FT232RL received from xBee.
Im making flight controller, I have onboard xBee module and I want to configure xBee module by connecting controller to PC without any other FTDI boards like that> https://www.sparkfun.com/products/11812 <(X-CTU>xBee config. program> http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/xctu <) and also I don't want to use two FT232RL chips, one for debugging and one for xBee config. So I need a simple C code... :) That will written to AVR.
Again>AVRs function:

PC>FT232RL>AVR>xBee
PC<FT232RL<AVR<xBee

AVR gives direction to serial data, receives from FTDI and sends to xBee or receives from xBee and sends to FTDI(PC)
For debugging mode AVR will not send serial data to xBee.

Thanks again ;)

DADA
 

Dada Krauter

Feb 22, 2015
28
Joined
Feb 22, 2015
Messages
28
AND can you tell me how to convert data[] to result? I have following code:

i=0;
while(data(i)!=',')
{
uartprint(data(i)); I can't write this [] so used that ()
i++;
}

the code prints separately each digit. e.g. prints 1 then 2 then 3 (123)

so i want to save each digit together to one integer, let's say to result.

how can I do it in C code?

Thanks again :)

DADA
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,719
Joined
Nov 17, 2011
Messages
13,719
Not my domain. Someone else come to the rescue?
 

Dada Krauter

Feb 22, 2015
28
Joined
Feb 22, 2015
Messages
28
So I want to write this function in C language. Only one part, where AVR sends to xBee received data from FT232RL and where AVR sends data back to FT232RL received from xBee.
Im making flight controller, I have onboard xBee module and I want to configure xBee module by connecting controller to PC without any other FTDI boards like that> https://www.sparkfun.com/products/11812 <(X-CTU>xBee config. program> http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/xctu <) and also I don't want to use two FT232RL chips, one for debugging and one for xBee config. So I need a simple C code... :) That will written to AVR.
Again>AVRs function:

PC>FT232RL>AVR>xBee
PC<FT232RL<AVR<xBee

AVR gives direction to serial data, receives from FTDI and sends to xBee or receives from xBee and sends to FTDI(PC)
For debugging mode AVR will not send serial data to xBee.

DADA

Someone knows how to do that?? I need C code :)

Thanks :))

DADA
 
Top