Ralph Merwin

56F8013, Working with Peripheral Module Registers in "C"

Discussion created by Ralph Merwin on Jul 3, 2007
Latest reply on Jul 26, 2007 by Pascal Irrle
I'm using CodeWarrior 56800E 8.1 (CodeWarrior 56800/E Hybrid Controllers version 7.1).   I'm trying to use "C" bit fields to access peripheral registers in a 58F8013.

The CodeWarrior Help System -> Targeting 56800E -> C for DSP56800E -> Working with Peripheral Module Registers section says that the compiler generates byte references for bit fields, and:

"The use of byte accesses is due to a compiler optimization that tries to generate the smallest possible memory access."

The code generated for bit field does generate byte accesses to the peripheral registers, which doesn't work.

I've searched various forums and groups and haven't seen anyone describing a work around, and I'm not a fan of Processor Expert's method of using one of several different macros for each bit operation.

Does anyone know if there's a compile option/switch, or maybe section definition option, that tells the compiler to not "help" in this manner?

Ralph

Outcomes