Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Using ATD on HCS12 microprocessor

Avatar of Frosty555
Frosty555Flag for Canada asked on
HardwareMath / ScienceEmbedded Hardware
5 Comments1 Solution3213 ViewsLast Modified:
This is a really long shot, but here goes.

I am working on a lab. It is a school assignment. We are working on creating a simple C program that is downloaded to a Dragon12 Development Board. The program runs on the HCS12 microprocessor.

The point of the lab is to read in an analog signal, and display it's value on a seven segment display.

To do this you have to set a number of control registers, and configure the board so that the ATD works properly and samples at a reasonable rate. Enable the ATD, and finally capture input every time an interrupt is triggered (again by reading some more registers). Probably there's some special cleanup you have to do in the interrupt as well to prepare for another read.

Most of the code I have done. I can download programs to the board, I can access the registers by name, I know how to hook into interrupts on the board and setup interrupt service routines.

What I don't understand is just the idea of how this particular microcontroller / development board uses the ATD. What's the process by which the data flows from it's analog state, to an appropriate variable in my program? The documentation is very cryptic.

Any help before Monday would be greatly appreciated.

Some reference material:

Picture of a Dragon12 Development Board:
http://www.ece.utep.edu/courses/web3376/Dragon12_files/Dragon12_Large.jpg

ATD Block User Guide (specific info on the registers related to the ATD)
http://www.cse.yorku.ca/course/3215/labs%20documentation/S12ATD10B8CV2.pdf

HCS12 Block Diagram (note the  ATD0 and ATD1 blocks, those are the magic components)
http://www.technologicalarts.com/myfiles/jpeg/9s12xdp512block.jpg

HCS12 Microprocessor Complete Documentation:
http://www.cse.yorku.ca/course/3215/labs%20documentation/MC9S12DP256.pdf

Dragon12 Schematic:
http://www.cse.yorku.ca/course/3215/labs%20documentation/DRAGON12_Schematics.pdf

Example code that may or may not work:
http://users.ece.utexas.edu/~valvano/programs/adtest.c
ASKER CERTIFIED SOLUTION
Avatar of NovaDenizen
NovaDenizen

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers