Gert Baars

Code: #include <hidef.h> /* for EnableInterrupts ma...

Discussion created by Gert Baars on Jul 12, 2008
Latest reply on Jul 13, 2008 by Gert Baars
Code:
#include <hidef.h> /* for EnableInterrupts macro */#include "derivative.h" /* include peripheral declarations */dword a;void main(void) {  /* Disable Watchdog */  SOPT1 &= 0b00111111;     /* set FLL division */  MCGC4 &= 0b11011100;  MCGC4 |= 0b00100001;        RGPIO_ENB = 0xffff;  RGPIO_DIR = 0xffff;        while (1){      for (a=0;a<10000;a++) {    }    RGPIO_TOG = 0xffff;      } }

 
With this on an RGPIO pin only 7.5 ms per loop is measured.
The for loop translates into 7 asm.inst. The average speed
is 10 MIPS only. How can it go faster??

Outcomes