VSS digital input

It's all about the code!
Post Reply
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

VSS digital input

Post by NickZ »

Setting a VSS pin, What does the input expect?
I have a square wave 5v VSS signal that works on the firmware I was using, But rusefi on the same hardware VSS does not work, Ive set a gauge to view the RAW data, but it doesn't trigger. I can tap the MCU pin direct with my multimeter probe and get raw data counting up.
It seems the MCU is setting a pulldown on the pin, it this expected and what do I need to feed the input to make it work?
User avatar
AndreyB
Site Admin
Posts: 14334
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: VSS digital input

Post by AndreyB »

VSS digital input expects a square wave.

VSS digital input hardware-in-the loop is covered by an automated test https://github.com/rusefi/rusefi/blob/a6dc34997e96710ba6b840550999b882b2e4d3be/java_console/autotest/src/main/java/com/rusefi/f4discovery/VssHardwareLoopTest.java#L16 please consider getting a discovery and reproducing that test manually.

Look at "Raw VSS" gauge to confirm that you are receiving events.

Random guess since you do not link tune and log: a possible issue could be EXTI line conflict (for instance PA4 used for trigger input and PC4 used for vss input, both on 4th EXTI line)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

Re: VSS digital input

Post by NickZ »

Ok seems to default to a pull down.
I have got it working by removing my voltage divider as the resistance of that can't overcome the trigger threshold.
with the 5v side the mcu pin only gets to 0.7v with the voltage divider inplace, Takes my 5v to 3.3v normally, But the pulldown is too much for the circuit.
Ive noticed under "fancy boards" pull ups can be switched for some items, Can this be done for the other digital inputs like the VSS setting?
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: VSS digital input

Post by mck1117 »

The stm32 internal pullup/pulldown should be on the order of 30-50k ohms. That's not your problem.
image.png
image.png (44.09 KiB) Viewed 25121 times
User avatar
AndreyB
Site Admin
Posts: 14334
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: VSS digital input

Post by AndreyB »

NickZ wrote:
Wed Aug 09, 2023 12:32 pm
Ive noticed under "fancy boards" pull ups can be switched for some items, Can this be done for the other digital inputs like the VSS setting?
Your board is not fancy in this regard, see 4chan schematics.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

Re: VSS digital input

Post by NickZ »

so the same pin on other firmware works fine on the hardware, functions perfect as a square wave 5v running through a voltage divider to 3.3v and is a floating pin. I get 3.3 volts at the processor with the pull up enabled.
But rusefi it doesn't work unless I bypass the voltage divider, but bypassing the voltage divider it works ok , with the voltage divider using rusefi I can only manage 0.7v with a 5v pull up with the rusefi.

maybe the voltage divider isn't enough current. im using 180k and 330k.

Im confused.

I was getting excited to be using rusefi, has made a performance difference on my test car.
I want to be able use the rusefi on the current board and was making progress, but this does kind of stop my progress.
User avatar
AndreyB
Site Admin
Posts: 14334
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: VSS digital input

Post by AndreyB »

NickZ wrote:
Fri Aug 11, 2023 2:31 am
im using 180k and 330k.
wow.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14334
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: VSS digital input

Post by AndreyB »

NickZ wrote:
Fri Aug 11, 2023 2:31 am
maybe the voltage divider isn't enough current. im using 180k and 330k.
Please elaborate why would you use those values for resistor divider?

I wonder if different firmwares use different PAL_STM32_OSPEED - GPIO in rusEFI uses PIN_OSPEED_HIGH
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: VSS digital input

Post by mck1117 »

AndreyB wrote:
Fri Aug 11, 2023 3:14 am
I wonder if different firmwares use different PAL_STM32_OSPEED - GPIO in rusEFI uses PIN_OSPEED_HIGH
the O in OSPEED means output, FYI, therefore is irrelevant
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

Re: VSS digital input

Post by NickZ »

The selection of the voltage divider is its output is 3.3v at 5.2v and ive carried over from when I was working with teensy 3.5, 0.1v over will kill a teensy as they are not 5v tolerant at all on any pins and I haven't really until now had a problem with those values.
Screen Shot 2023-08-12 at 1.50.57 am.png
Screen Shot 2023-08-12 at 1.50.57 am.png (79.22 KiB) Viewed 25025 times
So I'm now guessing from your reaction mck1117 it's more like it is a current problem and I should change to slightly lesser values.
User avatar
AndreyB
Site Admin
Posts: 14334
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: VSS digital input

Post by AndreyB »

My bad I should have been a bit more specific.

Please clarify why 180K and 330K specifically, not 18K and 33K? Not 180M and 330M? Not 180R and 330R?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

Re: VSS digital input

Post by NickZ »

current limitation, on 4 digital input circuits im not using a op amp, these have a 3.3v zener diode to protect them also for over voltage, putting 12v onto one of these pins the zener will protect it and as the current is weak on the other side of the divider the zener is able to sync the voltage without destroying itself and generally the MCU doesn't need a lot of the current to register a change of state if the pin is floating.
I has been something I had not thought about in the last 6 years of using the circuit on 1000s of boards.
I can say nobody has ever damaged one of the input pins feeding it 12v and a lot have done so over the years.

So dropping to 18k 33k it registers fine now, so for future I will change to these values.
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

Re: VSS digital input

Post by NickZ »

So after a change in the resistors, it is working.
Was hoping I could have used Rusefi as a alternative on my ecu's for what is already out there, but future ecu's will work perfect.
Today's goal was to get my CANBUS displays working on Rusefi.
Ill also add the CANBUS wideband to the car also.
NickZ
Posts: 56
Joined: Sun Sep 01, 2019 9:44 pm

Re: VSS digital input

Post by NickZ »

My next question is, Why do the range of usable pins change with updates.
Im using the discovery firmware, I was using PD15 as a injector the Comms LED I have set to PD12, But the latest firmware has taken away the Status LED selections and is also forcing Comms LED to PD15, even changing the INI file to put the Status LED options in and changing the Comms LED to PD12 it doesn't change it on the MCU.
I was offered a suggestion to use the build thing on the server for my custom board, But I have no idea how to use it in the slightest.
User avatar
AndreyB
Site Admin
Posts: 14334
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: VSS digital input

Post by AndreyB »

Not sure how to respond best, we are too far from VSS digital input here. See support and hardware articles on the wiki.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply