Take a look at this short code and tell me what you think.
volatile unsigned int i = 0;
/* Loop forever */
/* Toggle LED @ PD4, through GPDO */
SIUL.GPDO52.R ^= 1<<7; /* Doesn't work. According to datasheet
bit 7 in GPDO52 handles this IO, but
nothing happens when this code is
SIUL.GPDO52.R ^= 1<<0; /* This works. It seems the bit numbers are
written backwards in datasheet (they are
numbered from left to right in datasheet
but probably supposed to be numbered
from right to left(?)) */
/* Toggle LEDs @ PD5-6, through PGPDO */
SIUL.PGPDO3.R ^= 0x0060; /* This should toggle bits 5-6, right?
but this line does nothing to PD5-6. */
SIUL.PGPDO3.R ^= 0x0600; /* Lets try this. Now PD5-6 are toggled.
it seems that this time the bits in
the chip is numbered from left to right,
just like in the datasheet. But this is
backwards from every digital logic
convention, right? */
/* Delay */
i = 0x00020000;