MC68HC908JB - Problems with Input and Output

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC68HC908JB - Problems with Input and Output

1,355 Views
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!
 
Labels (1)
0 Kudos
2 Replies

226 Views
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 Kudos

226 Views
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 Kudos