OK, I know I'm a complete muppet* but I've searched and tried to find an answer to this, reading the AVR1003 document, and the code snippets....
I get the general drift, - surely it should be a one-liner - but when the examples wobble on about:
AVR_ENTER_CRITICAL_REGION( ); volatile uint8_t * tmpAddr = address; #ifdef RAMPZ RAMPZ = 0; #endif asm volatile( "movw r30, %0" "\n\t" "ldi r16, %2" "\n\t" "out %3, r16" "\n\t" "st Z, %1" "\n\t" : : "r" (tmpAddr), "r" (value), "M" (CCP_IOREG_gc), "i" (&CCP)
I'm lost. What means "address"? Addres of what??? "value" likewise.
Sorry, but I need to run this clock-switching mularkey in a non-optimised way, so I can debug other bits using a Dragon.
Could someone be so kind as to post their Quick-and-Dirty fix so I can cut'n'paste, and get on with some REAL work?
Ever so grateful!
*Possibly an insut to complete muppets...