ATD problem in S12XDP512

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ATD problem in S12XDP512

1,566件の閲覧回数
FATTY
Contributor I

Hello,

 

Currently I'm using a start kit from softec to implement a base environment for motor control, but I encountered some problem when I deal with ATD module. follow is my initial code for ATD module:

 

ATD1CTL3 = 0x38;
ATD1CTL4 = 0x80;
ATD1CTL0 = 0x05;
ATD1CTL2 = 0x80;
ATD1CTL5 = 0x32;

 

but in this code, I can't get any data from AD0~AD7, I can only get data from AD8~AD15.

the relation is as follow:

 

data--->PAD08--->ATD1DR0

data--->PAD09--->ATD1DR1

 

but data--->PAD00---> can't found in any register....

 

So it's really bother me a lot. Could somebody also have encountered this problem before? could you give me some hint about this? Thanks a lot in advance.

 

Fatty

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

763件の閲覧回数
wolbar
Contributor I
I'd love to answer your question however if you can't take the time to comment yuour code...
0 件の賞賛
返信

763件の閲覧回数
kef
Specialist I

PAD00 belongs to ATD0...

 

PAD00..PAD07 - 8 channels of ATD0

PAD08..PAD23 - 16 channels of ATD1

 

Pin numbering is little odd.

 

 

 

BTW

 

PT1AD0 stands for port1 of ATD0. And there's no PT0AD0.

 

PT0AD1 - port0 of ATD1 (PAD16..PAD23 pins)

PT1AD1 - port1 of ATD1 (PAD08..PAD15)

 

 

Hope it answer your questions.

0 件の賞賛
返信