Sample C code for reading the ADC on an HCS08 processor?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sample C code for reading the ADC on an HCS08 processor?

2,696 Views
DB
Contributor I
Can anyone point me to some sample C code showing how to sample the ADC on an HCS08 microcontroller (declare the variables and types, read the ADC, assign the value to the variable? I'm able to get the ADC to sample the input signal but the data in my debugger doesn't seem to make sense.
 
I'm using CodeWarrior 5.1and running a MC9S08GB60 processor on an M68DEMO908GB60 demo board.
 
Excuse the newbie question...I'm a hardware apps engineer just learning to code this product.
 
Thanks.
 
Labels (1)
0 Kudos
3 Replies

395 Views
DB
Contributor I
Thanks, Peg and UcTechnoGeek.
 
I am using the 9S08GB60 but the code looks similar.  I'll keep plugging and hopefully come up with ADC values displaying in my debugger window that make sense.
 
- DB
0 Kudos

395 Views
UcTechnoGeek
Contributor II
Here is a project that I've used for testing.
 
It uses the ADC on a 9S08GQ8 board.
 
It uses an older CW version, but should still work
 
uCTechnoGeek
0 Kudos

395 Views
peg
Senior Contributor IV
Hi and welcome DB,
 
Take a look at the QG4/8 Quick Start Guide in the sticky messages at the top of this forum.
 
0 Kudos