porting problem from dp256 to xdt256! thanks for help!

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

porting problem from dp256 to xdt256! thanks for help!

ソリューションへジャンプ
1,741件の閲覧回数
jeffzxg
Contributor I

as we all know s12dp256 has two ATD modules --  ATD1 and ATD0, but in the mc9s12xdp512v2.pdf document, it says that 112-pin package has no ATD0 module, it only has one 16 channel ATD1 module, my problems is :

      my previous s12dp256 project code as follows:

void  InitialATD(void)
{
    ATD1CTL2 = 0xc0;       // power on atd module fast flag clear mode
    ATD1CTL3 = 0x00;       // single channel 8 results each sequence
    ATD1CTL4 = 0x80;       // 8bits 2sample clock atd module clock 2MHz

    ATD0CTL2 = 0xc0;       // power on atd module fast flag clear mode
    ATD0CTL3 = 0x00;       // single channel 8 results each sequence
    ATD0CTL4 = 0x80;       // 8bits 2sample clock atd module clock 2MHz
}

 

unsigned char GetPos(void)
{
    

   ATD0CTL5 = 0x81;      // AN1; unsigned; right aligned; single conversion; one channel
   
    __asm nop;
    __asm nop;
    while(ATD0STAT0_SCF == 0);
   
    return ATD0DR0L ;   

}

 

this code can run in s12xdt256 correctly, this mcu in 112 pin package has only one 16 channel ATD1 module, why the code can run correctly?

                                   thanks for help! 

ラベル(1)
0 件の賞賛
返信
1 解決策
839件の閲覧回数
kef
Specialist I

No, XDT256 has two ATD modules, 8 channels module ATD0 and 16 channels ATD1 module. 112pins package has bounded out all 8 ATD0 channels and first 8 ATD1 channels. Pin numeration is confusing. PAD00 to PAD07 are ATD0 pins, PAD08 to PAD15 are ATD1 pins. PAD09 to PAD23 are ATD1 pins, but these are not accessible on 112pin package.

 

It would be way less confusing if ATD1 had pins PAD10, PAD11, .. PAD1A ..PAD1F or something, clearly saying that specific pin belongs to ATD0 or to ATD1. Or PAD100 to PAD115 in case hex is taboo.

 

(I hope you aren't using very first maskset like M42E. On M42E there was single 16 channels ATD1 module with pins PAD00 to PAD15.)

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
840件の閲覧回数
kef
Specialist I

No, XDT256 has two ATD modules, 8 channels module ATD0 and 16 channels ATD1 module. 112pins package has bounded out all 8 ATD0 channels and first 8 ATD1 channels. Pin numeration is confusing. PAD00 to PAD07 are ATD0 pins, PAD08 to PAD15 are ATD1 pins. PAD09 to PAD23 are ATD1 pins, but these are not accessible on 112pin package.

 

It would be way less confusing if ATD1 had pins PAD10, PAD11, .. PAD1A ..PAD1F or something, clearly saying that specific pin belongs to ATD0 or to ATD1. Or PAD100 to PAD115 in case hex is taboo.

 

(I hope you aren't using very first maskset like M42E. On M42E there was single 16 channels ATD1 module with pins PAD00 to PAD15.)

0 件の賞賛
返信