I hooked it up to 12V psu and connected my logic analyser to the comms pin.
I am showing two button press traces below, I could do with some help if possible. I have no clue how long the data string is, what are the start/stop bits, parity etc.. sorry if I use the wrong terminology.
My end goal is to replicate these signals with an Arduino/ESP8266.
You need to do a bit more work, first the chip has a number on it, look up that number and see what the does. It will tell you what the protocol is. Also it will give you the pin out and the transfer information. Next get the documentation on the protocol, it may be part of the specification. A UART is not a universal serial receiver for all serial signals. I google a lot and didn't find any exact explanation, that is expected. Your logic analyzer signals are good, I am only saying but it looks like the first byte is a header, the second is the key identifier in HEX, the third is probably a checksum. I would guess if you press the 2 button you will get a 32H in the second byte and the third byte will become 7DH. Get an ASCII to HEX chart, it should become obvious where I am coming from. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
Looking at the LA screen grabs and it looks like the first byte (0x4B) is a data start byte, the second byte is the key number (possible ASCII) and the third byte is the checksum (the first two bytes added together)
You seem to be getting framing errors on the second and third bytes so you might not have the UART decoder configured correctly.
@Riva thank you, from @gilshultz hint below I figured this out today after some reading.
ASCII for 0 is 30, 1 = 31 etc.. so the keypad numbers correspond to the hex>ascii code.
I mapped out all of the buttons from 30 to 3E.
I've had a read through a lot of it, a little over my head. I think a lot of it is how to program the 12bit instructions, whereas I'm really only interested in the 8bit data path (i think). Given the pcb layout below it seems to utilize port B (page 35).
The logic analyzer output is not that much clearer being honest.Taking the below example, the 'start' bits seems to occur when the bus is pulled low for one cycle. But I don't get why the stop bits are sometime high/low.
PS how do I embed a larger version of this screenshot?
So going forward I am a bit confused, whether I just go ahead and program the codes into a sketch and see how that looks....
Hardware related:
I traced the COMMS signal back to a MOSFET, it goes to the gate and also to pin RC6. One pin on the MOSFET goes to RC7, the other to ground. So I guess the signal is pulled low via this method.
As these keypads are designed to be in parallel with other keypads, I hope to be able to mimic this with an Arduino 5V output and another MOSFET. I will seek advice maybe in the electronics section for that..
Opps I should have read the reply from gilshultz before posting.
As I said in the other post you have framing errors so the usart decoding is not configured correctly or the pic is not using standard serial. Looking at the LA image I wonder if the serial is 9 bits instead of 8.
I'm not sure what else I can do from here, other than recreate these signal on my esp8266.
I'd like to understand more, but as I can't know the code programmed onto the PIC surely I am in the dark a little?
877:
I'm not sure what else I can do from here, other than recreate these signal on my esp8266.
I'd like to understand more, but as I can't know the code programmed onto the PIC surely I am in the dark a little?
Recreating the signal streams the pic is outputting when a button is pressed should be pretty simple but is made more difficult on the esp8266 as it's hardware UART does not support 9 bit serial data.
You could write code to bit bang a software serial or use the SPI hardware to TX the signal.
Tell us more about the project.
Are you trying to emulate the button board hardware?
What other things does this board do as it appears to have anti-tamper stuff.
Why are you wanting to use the esp8266, will other MCU's be suitable?
Riva:
Recreating the signal streams the pic is outputting when a button is pressed should be pretty simple but is made more difficult on the esp8266 as it's hardware UART does not support 9 bit serial data.
You could write code to bit bang a software serial or use the SPI hardware to TX the signal.
Tell us more about the project.
Are you trying to emulate the button board hardware?
What other things does this board do as it appears to have anti-tamper stuff.
Why are you wanting to use the esp8266, will other MCU's be suitable?
Hi Riva,
I have started on the code here, I think using the bit banging method. Basically converting the signal to digitalwrite's either high/low depending on the binary output. It working for one button press, but needs more work..
Yes, I am attempting to emulate the hardware, with a virtual keypad. So in effect the sketch will receive and input number 0 to 16, and would output the respective binary writes.
The tamper stuff is not important, it's more for the hardware I am replacing. I'm using esp8266 as I have plenty of them laying around being honest.