Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Soft Uart receives only 25bytes

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
binu_ji

Bascom Member



Joined: 07 Jan 2006
Posts: 17

india.gif
PostPosted: Sun Nov 06, 2011 10:46 am    Post subject: Soft Uart receives only 25bytes Reply with quote

Hi
I am using 2 soft usart, in which 1 is connected to a GPS and other to GSM modem.

The GPS usart can works well, it can receive all the data correctly.

While the GSM usart receives only 25bytes correctly and the remaining are junk values.

can anybody help me over this.

Binu

Code:

'####################################
'GSM Modem
'####################################
'Now open a RECEIVE channel for input
Open "comc.0:9600,8,n,1" For Input As #1
'Open a TRANSMIT channel for output
Open "comc.1:9600,8,n,1" For Output As #2
'####################################
'####################################
'GPS module
'####################################
'Now open a RECEIVE channel for input
Open "comc.3:9600,8,n,1" For Input As #3
'####################################


This is the output i got

Code:
+CMGR: "REC READ","BT-SBIɤQLL)zձe`:1&I5)oHZ<SYN><VT>4uZ/<DC2>+5oY<BS><VT><DC4>r],R%lY$bY.<CR><VT>nVK<STX>8NS2CH<CR><LF>
Back to top
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Sun Nov 06, 2011 10:50 am    Post subject: Reply with quote

What avr, clock source and Bascom version are you using?
_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
binu_ji

Bascom Member



Joined: 07 Jan 2006
Posts: 17

india.gif
PostPosted: Sun Nov 06, 2011 11:08 am    Post subject: Reply with quote

Thanks for your quick reply evert

I am using Atmega8 and 3.68mhz crystal
My bascom V1.11.9.0
Back to top
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2483
Location: Queensland

australia.gif
PostPosted: Sun Nov 06, 2011 11:25 pm    Post subject: Reply with quote

IMHO software UARTs are or debugging, or very non-critical applications only.

You cannot ( in general ) run two software UARTS for receive at the same time. SOFTWARE UART means exactly that, that the UART receive is using software to do the bit collecting. While its doing that on one channel, it must ignore the other one. Only if the messages on each channel are at different times, and never overlap, will you ever get this to work. My recommendation is you use at least one hardware UART, if not two. That is what Atmel provide them for.

Even with one ( or two ) hardware UARTS doing the receiving, you still need to run with input buffers, so that the actual inputs are done by interrupts. Bascom provides these, and the ischarwaiting and inkey commands to decide when to get a character.

_________________
Adrian Jansen
Computer language is a framework for creativity
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive 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