My concept is I have two designed boards, One with AT90USB1287, other with ATmega32A both are working properly.
AT90USB1287 is talking to the PC via USB. ATmega32A is talking to the PC via USART(RS232).
Now i have connected ATmega32A board to AT90USB1287 using UART communication(RS232 cable by disabling connection to PC) Because both boards has to work together with one PC. Easiest way is UART connection between those two.
If i want to send data from ATmega32A to PC means, I have to get data from ATmega32A to ATusb901287 and send it to PC via USB.
I am confusing how to get data from ATmega32A to AT90USB1287. I have given connections like 1. connected RxD pin i.e., PD0 i.e., Pin 14 of ATMega32 to TxD pin i.e., PD3 i.e., Pin 28 of AT90USB1287 2. connected TxD pin i.e., PD1 i.e., Pin 15 of ATMega32 to RxD pin i.e., PD2 i.e., Pin 27 of AT90USB1287 3. USB pins of AT90USB1287 are connected to PC USB.
I have implemented UART functionality for both controllers.
The problem is i am not able to send the command that i got from PC to AT90USB1287 via USB. the command will be in USB receive buffer. I have to send the command to another micro controller using UART of AT90usb1287.
I have one more problem with this communication between two microcontrollers using USART. I have the interface code for both controllers like this.
I have the first board with AT90USB1287 microcontroller which is connected to PC using USB, I have several commands like this "CMD", "TEMP" ... When i send command it gives the response. Which is working perfectly. I have to connect another board which contains ATmega32A microcontroller to this board using USART. I have connected and I implemented USART communication in both boards, even the second board also have the similar type of command format and i need to send command to get response as well.
To send the Command from PC to second board i have to send the command first to AT90USB1287 board using USB communication and from that to ATmega32A using USART. I have done that and i am able to get response from second board also but i have one problem. What happening with my code is whatever command i send from PC it is sending to second board, i need to change like only commands which exist in second board has to sent to the second board.
Can anyone suggest me that how to stop sending all commands and send only those 5 commands which related to second board? Please help me with this.