I am using MC56F8013. I am very familar C30 complier of Microchip MPLAB. In C30
we can access any register with simple keywords. When we include the appropriate
header file we can access any registers. For example ADCON1 register can be
accessed with:
ADCON1 = 0x1234;
value = ADCON1;
And any port pin can be accessed like this:
_LATC13 = 1;
will make port bit 13 of port C.
We can make it more clear with
#define mainsLED _LATC13
#define mainsPin _RC14
if(mainsPin)
mainsLED = 1;
else
mainsLED = 0;
_RC14 is for reading bit14 of port C and _LATC13 is for writing to bit14 of port
C. These keywords are defined in the appropriate header file in MPLAB C30.
My question is: how to do it in codeWarrior? How can we access the internal
registers of MC56F8013? For example one of the register related with ADC is
CTRL1. So which file is to be included so that:
CTRL1 = 0x1234;
will not give any error message.
I need to access (read and write) port pins, and give names to port pins. How to
do that? Which file is to be included?
CodeWarrior for DSP56xxx: Accessing internal registers and port pins
Started by ●May 29, 2009