Hello Lande,
there are some errors in the code:
1/ MASK_BITS = 0x00 is not correct
MASK_BITS = 0xFF is good: each bit to 1 means GPIO
2/ init section:
***MCF_GPIO_PANPAR &= ~(MASK_BITS);
***MCF_GPIO_DDRAN = MASK_BITS;
you must place the init section in "main.c" (after start_AD()
to be called only one time.
3/ the macro SSA0_ON is not correct
it must be as this:
#define SSA0_ON MCF_GPIO_PORTAN = (uint8)(MCF_GPIO_PORTAN| MCF_GPIO_PORTAN_PORTAN0);
#define SSA0_OFF MCF_GPIO_PORTAN = (uint8)(MCF_GPIO_PORTAN&~MCF_GPIO_PORTAN_PORTAN0);
don't mix MCF_GPIO_PORTTA and MCF_GPIO_PORTAN
now in your procs form_SSA0_function() you call SSA0_ON or SSA0_OFF without init section.
Greetings, Henri