Finally we are finalizing all the work done in developing PicGIM.

We are doing several tests on different hardware boards to put PicGIM under stress.

Here's an example of what will be the code to do a LED blinking once per second using the Timer.

Most of all, the use of the interrupts is very very simple.

 

 

#include "picgim_main.h"

 

 

void led_blink( void ) {
pg_pin_toggle( L_B0 );
}

void main( void ) {
pg_pin_mode( T_B0 , PG_OUT );
pg_initialize();
pg_event_set( PG_EVENT_GLOBAL , PG_ENABLE );
pg_event_set( PG_EVENT_PERIPHERAL , PG_ENABLE );
pg_timer_set_period( PG_TIMER_0 , 1 , PG_SEC );
pg_event_attach( PG_EVENT_TMR0 , led_blink );
pg_event_set( PG_EVENT_TMR0 , PG_ENABLE );
pg_timer_start( PG_TIMER_0 );
PG_HALT;
}