benlhy / Padauk

Example code for Padauk Microcontrollers.
https://westsideelectronics.com/padauk-microcontrollers/
26 stars 7 forks source link

Compile error. ENGINT; is causing this error. not sure why . using Padauk 0.92 IDE #1

Closed mogupta closed 2 years ago

mogupta commented 2 years ago
#include    "extern.h"

void    FPPA0 (void)
{
    .ADJUST_IC  SYSCLK=IHRC/4       //  SYSCLK=IHRC/4

    PA = 0b_0000_0000; // Port A Data register
    PAC = 0b_1111_1111; // Port A Control register, 0/1: input/output
    PAPH = 0b_0000_0000; // Port A Pull-High Register 0/1: disable/enable
    PADIER =  0b_1111_1001; // Port A Digital Input Enable Register, 1/0: enable/disable, Bit 2:1 is reserved

    T16M = 0b_0011_0111; // Timer 16 mode: clock:CLK, Pre-divider:+64, Interrupt: bit 15

    INTEN.T16 = 1;
    INTRQ = 0; // Clear the INTRQ register
    ENGINT;    // Enable global interrupts

    //  Insert Initial Code

    while (1)
    {

    }
}

void    Interrupt (void)
{
    pushaf;

    if (Intrq.T16)
    {   //  T16 Trig

        Intrq.T16   =   0;

        // does not do conversions from binary to values, i.e pa.3 = !pa.3 doesn't work

        if (pa.3 == 1) {
            pa.3 = 0;
        } else {
            pa.3 = 1;
        }
    }

    popaf;
}
Compile ...
C:\Users\m\Documents\padauk\rftest\rftest.PRE
C:\Users\m\Documents\padauk\rftest\rftest.C
Link ...
memory 0x38 ~ 0x3B for stack, vector = 0x0
C:\Users\m\Documents\padauk\rftest\rftest.C(23): Find 2Cyc loop : -> 0043 jmp to 0043 
$:INTEN.html#Goto(1):       Please refer IDE Help : Goto
PMC150  : ROM Size : 0x3F8
PMC150  : Last use Code : 0x20 , Remain Free-Code : 0x3D8 , Remain Free-RAM : 60

2 error(s), 0 warning(s)
mogupta commented 2 years ago

I figured. I was using PMC150C as target device. it works fine for PMS150C . Not sure why. engint would throw error.