Nanocore12 MC9S12C32 AN0/PAD00-AN7/PAD07 pins as digital outs

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

Nanocore12 MC9S12C32 AN0/PAD00-AN7/PAD07 pins as digital outs

674 Views
ericdisrud
Contributor I

Hi,

 

 

I have a Nanocore12 MC9S12C32 microcontroller.  I'm trying to use the Port T (0-7) pins as digital outs, as well as the AN0/PAD00-AN7/PAD07 pins as digital outs at the same time.  I believe this is possible but I can't seem to discern from the documentation how to do this.  I have no issues with Port T but I'm getting nothing out of the AN/PAD pins.  Is there a register that sets those ports to digital outs?  I've tried setting DDRAD to #$FF and then PORTAD to #$FF but nothing seems to happen.  Please advise.  Apologies if this is an obvious or mundane question but I'm a bit stumped.  Any help would be appreciated.

 

 

Thanks,

 

 

Eric

Labels (1)
0 Kudos
4 Replies

520 Views
HSW
NXP Employee
NXP Employee

Hello Eric,

make sure to set the digital input enable registers in the ADC (ATDDIEN).

0 Kudos

520 Views
ericdisrud
Contributor I

I tried this after your suggestion but I'm still not getting any signal out of the N0/PAD00-AN7/PAD07 pins:

movb #$FF, ATDDIEN          ; enable digital input buffer to PTAD

movb #$FF, DDRAD             ; sets PORTAD data direction to output

movb #$FF, PORTAD          ; set PORTAD pins to high

any suggestions?

Thanks

0 Kudos

520 Views
ericdisrud
Contributor I

Actually, I got it to work by setting PTAD to #$FF.  Thanks for the help!  I do have another question though.  What is the difference between PORTAD and PTAD?  This might clear up future issues for me.

Thanks for the help!

0 Kudos

520 Views
HSW
NXP Employee
NXP Employee

Yes, PTAD is the correct I/O register to use. PORTAD is just an additional read-only register, that is part of the ATD.

0 Kudos