When using the software uart module in the following program it works fine (note that the NMEA commands are commented out of the main program loop);
Code: Select all
// device and clock
Device = 18F2620
Clock = 10
// import modules...
Include "NMEA.bas"
Include "Usart.bas"
Include "SUART.bas"
' local variables
Dim NMEAItem As TNMEA
Dim Sentence As String
' program start
USART.SetBaudrate(br38400)
UART.SetTX(PORTB.0)
UART.SetMode(umTrue)
UART.SetBaudrate(sbr9600)
While True
'If NMEA.GetItem(NMEAItem) And NMEAItem.Valid Then
Sentence = "XXXXXXXXXXXXXXXXXXXXXXX"
UART.Write("[Test]",Sentence,13,10)
'endif
Wend
However, with this code the software uart will not function correctly (NMEA commands now included in the main program loop);
Code: Select all
// device and clock
Device = 18F2620
Clock = 10
// import modules...
Include "NMEA.bas"
Include "Usart.bas"
Include "SUART.bas"
' local variables
Dim NMEAItem As TNMEA
Dim Sentence As String
' program start
USART.SetBaudrate(br38400)
UART.SetTX(PORTB.0)
UART.SetMode(umTrue)
UART.SetBaudrate(sbr9600)
While True
If NMEA.GetItem(NMEAItem) And NMEAItem.Valid Then
Sentence = "XXXXXXXXXXXXXXXXXXXXXXX"
UART.Write("[Test]",Sentence,13,10)
endif
Wend
I've stripped as much code as possible to simplify the bug, any assistance would be greatly appreciated!