vsdip / vsdsquadron_pio

Apache License 2.0
4 stars 2 forks source link

providing external clock in the mini board #13

Closed SiddharthVikram068 closed 3 months ago

SiddharthVikram068 commented 3 months ago

this issue addresses the concern on how to use an external clock in the vsd squadron mini board.

yathAg commented 3 months ago

What is the application that you would be using and frequency that you are targeting?

SiddharthVikram068 commented 3 months ago

What is the application that you would be using and frequency that you are targeting?

our application is a fire alarm based on a gas sensor and a buzzer, we wanna introduce clock glitches using an external clock and perform data corruption and instruction skips. We are okay with any frequency that the vsd can operate upon, the lower the better. We are using an esp32 to provide the external clock

yathAg commented 3 months ago

Just from a brief look at the data sheet, refer to the clock tree and section 10.4.1(boot and clock) you will have to provide a variable clock on the oscillator pins.

You can read up about VCXO's, i will read up more and share details soon

So an approach would be to remove the crystal on pin PA1 and PA2 and connect your own circuit there.

SiddharthVikram068 commented 3 months ago

it will be a very risky approach if we try to remove the in built crystal oscillator to use our own circuit, since we might need the crystal oscillator again for some other applications.

The reference manual does offer some insight into using an external clock for TIM1 interface. If you can share any details on how to configure the code to allow an external clock would be very helpful, thank you

yathAg commented 3 months ago

Removing Y1 ( it's pretty easy with a hot air gun) is the only solution that comes to mind.

Once you successfully remove that, then you can connect the ESP or any other clock source to PA1.

Screenshot_20240610_191815_GitHub.jpg

Whenever you don't want to use that, use the internal oscillator HSI.

There are specific bits you can use to switch as described in the screenshot from the reference manual.

You cannot run the board from a timer. The timer is generated using the internal clock HSI or external clock HSE (Connected to PA1)