Having a problem with s9s12g64 PAD8,9 digital inputs

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

Having a problem with s9s12g64 PAD8,9 digital inputs

758件の閲覧回数
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 返答(返信)

606件の閲覧回数
kef2
Senior Contributor IV

Hi

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

Edward

606件の閲覧回数
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 件の賞賛

606件の閲覧回数
tom_tom_tgreive
Contributor II

correction:

ACMPC(0x0260) = 0x10

This will enable the inputs for PAD10, and PAD11

0 件の賞賛