sending command through USART

Status
Not open for further replies.

veerubiji

Member
I am new to this kind of communication. I am able to send command from PC to AT90USB1287 microcontroller as well as able to get response using USB communication. Now i have connected another microcontroller(ATmega32) to this board via USART communication. I am trying to send command from PC to this board. Both controllers have different commands. So i have created an array containing both controllers commands in AT90USB1287 controller. My concept is compare the incoming command from PC with all commands in array based on result i am trying to send commands to ATmega32 controller using USART.Can anyone help me how to fix this? Do I need any conversion here? If so, please help me with an example.
 
Last edited:
To connect the PC to the USART of the MEGA32 you need a level shifter like the MAX232 or another type.
That Part works with +/-12V levels at PC side and 5V at Microcontroller side.
Additional the signal will be inverted.
There can be found some cheap solutions with Transistors in the Internet,
but there is no guaratee that they will work proper on every PC.

The 2 Microcontrollers can be connected directly together via a crossover from TXD to RXD.
At the USB Controller I'll suggest You to write a parser that desides if the command is for the USB Controller or the MEGA32.
The MEGA32 command then be given out to the USART.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…