View previous topic :: View next topic |
Author |
Message |
binu_ji
Joined: 07 Jan 2006 Posts: 17
|
Posted: Sun Nov 06, 2011 10:46 am Post subject: Soft Uart receives only 25bytes |
|
|
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 |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
|
Back to top |
|
|
binu_ji
Joined: 07 Jan 2006 Posts: 17
|
Posted: Sun Nov 06, 2011 11:08 am Post subject: |
|
|
Thanks for your quick reply evert
I am using Atmega8 and 3.68mhz crystal
My bascom V1.11.9.0 |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Sun Nov 06, 2011 11:25 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|