Das Problem ist gelöst:
Die GPIO's befinden sich NICHT im Peripherie Bereich, sondern im SRAM Bereich
und so muss ich die anderen Macros benutzen.
also NICHT perSetBit(LPC_FIO0PIN,0); sondern varSetBit(LPC_FIO0PIN,0);
Die Firma NXP hat mir auch zurück geschrieben mit einem zusätzlichen Hinweis:
Code:
Bit-banding is possible, since the GPIO's are in the Cortex-M3 "SRAM" area.
Example for GPIO1.28:
#define BITBAND_SRAM(a,b) ((volatile uint32_t *)((0x22000000 + ((uint32_t)(a)-0x20000000)*32)))[b]
#define LED BITBAND_SRAM(&GPIO1->FIOPIN, 28)
This only makes sense for the FIOPIN or FIODIR registers, not for FIOSET and FIOCLR. Note that bit-banding performs a read-modify-write operation on the peripheral register when writing by bit-banding!
Also note that writing to FIOPIN by bit-banding requires a __DSB() instruction afterwards. This is due to the structure of the GPIO block.
Example:
LED = 1;
__DSB();
Im IAR-COMPILER kann das __DSB(); wie folgt geschrieben werden:
__asm("DSB"); /* ein doppelter Unterstrich */
Die Funktion ansich ist auch ohne das DSB (Data Synchronisation Barrier) gegeben. Aber das DSB stellt sicher, daß die intgerne Verarbeitung auch fertig geworden ist.
"The DSB instruction completes when all explicit memory accesses before it complete."
Lesezeichen