Alex Harvey

S12XDP512 & PAD08 - PAD16 as Digital Inputes

Discussion created by Alex Harvey on Dec 7, 2006
Latest reply on Dec 14, 2006 by kef
The S12X has two ATD subsystems, PAD00 to PAD07 are on one. Which I had no problem getting the digital mode to work. On PAD08 to PAD16 which sit on the second ATD subsystem repeating the same steps, does nothing, aka data returns FF no matter what.

Steps to use ATD as digital inputs

1)Set the appropriate ATDDIEN to FF, ATD0DIEN0 at 2CD for ATD0, and ATD1DIEN at 0x008D (I have a feeling this is a mistake in there document, it should be ATD1DIEN1) for ATD1

2)Then check the corresponding DDR (not needed, since they should default to 00)

3)Then read value, ATD0PTAD0 at 0X02CF and ATD1PATD1 at 0x008F.

I have a feeling, I'm doing something backwards on the second ATD like it should be ATD0DIEN0 instead of DIEN1, the Appendix G, say otherwise. Again, ATD0 is working fine. ATD1 is not. Mask 0L15Y, 112pin chip.

Thanks in advance.

Alex

Outcomes