MC68HC908JB - Problems with Input and Output

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

MC68HC908JB - Problems with Input and Output

1,749 次查看
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 回复数

620 次查看
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 项奖励
回复

620 次查看
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 项奖励
回复