Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Problem with RS-232 interfacing

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR
View previous topic :: View next topic  
Author Message
dhruvil_90

Bascom Member



Joined: 09 Apr 2012
Posts: 1

PostPosted: Mon Apr 09, 2012 1:02 pm    Post subject: Problem with RS-232 interfacing Reply with quote

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.
Back to top
View user's profile
hgrueneis

Bascom Member



Joined: 04 Apr 2009
Posts: 863
Location: A-4786 Brunnenthal

austria.gif
PostPosted: Mon Apr 09, 2012 4:33 pm    Post subject: Reply with quote

Hard to tell without the code and any other info.
Did you check the status report to see the %-deviation of the com?
Sometimes setting the internal pull-up on RX helps.
Hubert

edit: What you post looks like a character overrun.
Mostly happens if you spend too much time in an ISR.
Do you use serial buffer or polling...bytematch....???
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum