Problem with nmea module

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
jass130455
Posts: 3
Joined: Mon Sep 03, 2007 6:52 pm
Location: Patagual,Chile

Problem with nmea module

Post by jass130455 » Mon Sep 03, 2007 6:59 pm

in the compile process i have this error into this module:
Cannot promote a register in user source code(try promoting an alias in declaration block instead)
please somebody can explain more detail about this?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Mon Sep 03, 2007 7:34 pm

I've just copied the module and main program source from the wiki and it all compiles fine - I assume you have changed the program in some way. If so, can you provide some code...

jass130455
Posts: 3
Joined: Mon Sep 03, 2007 6:52 pm
Location: Patagual,Chile

Post by jass130455 » Tue Sep 04, 2007 5:34 pm

David, i just made a copy and paste from the wiki for the module and the main program, i try in other pc with same result. Coud be because i have SE edition ? ( i´m buy this great compiler but no arrive yet)

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Tue Sep 04, 2007 9:57 pm

I think the SE edition will never compile the NMEA module because the buffer is already 200 bytes

Code: Select all


#option NMEA_BUFFER_SIZE = 200
...

// These local constants and variables are used by the NMEA interrupt handler
Const NMEABufferSize = NMEA_BUFFER_SIZE // Size of the buffer
Dim FBuffer(NMEABufferSize) As Byte     // Array for holding received characters

if you used the examples in the same wiki page, you can see

Code: Select all

// local variables
Dim NMEAItem As TNMEA
Dim NMEAField As String

// this program with display the sentence identifier and the number
// of data fields the sentence has...
USART.SetBaudrate(br4800)
While True
...

and the TNMEA structure already has a field with a string of 80 bytes ... so this is beyond 256 chars ... far beyond the SE Edition limits. I do not know why the SE edition accept to compile it (I did not tried instead)... but it will never work I think.

Regards
Octal

jass130455
Posts: 3
Joined: Mon Sep 03, 2007 6:52 pm
Location: Patagual,Chile

Post by jass130455 » Tue Sep 04, 2007 11:31 pm

thank octal i´ll be wait for my compiler to work with this.

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Wed Sep 05, 2007 4:13 am

perhaps you can reduce the buffer size to 60 or 80 (instead of 200) to see :?

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Wed Sep 05, 2007 9:38 am

Tested it. Under SE Edition (last version downloaded today). It does not compile. It does not seem to be a problem with memory size. The exact error is
"Cannot promote a register in user source code(try promoting an alias in declaration block instead)"

at the line with the modifier INDF1.AsChar = "*" in code

Code: Select all

   Repeat
         POSTINC0 = GetBufferData
         If INDF1.AsChar = "*" Then
            ChecksumStart = Index + 1
         EndIf
         Inc(Index)   
      Until INDF1 = 0 
:? Any Idea ?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Wed Sep 05, 2007 2:44 pm

This is my fault. I coded the program using a BETA version of the compiler, which accepts the new construct. I've updated the wiki with a new version which should build OK (SE restrictions aside). If you want to change manually, then occurrences of 'AsChar' should be replaced with something like this...

Code: Select all

INDF1.AsChar = "*"
to

Code: Select all

INDF1 = byte("*")

Post Reply