How to do a simple toggle of a pin outside of main in Harmony
This maybe very basic, but using the Harmony framework outside of the main if i go to another file i can't seem to do something like toggle a pin or do a printf to UART, why? What am i missing?
Example: Inside the main.c i do LATGINV = 0x00000001; and it works, now if i go to IntHandlerDrvTmrInstance0 where i want to do the same it does nothing!
For these example i started a simple project where i configured the oscillator for a FRC with PLL to work at 32MHz, then in Harmony Framework Configuration
-> Drivers -> Timer, i choose a prescale of 256, in the Timer period (i'm not sure) but i want the interrupt to happen at each 8us, so i choose 1.
The code in system_interrupt.c i simple put that line:
void __ISR(_TIMER_1_VECTOR, ipl1AUTO) IntHandlerDrvTmrInstance0(void)
LATGINV = 0x00000001;
Maybe a something is missing, but even when i put LATGINV = 0x00000001; elsewhere in code, except main, it doesn't seem to work.
Btw i tried to follow whats in this page _https://microchipdeveloper.com/harmony:tmr-static
void APP_Initialize ( void )
appData.state = APP_STATE_INIT;
bool appInitialized = true;
appData.state = APP_STATE_SERVICE_TASKS;
DRV_TMR0_Start(); // Start the Timers
What i'm using:
MPLAB X IDE v5.20
post edited by Nmaster88 - 2019/06/12 08:16:41