Pages

Sunday, January 13, 2013

MCP23008 IO Expander - Interrupt control



Posted by Picasa

This whole afternoon has been spend on troubleshooting the interrupting part of the keypad.

At first I used the interrupt signal generated from the keypad matrix, after 5V0/3V3 level shifting down by the 10K/20K voltage divider.  I fed the level shifted interrpt signal to GPIO Gen6 and found a problem.  The 10K/20K shifted down signal seems to crash with the 10K pull down shifting network entertained by the 2N7000 FET. 

Actually the 10K/20K signal has its won 10K pull up resistor at the keypad matrix side.  So I found it too complicated for me to do the calculation for the resulting voltage. 

Then I thought that I could used 2 HC04 inverters to buffer the keypad matrix interrupt signal, before dividing it down.  I also tried to setup Gen6 as input with and without pull up resistor.  I don't know what is the default pull up resistor value, but I did not remove the 10K from the 2N7000 level shifting circuit.

All the above brute force get arounds made a big mess, with the associated patching of the Python test functions, I began to forget which changes I made.

So I gave up working with GPIO Gen6, because I suspected that I might have already damaged the port by carelessly programmed it to be output etc.  I then tried RxD instead.  But I found that RxD seemed not able to read neither the interrupt signal from the MCP23008 side, or the shifted down keypad matrix side.

I though the problem might be the 2N7000 circuit that connects to both Gen6 and RxD.  So I tried to use the button pin Gen5.

This time the test program seems working smoothly.  My quck conclusion is that the Gen6, RxD pins are already connected to the 2N7000 level shifting network, extra fiddling might cause unexpected probems I have not found out yet.

So my decision is to forget using Gen6 and RxD from now on, and use Gen5 button ad Gen 4 buzzer for testing the keypad.

.END

No comments:

Post a Comment