Atmel AVR Microcontroller discussion group.
multiple software uart........... - ktucker8825 - Nov 10 21:30:00 2003
I am currently working on a project with bascom-avr, atmega16L.
i am utiliizing the hardware usart to talk to a serial LCD display. i
need 2 additional ports. i can get both software uarts to work, but
only one at a time. when i try to implement both software uarts only
one will work properly. the other is putting out garbage (as seen on
the terminal) my code is only calling one software uart at a
time....... i am (at this time) only interested in outputting data on
these ports and the output strings will be sent with no handshaking
as canned strings ............any ideas
TIA
Ken Tucker
***** Code Snip
Do
Call Serial_1()
Call Serial_2()
Loop
Sub Serial_1()
'open portD.4 for output
Open "comd.4:9600,8,n,1" For Output As #1
'open portD.5 for input
Open "comd.5:9600,8,n,1" For Input As #2
Print #1 , "this is a test output of soft port 1";
'close ports
Close #1
Close #2
End Sub
Sub Serial_2()
'open portD.6 for output
Open "comd.6:9600,8,n,1" For Output As #3
'open portD.7 for input
Open "comd.7:9600,8,n,1" For Input As #4
Print #3 , "this is a test output of soft port 2";
'close ports
Close #3
Close #4
End Sub

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )