Sign in

username:

password:



Not a member?

Search LPC900_users



Search tips

Subscribe to LPC900_users



Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | LPC900 | LPC938 ADC code problems - porting from Keil

Find help, specifications and source code for the LPC900. The LPC900 challenges Microchip and AVR based on the worlds most popular 8-bit architecture the 80C51. With a 2-clock core the LPC900 series is a high performance, very flexible and low cost 8-bit microcontroller family. Designers using or interested in these devices are encouraged to share their know-how and ask questions.

LPC938 ADC code problems - porting from Keil - evsource_com - Nov 3 14:09:48 2008

Hi,

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,

Ryan

------------------------------------



(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )


Re: LPC938 ADC code problems - porting from Keil - PES - Nov 4 4:24:25 2008

Dear Ryan,
Are you able to write the code in a simple way ????
like
unsigned char buf;
buf = AD0DAT0;
and see what you get in the buf
On 11/3/08, evsource_com wrote:
>
> Hi,
>
> 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,
>
> Ryan
>

--
Doshi Harshal
POTENT
F-27, VRAJWADI COMPLEX,
Nr. UTKARSH SCHOOL,
Gadapura,
VADODARA
GUJARAT – 390015, INDIA
PH: 09429071421
www.potent.co.in

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )