Having a problem with s9s12g64 PAD8,9 digital inputs

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

Having a problem with s9s12g64 PAD8,9 digital inputs

1,494 次查看
tom_tom_tgreive
Contributor II

I have a design using the s9s12g64f0mlh.  My design has front panel encoders for user input.  They are simple mechanical encoders with 16 pulses/revolution.  I’ve attached the Phase-A, & Phase-B signals to PAD8 (pin #34), and PAD9(pin#36).  There is a pull-up, and series resistor with small cap to keep the switching noise in check.  I can’t seem to read the digital state of the pin at all.  Looking on both PT0AD (0x270), and PTI0AD (0x272) I get 1’s.  I can change the data direction and write a state high or low.  The pin drives correctly (as seen on a scope), and reports the correct status on both PT0AD (0x270), and PTI0AD (0x272).   Strangely the upper nibble bits (PAD12-15) work fine as outputs, or inputs.

I have these setup bytes:

DDR0AD = 0x40

PER0AD = 0x14

I have tried playing with ACMPC (0x0260), but it doesn’t seem to be the problem.

Has anyone else seen this happen?  I’ve been designing hc12’s and writing software for years, and I’ve not had a problem like this before.

标签 (1)
3 回复数

1,342 次查看
kef2
Senior Contributor V

Hi

Port AD pins have digital input buffers disabled by default. Look for ATDDIEN in datasheet.

Edward

1,342 次查看
tom_tom_tgreive
Contributor II

Edward,

Thank you for your reply.  Your answer helped quite a bit.  I still had to change ACMPC(0x0260) = 0x40 to enable inputs for PAD10, and PAD11.  It looks like all the digital inputs are working!

0 项奖励
回复

1,342 次查看
tom_tom_tgreive
Contributor II

correction:

ACMPC(0x0260) = 0x10

This will enable the inputs for PAD10, and PAD11

0 项奖励
回复