SOFTWARE UART - ASM ERRORS

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
LEEDNH
Posts: 8
Joined: Fri Feb 03, 2017 8:44 pm

SOFTWARE UART - ASM ERRORS

Post by LEEDNH » Mon Feb 01, 2021 9:38 pm

I have been running code using the software uart which has worked flawlessly for the past couple of years.
I recompiled and got errors at the asm level. I would very much appreciate any help. Perhaps I could try a copy of SUART V1.4???

After updating to SF VERSION 2.2.3.6 - ICC 1.2.0.7 , the same program
APPEARS TO COMPILE OKAY BUT THE ASM PHASE PUTS UP THE RED FLAG.
GENERATES 3 ERRORS ALL (ASM ERROR):ERROR[113] C:\FILE PATH\name.asm 1067:
Symbol not previously defined (Z) (C) (C)

Device = 18F44k22 'using Vdd = 5.0 v
Clock = 64

' Software UART SET-UP ports tx/rx
SetBaudrate(sbr19200) ' software uart serial data rate is 19200 baud
SetTX(PORTC.4) ' software uart tx port PIN 23
SetRX(PORTC.5) ' software uart rx port PIN 24
SetMode(umInverted) ' software uart serial data is Inverted OR (umTrue)

' ******** READ THE SOFTWARE UART START inverted 19200 8N1 **********
For index = 0 To 115
UART.Read(db)
If index = 16 Then
fix1=db
ElseIf index = 17 Then
fix2=db
ElseIf index > 52 And index < 86 Then
v(index-53) = db
ElseIf index > 109 And index < 114 Then
v(index-106) = db 'v(4) - v(7)
EndIf
Next

LEEDNH
Posts: 8
Joined: Fri Feb 03, 2017 8:44 pm

Re: SOFTWARE UART - ASM ERRORS

Post by LEEDNH » Tue Feb 02, 2021 5:57 am

I think I may have "cried wolf" a bit hastily! I dug out my old computer (on its last legs locks on over-temp) and did not have the error that I mentioned previously. Somehow I must have messed up the installation on the new machine.... I'm a bit embarrassed, one might even say chagrined.....
LEE

Jerry Messina
Swordfish Developer
Posts: 1225
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SOFTWARE UART - ASM ERRORS

Post by Jerry Messina » Tue Feb 02, 2021 10:57 am

I think I may have "cried wolf" a bit hastily!
I don't think you did. Your old PC probably has an older version of the compiler.

The SUART.bas in SF VERSION 2.2.3.6 - ICC 1.2.0.7 will show the error.
I tried to simplify some of the include files and left out some stuff. Sorry!

The attached file should fix it. Unzip and copy SUART.bas to your Library or UserLibrary folder.
NOTE: the file download has been moved to the UserModule Wiki page at https://www.sfcompiler.co.uk/wiki/wiki- ... /SUART.zip

LEEDNH
Posts: 8
Joined: Fri Feb 03, 2017 8:44 pm

Re: SOFTWARE UART - ASM ERRORS

Post by LEEDNH » Tue Feb 02, 2021 10:23 pm

Hi Jerry,
Thank you for your fast response.
The two versions of the compiler that are on the old and new laptops are the latest version - that's what really had me confused...
I loaded up the SUART file and the magic is back!
After my code would no longer compile, I loaded the SUART sample code and it had the same result. Then I thought I would post and inquire.

Back about 3 years, I originally tried to use the standard UART but found the SUART was much easier to implement inside a for-next loop.

Let me just add one final comment... THANK YOU VERY MUCH, JERRY!! (it's one of the most frequent phrases that I see)

Post Reply