New Speedometer PWM #3

Open
opened 2026-01-22 09:58:35 -07:00 by RhysWinslett · 2 comments
Owner

We got the speedometer in at the end of last semester. We need to figure out how to properly interface with it. The product listing says it used PWM for communication, which should be reasonably easy to get working using the teensy-rs library.

For whoever takes this task, your goal is to find the proper PWM rate to move the speedometer in 1mph intervals

We got the speedometer in at the end of last semester. We need to figure out how to properly interface with it. The product listing says it used [PWM](https://en.wikipedia.org/wiki/Pulse-width_modulation) for communication, which should be reasonably easy to get working using the teensy-rs library. For whoever takes this task, your goal is to find the proper PWM rate to move the speedometer in 1mph intervals
Author
Owner

@IshaChaudhari I found a PWM example from the imxrt-hal git repo (same one used by the teensy-rs library), it should work exactly the same on our setup. I will also leave some other helpful links below. Hope this helps!

@IshaChaudhari I found a PWM example from the [imxrt-hal](https://github.com/imxrt-rs/imxrt-hal) git repo (same one used by the teensy-rs library), it should work exactly the same on our setup. I will also leave some other helpful links below. Hope this helps! - [PWM example](https://github.com/imxrt-rs/imxrt-hal/blob/main/examples/rtic_pwm.rs) - [Teensy PWM docs](https://www.pjrc.com/teensy/IMXRT1060RM_rev3_annotations.pdf#d17103e5a1310_d11e13090) (pg 3091-3135) - [Teensy PWM register info](https://www.pjrc.com/teensy/IMXRT1060RM_rev3_annotations.pdf#d17460e5a1310_d11e13467)
IshaChaudhari added spent time 2026-02-06 18:52:31 -07:00
1 hour
Author
Owner

@BryceReynolds I found all the interrupts listed in the ral. Because we're using sub-module 1_0 we should use the PWM1_0 interrupt. Also the logic for the frequency needs to be tweaked a bit but I think I've figured out how to do that.

The main problem we were having last time was the speedometer wasn't accepting current from the other side of the power supply. After doing some research I think I've concluded that its most likely 12v and it does need to share a ground. We will most likely need to setup some sort of transistor contraption to control the 12v lane. (we'll leave that to electrical to figure out). For the sake of testing we should try supplying it with 12v from the same channel to see if it will go to 100%.

@BryceReynolds I found all the interrupts listed in the [ral](https://docs.rs/imxrt-ral/0.5.4/imxrt_ral/type.interrupt.html#variant.PWM1_0). Because we're using sub-module ``1_0`` we should use the ``PWM1_0`` interrupt. Also the logic for the frequency needs to be tweaked a bit but I think I've figured out how to do that. The main problem we were having last time was the speedometer wasn't accepting current from the other side of the power supply. After doing some research I think I've concluded that its most likely 12v and it does need to share a ground. We will most likely need to setup some sort of transistor contraption to control the 12v lane. (we'll leave that to electrical to figure out). For the sake of testing we should try supplying it with 12v from the same channel to see if it will go to 100%.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Total time spent: 1 hour
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MST-Solar-Car-Team/Task-Tracking#3
No description provided.