mstegen / Open-Chargeport

Opens the chargeport of a Tesla Model S
76 stars 21 forks source link

Is code change required if we use Si4010 10-pin variant? #7

Closed mgsanava closed 12 months ago

mgsanava commented 1 year ago

This is not an issue maybe. I replicated the Si4010 based circuit and dumped the hex code into IC. I'm using 10-pin variant of Si4010.

(Download sample codes from Si4010 page -> duplicated keyfob_demo_2 project -> deleted the actual usr_src files -> added your source files -> compiled successfully -> hex generated -> downloaded hex successfully using Silabs IDE)

Now when I press the switch, I couldn't see any signal on the TXM TPM pins. Attached schematic also.

Do I need to change something in code? All I could see was TXM TPM pin numbers were changed.

I posted this on Tesla club also but was approved yet and this is urgent. Hence posting here again. Any help is appreciated. Thanks.

image

mstegen commented 1 year ago

I don't think the variant of the IC matters. But please check the sourcecode, if you want to test the code, you can run the program from RAM, to do so you will have to comment out some lines. The chips can be flashed only once, so if you flashed your IC, you will have to unsolder it, and solder in a new one.

Looking at your schematic, C2 should not be 100nf, in my schematic it's unused., as this is the output of the transmitter, the 100nf capacitor will absorb the RF signal.

mgsanava commented 1 year ago

Thank you for the reply.

The chips can be flashed only once

I got lost there. I burned the chip 3 times already but it never said download failed. Every time code was downloaded successfully which I could see in IDE log window. Definitely something is wrong? I will change the chip anyway.

I checked the source code but I do not see anything related to RAM. I will dig deeper and it would be great if you can provide any leads on this topic.

I removed the C2 as suggested.

mgsanava commented 12 months ago

@mstegen Can you please comment?

mstegen commented 12 months ago

It has been 10 years ago since i last looked at the code, i don't have the IDE installed anymore on my PC, but i remembered that you could run the software from RAM, and not program it to flash.

Please search the documentation for this. Also this is the line that you need to comment out if you want to debug it:

https://github.com/mstegen/Open-Chargeport/blob/331fc6fb402cc5cf49b122092cd722234c0e0293/Si4010/source/keyfob_demo_main.c#L140

mgsanava commented 12 months ago

I'll look into documentation further. Thanks for the help!

mgsanava commented 12 months ago

This is just a note about Si4010 Flashing for future readers including myself:

Courtesy: Silabs Community Si4010 stores the user code in OTP memory (called NVM in documentation). Programming NVM requires 6.5V programming voltage and Silabs NVM programming utility SW, cannot be done from IDE. During boot, user code is loaded from NVM to RAM, and runs from RAM.

IDE loads the code directly to RAM for debugging, that's why you can do it multiple times.

RAM content is lost in shutdown state.

No code change needed for 10-pin variant, if you do not use the nonexistent GPIOs.

See further details in Si4010 datasheet and AN370: Si4010 Software Programming Guide

mgsanava commented 11 months ago

Hi @mstegen just wanted a help from you. do you still have the waveforms data on how they look on an oscilloscope? i tried the setup and ended up with some signal but i'm quite sure they are not correct. image

mstegen commented 11 months ago

No i do not have the waveform, but you can record it yourself with a 433 mhz receiver, and a tesla wall connector plug. Please note that in the USA, the frequency is not 433 Mhz but 315Mhz if i remember correctly. That might be the reason it does not work for you. You can set the TX frequency in the sourcecode. The antenna is not tuned for 433 Mhz, but it should still work on 315Mhz. (i verified that at the time)