Problem with version 1.1.2.0 of Positron16 using PIC24FJ1024GA606

Started by Werwolf, Jul 24, 2024, 08:46 AM

Previous topic - Next topic

Werwolf

Hello Les,

After upgrading the compiler to version 1.1.2.0 of Positron16, a problem with the "CLEAR" (Clear all RAM area) command has occurred with PIC24FJ1024GA606. Compilation result:

"ASM ERROR: Assembler Error at Line [2876] Invalid operands specified ('repeat #0xffffffff').

; clearing ram For the Clear directive
    clr.w W0
    mov.w #0x0800,W1
    repeat #0xffffffff
    mov.w W0,[W1++]
    clr.w TBLPAG
    clr.w BPF
    bset.w CORCON,#pp_psv

When using PIC24FJ256GB106/PIC24FJ256GB110 compiling everything is fine.

; clearing ram For the Clear directive
    clr.w W0
    mov.w #0x0800,W1
    repeat #0x1fff
    mov.w W0,[W1++]
    clr.w TBLPAG
    clr.w BPF

I haven't found any more problems so far.

Additional question: what is the possibility to include PIC24FJ1024GA610 controller? With three SPI, four UARTs and other peripherals in the design, 64 pins are not enough. I understand that this is extra work, please send me an invoice by PM :).

Best Regards
Alvydas

top204

Well... That anomaly is a mystery to me as to why it is doing it on the PIC24FJ1024GA606 and not others, because they all use the same mechanism. For some reason, it is seeing the amount of RAM on the device as huge, yet I  have checked the compiler's source and it reads the amount of RAM from the .ppi file section: "RAMAMOUNT=32768     ; Total amount of RAM (in bytes)"

I will investigate and create an upload ASAP.

I'll see what I can do for the newer device, and send you a message.

Werwolf

Thank you Les
this anomaly only appeared in version 1.1.2.0. When I experimented with "string" type variables in 1.1.1.9, it was not present.

Best Regards
Alvydas

trastikata

Quote from: top204 on Jul 24, 2024, 09:37 AMWell... That anomaly is a mystery to me as to why it is doing it on the PIC24FJ1024GA606 and not others, because they all use the same mechanism. For some reason, it is seeing the amount of RAM on the device as huge, yet I  have checked the compiler's source and it reads the amount of RAM from the .ppi file section: "RAMAMOUNT=32768     ; Total amount of RAM (in bytes)"

Is it possible that the variable in the compiler holding the RAM amount is declared as signed word instead of word?

32768 will overflow a signed word, thus adjusting the amount of RAM in the PPI file to 32767 will permit the compiler to compile.

Werwolf

It seems you are right. In the ppi file I changed RAMAMOUNT=32768 to RAMAMOUNT=32767. The result is positive :)

; clearing ram For the Clear directive
    clr.w W0
    mov.w #0x0800,W1
    repeat #0x3ffe
    mov.w W0,[W1++]
    clr.w TBLPAG
    clr.w BPF
    bset.w CORCON,#pp_psv

Best Regards
Alvydas

top204

Now corrected.

I have lifted the maximum RAM allowed by the latest 16-bit compiler's operation to whatever the device contains, where it used to have a maximum of 32768 bytes of RAM, because of the PSV operation on the devices, and this was over-loading the capabilities of the Repeat mnemonic, which has a 14-bit maximum for its counts, so a value of 32768 was overloading it, because the value was also masked, and a subtraction of 1 for the Repeat mnemonic, and this was overloading to 0xFFFFFFFF.

It is always the same.... One small change in a the huge code listings of the compilers can have very subtle but catastrophic effects down the line. :-)

I thought the code I created to get around the PSV limitations was so clever, but I forgot to check some of the more subtle effects the RAM maximum non-limit would have. :-)

I will be uploading an update ASAP.

John Lawton

Quote from: top204 on Jul 24, 2024, 10:35 AMNow corrected.

I have lifted the maximum RAM allowed by the latest 16-bit compiler's operation to whatever the device contains, where it used to have a maximum of 32768 bytes of RAM...

Wasn't it Bill Gates that once said that "640K ought to be enough for anybody". It seems that PICs are getting ever bigger.

charliecoutas

I think that's right John. I also remember somebody saying that five computers would be enough for the world. I found this:

In 1943 Thomas Watson, chairman of IBM, said, "I think there's a world market for maybe five computers." With that kind of thinking, no one paid much attention in 1952 when a British scientist named Dummar wrote: It seems now possible to envisage electronic equipment in a solid block with no connecting wires.

Charlie

GaryC

Hello
   I had the Clear command fail on a 12F1501,  Les if I had your brains I would toss mine away!