ATD for MC13213 SRB

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ATD for MC13213 SRB

2,360 次查看
Ikoria
Contributor I
Hi all.
I hope to have some answer here...
 
I have the MC13213-SRB dev kit (MC9S08GT/GB60 with RF modem)
There are an accelerometer on board, with the project "Acceleremeter V3.mcp" 
 
I try to develop an application using a simple various resistor.
 
Has you know, there are some pin on the board to connect other device, and to dev customised appilcation.
This pin could be for I/O or for the ATD mods...
 
For a quick dev I try to annalyse the Accelerometer project, to find where can I modify the ATD channel, but this way is hard...
 
Could you help me for this way?
Thx for all.
Iko
标签 (1)
0 项奖励
回复
4 回复数

759 次查看
Alban
Senior Contributor II
Hello IKO,

I don't use the project, but look for a write in the Register ATDCH.
This is where the selection of the channel is done.

It is described in the S08GB/GT60 datasheet if you wish more details. (Table 14-5.)

Cheers,
Alban.
0 项奖励
回复

759 次查看
Ikoria
Contributor I
Hello Alban.
Thx for reply.
ok, i have already read the data sheet.
 
So in my program, i just need to build some table with name are ATD1C; ATD1SC; ATD1PE; ATD1RH and ATD1RL (i want a 10 bit conversion)
 
And to read the result of a conversion, i just have to call ATD1RL and ATD1RH.
 
I don't thincks it is so easy...  
Could you explain me that? I think there are a physical adresse, no?
Thx for all
Iko.
0 项奖励
回复

759 次查看
Alban
Senior Contributor II
Iko,

These names should already declared in your header files with their matching physical address.

You need to launch a conversion
And when the conversion is complete you can read the content of result registers.

There are two ways, by polling or by interrupt.
By polling, after starting the conversion, you wait until the Conversion Complete bit gets set and then you can read.

By interrupt, you need to configure the interrupt. When the Conversion is Complete, the ATD interrupt will be executed. In the interrupt, you ackownledge the interrupt (clear flag) and read the content of the result register.

I don't know if you are a beginner or not, so please don't be offended.
What you can do to learn how it works:
- Create a new project using Project Wizard for MC9S08GT60.
- Then, use Processor Expert and the ATD bean.
- It will create all the module initialization code and interrupt for you.
- Analyze the code and copy what you need to your existing project.

Many members reporting doing this way to be sure not to forget anything when they start with a module.
That should help you.

Cheers,
Alban.
0 项奖励
回复

759 次查看
Ikoria
Contributor I
Hello Alban.
Yes i'm a newbie, but i have some knowledge...
 
Thx for your answer.
 
Processor expert is very simple. At the beginning, I thinck it is same as LabView...but i'm wrong...
 
PE is the greatest solution,  i have just to check "generate code"...so easy...
 
Thx for all.
Iko.
 


Message Edited by Ikoria on 2007-06-06 12:48 PM
0 项奖励
回复