Are you able to write the code in a simple way ????
unsigned char buf;
buf = AD0DAT0;
and see what you get in the buf
On 11/3/08, evsource_com wrote:
> I'm sort of new at the LPC micros, but have some code apparently
> compiled with the Keil compiler for a lPC938. I've got everything
> compiling fine, except for the ADC code. The relevant portions of the
> code are this:
> (line 80): res = (XBYTE[AD0DAT0L_ADDR]<<2) | XBYTE[AD0DAT0R_ADDR]; //
> res is declared as "uint16 res = 0;", this line is for channel 0
> I get the following error when compiling:
> AD.c: 180: error 88: illegal cast of LITERAL value to 'generic'
> pointer from type 'literal-long-int' to type 'volatile-unsigned-char
> generic* '
> Can anyone shed some light on the problem? The XBYTE is defined in
> ABSACC.H, which I had to find online, and defined like this:
> #define XBYTE ((unsigned char volatile *) 0x20000L)
> Thanks in advance,
F-27, VRAJWADI COMPLEX,
Nr. UTKARSH SCHOOL,
GUJARAT 390015, INDIA