Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20587

BASCOM-AVR : Buffered serialin on AVR Mega162 with 2 UARTs : NEWTOPIC

$
0
0
Greetings ! I am having an issue with Buffered SerialIn on a Mega162. When I use UART0: it works as expected When adapting the code for UART1, the Cmd_string is not printed, just the "hello ..." I must be overlooking something trivial, but after a few hours I decided to ask you guys for help. The working version: [code:1:d5501b9763]$regfile = "m162def.dat" Config Com1 = 38400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Config Serialin = Buffered , Size = 20 , Bytematch = 10 Config Serialout = Buffered , Size = 20 Dim Cmd_string As String * 20 Dim New_cmd As Bit Enable Interrupts Do If New_cmd = 1 Then New_cmd = 0 Print "hello ..." ; Cmd_string End If Loop End '----------------------------------------------------------------- Serial1charmatch: Pushall Input Cmd_string Noecho Clear Serialin Set New_cmd Popall Return[/code:1:d5501b9763] The failing version with UART1 [code:1:d5501b9763]$regfile = "m162def.dat" Config Com2 = 38400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Config Serialin1 = Buffered , Size = 20 , Bytematch = 10 Config Serialout1 = Buffered , Size = 20 Dim Cmd_string As String * 20 Dim New_cmd As Bit Enable Interrupts Open "com2:" For Binary As #2 Do If New_cmd = 1 Then New_cmd = 0 Print #2 , "hello ..." ; Cmd_string End If Loop Close #2 End '----------------------------------------------------------------- Serial1charmatch: Pushall Input #2 Cmd_string Noecho Clear Serialin1 Set New_cmd Popall Return[/code:1:d5501b9763] [b:d5501b9763][color=red:d5501b9763](BASCOM-AVR version : 2.0.7.6 )[/b:d5501b9763][/color:d5501b9763]

Viewing all articles
Browse latest Browse all 20587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>