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

BASCOM-AVR : Print HEX values UART : REPLY

$
0
0
[quote:9d0a3e3a3b="kimmi"]I have no idea why , but you can try buffer input [code:1:9d0a3e3a3b]Config Com1 = 4800 , Synchrone = 0 , Parity = None , Stopbits = 2 , Databits = 8 , Clockpol = 0 Config Com2 = 4800 , Synchrone = 0 , Parity = None , Stopbits = 2 , Databits = 8 , Clockpol = 0 Enable Interrupts Config Serialin = Buffered , Size = 20 Config Serialin1 = Buffered , Size = 20 Open "com1:" For Binary As #1 Open "com2:" For Binary As #2[/code:1:9d0a3e3a3b][/quote:9d0a3e3a3b] I'm in tears :( no luck either... Other approach: Rewriting the Read Uart routine. Im now using this code to receive from the uart, and convert it back to a long in HZ Any idea if this could be done better? [code:1:9d0a3e3a3b] Sub Read_freq(byval Port As Byte) Local Str_readfreq As String * 14 Local Readcommand As Byte Local Freqread As Long Readcommand = &H03 'Read VFO command If Port = 0 Then Printbin #1 , 0 ; 0 ; 0 ; 0 ; Readcommand ; $timeout = 1000000 Inputbin #1 , Rx1(1) , 5 Elseif Port = 1 Then Printbin #2 , 0 ; 0 ; 0 ; 0 ; Readcommand ; $timeout = 1000000 Inputbin #2 , Rx1(1) , 5 End If Str_readfreq = Bcd(rx1(1)) Str_readfreq = Str_readfreq + Bcd(rx1(2)) Str_readfreq = Str_readfreq + Bcd(rx1(3)) Str_readfreq = Str_readfreq + Bcd(rx1(4)) Freqread = Val(str_readfreq) Freqread = Freqread * 10 If Port = 0 Then Readcat1 = Freqread Elseif Port = 1 Then Readcat2 = Freqread End If Freqread = 0 Str_readfreq = "" End Sub [/code:1:9d0a3e3a3b]

Viewing all articles
Browse latest Browse all 20563

Trending Articles



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