MC68HC908JB - Problems with Input and Output

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

MC68HC908JB - Problems with Input and Output

1,745件の閲覧回数
tiagodalmaso
Contributor I
Hi! I'm new at this forum and I hope I can get some help here.
I'm trying to use Port A for input and Output, configurable at realtime. It works if all the pins are outputs or inputs, but when I have both, the outputs don't work. I'm using the inputs as interrupts with KBI. The inputs work correctly but when I try to change an output pin it doesn't work.
Can anybody help me please?  thank you!
 
ラベル(1)
0 件の賞賛
返信
2 返答(返信)

616件の閲覧回数
donw
Contributor IV
I have not used the KBI module, but I think I read taht if a KBI interrupt was enabled on a Port A pin,
then it over-rides the output enable bit. So you will have to disable the KBI bit for the port pin before
making it an output pin.
Check the data sheet....
0 件の賞賛
返信

616件の閲覧回数
UK_CF_FAE
NXP Employee
NXP Employee
Hi,
 
Don is correct, the use of the KBI overrides the data direction register on the port.
You want to see the note at the end of chapter 14.5.
 
To use the part in the way that you describe means that you need to disable the KBI function on that pin with KBIEx = 0, then set the DDR for the pin to output PTADDx = 1.
 
Now the pin behaves as output.
 
To go back to KBI, remember so set the GPIO as an input (PTADDx = 0), and re-enable KBIEx = 1.
 
 
Mark
0 件の賞賛
返信