- This topic has 6 replies, 4 voices, and was last updated 10 years, 10 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › Problems with RS-232 Interfacing
Hey guys. I have a problem with interfacing my bluetooth module (aubtm-20) with Atmega 640. The BT module works perfectly and responds to the commands sent when connected directly to a PC. I have also debugged the code and it works perfectly. But when I connect the BT module (Rx and Tx pins are connected to MAX232 and then to DB9 connector) to the microcontroller using DB9 connector + MAX232, I get incomplete response.
For example, instead of getting getting the response as “<CR><LF>OK<CR><LF>”, I get a response like “<CR><LF>O<LF><CR><LF>”. The response I get seems to be a part of the actual response but I get a different response everytime.
Rx of BT module is connected to Tx of microcontroller and Tx of BT module is connected to Rx of microcontroller.
I also have shorted grounds of both the boards and have ensured that the baud rates are proper.
Please let me know what the problem could be.
Your BT module works on 3.3V and it gives 0 for low bit and 3.3V for high bit. It will cause issues while connecting with 5V ttl logic. Use a 3.3V to 5V level shifter before connecting it with the controller
I don’t where is the problem, whether it is in code or hardware?
can you post your Usart code?
Hi Shah,
If you are able to connect your Bluetooth module directly to PC, it seems that the bluetooth module has max232 on board. Try reducing the length of wire between your controller and bluetooth module. Can you post your code to verify.
Hi Shah,
If you are able to connect your Bluetooth module directly to PC, it seems that the bluetooth module has max232 on board. Try reducing the length of wire between your controller and bluetooth module. Can you post your code to verify.