mstegen / Open-Chargeport

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

Is Hex file available for Si4010 version (with 315MHz frequency support)? #9

Open mgsanava opened 1 week ago

mgsanava commented 1 week ago

Hi @mstegen

I was able to compile the code available in your repo but not sure if it is working or not because I was not able to identify any output signal after flashing the code (tried on both RAM and OTP memories). I am checking in an oscilloscope, and I don't have the facilities to test with an actual car because I'm in a different country.

I could see here that frequency you assigned is 433MHz for EU region. For which value assigned was 433920000. Is there any specific reason why it is not 433000000? Can I just use 315000000 for 315MHz?

My schematic and board are completely identical to the one in the repo. Is it enough to just modify the fOperatingFrequency to 315MHz and flash? Or do I need to comment out any lines in the code?

Schematic: sch PCB attachments in the next post.

Your help is highly appreciated. Thanks!

mgsanava commented 1 week ago

PCB:

image image image

mstegen commented 1 week ago

The reason for the 433,920 Mhz frequency is because that exact frequency is used on all transmitters in the EU, it's free to use. In the USA it's 315 Mhz, not sure about the exact frequency. I once sent a OpenChargeport key fob to the USA to test, and it worked fine, even with the default antenna design.

You can test your transmitter by using a 315Mhz receiver module connected to your oscilloscope.

mgsanava commented 1 week ago

Thanks @mstegen My receiver is: XY-MK-5V (315MHz) version for testing where I probe DATA pin for signal capture. image

I am not sure if DATA pin signal frequency is downscaled or not because I have an oscilloscope of 100MHz and 1Gs read specification. As far as I know, frequencies higher than 100MHz bandwidth will not be captured by scope correctly. I did not find further information about this DATA pin, but I see people using Arduinos to interpret the signal on DATA pin using serial monitor.

Is there a better way to interpret the receiving signal?

Also, I noticed in the code GPIO_LED and C2CLK are the same pins. Will it not cause debugging issues? Because I face "target not responding or failed to respond" when I put breakpoints randomly.

mstegen commented 1 week ago

If you follow the original thread on teslamotorclubforum you can see what you should expect to see on your scope screen. The bandwidth of your scope is fine. As this project was done a long time ago i don't remember any more details, sorry.

mgsanava commented 5 days ago

It's ok, thanks. One last question - if I want to try this out in another microcontroller, I just need to relay the exact 42-byte data sequence in the vPacketAssemble() function, right?

mstegen commented 5 days ago

No, that depends on how the data is transmitted, as you can see in the pic code here: https://github.com/mstegen/Open-Chargeport/blob/master/sourcecode/OpenChargeport.asm#L203