Page 4 of 4

Re: hip9011 integration

Posted: Sun Dec 30, 2018 12:14 am
by AndreyB
Non-hip9011 implementation forked into https://rusefi.com/forum/viewtopic.php?f=5&t=1469

Re: hip9011 integration

Posted: Mon Jul 08, 2019 6:50 am
by md_sanci
Hello all,

I have made today a new addon pcb for Frankestein with HIP9011. I made the circuit as on frankenso.

From console i have the following output:
2019-07-08 09_41: EngineState: confirmation_hipinfo:7
2019-07-08 09_41: EngineState: spi 1=No/2=Yes/3=Yes
2019-07-08 09_41: EngineState: enabled=Yes state=READY_TO_INTEGRATE bore=76.50mm freq=7.48kHz PaSDO=6
2019-07-08 09_41: EngineState: band_index=42 gain 1.00/index=-1 output=PC0
2019-07-08 09_41: EngineState: integrator index=-1 knockVThreshold=4.00 knockCount=0 maxKnockSubDeg=20.00
2019-07-08 09_41: EngineState: spi=SPI_DEVICE_2 IntHold@PB11/2 response count=2 incorrect response=1 NOT GOOD
2019-07-08 09_41: EngineState: CS@PB0 updateCount=0
2019-07-08 09_41: EngineState: hip 0.00v/last=1.03@PC0/max=0.00 adv=0
2019-07-08 09_41: EngineState: mosi=PB15
2019-07-08 09_41: EngineState: miso=PB14
2019-07-08 09_41: EngineState: sck=PB13
2019-07-08 09_41: EngineState: start 35.00 end 135.00
2019-07-08 09_41: EngineState: knock now=No/ever=No
2019-07-08 09_42: EngineState: WARNING: unrealistic IAT -273.14
2019-07-08 09_42: EngineState: WARNING: unrealistic IAT -273.14


Is it normal that it will not respond for the first request? i even placed the capacitorbetween CS and XTAL, it is stated DNP put for a quick test i paced a 24pF one

Re: hip9011 integration

Posted: Mon Jul 08, 2019 7:21 am
by AndreyB
md_sanci wrote:
Mon Jul 08, 2019 6:50 am
NOT GOOD
Not good is well... Not good. Also not normal. Also bad. Also a very bad sign.

If you go over this thread you will see multiple level of hell we had with this chip, it could be your turn to take the lead :)

Do you have a log analyzer? Do you have an oscilloscope? Both would be nice to hook up here - looking at analog output signal gives you a clear idea if hip9011 has started or not.

Re: hip9011 integration

Posted: Mon Jul 08, 2019 9:58 am
by md_sanci
russian wrote:
Mon Jul 08, 2019 7:21 am
md_sanci wrote:
Mon Jul 08, 2019 6:50 am
NOT GOOD
Not good is well... Not good. Also not normal. Also bad. Also a very bad sign.

If you go over this thread you will see multiple level of hell we had with this chip, it could be your turn to take the lead :)

Do you have a log analyzer? Do you have an oscilloscope? Both would be nice to hook up here - looking at analog output signal gives you a clear idea if hip9011 has started or not.
So what i did, rusefi console, execute a reboot, and then i have 3 out of 3.
Basically, if i have stable 5v and time for the ic to start, it looks like it is working, if i can go with this forward tunning the car, i will come back later to this topic, to see if it is an issue of XTAL or we should allow the ic a bit more time to start. Maybe a mechanism to restart if it is not responding... i promise i will look into this :) For now i have to get a logical analyzer since my usb oscope is way to slow

Re: hip9011 integration

Posted: Mon Jul 08, 2019 5:06 pm
by kb1gtt
TPIC or HIP chip?

We had many issues getting the XTAL to start clicking away. I believe the chip we happened to use desires a driven signal from an MCU, instead of an XTAL. Once the XTAL starts, often by simply touching it, then it was working OK, but it was difficult to get it to start clocking away.

Re: hip9011 integration

Posted: Wed Jul 10, 2019 8:44 am
by md_sanci
kb1gtt wrote:
Mon Jul 08, 2019 5:06 pm
TPIC or HIP chip?

We had many issues getting the XTAL to start clicking away. I believe the chip we happened to use desires a driven signal from an MCU, instead of an XTAL. Once the XTAL starts, often by simply touching it, then it was working OK, but it was difficult to get it to start clocking away.
So i have tried last night a simple thing and went wrooooong
First spi command if no reply, then repeat it. after 2 attempt, the response from the HIP was ok, but the chip did not functioned, i had a lot of errors. So i would say i have the XTAL issue as well, what i missed to place on the PCB is the 2M resistor that is in the schematic, maybe that would help?

So i will go like before, start up the ECU, then execute a reboot command. It looks ok after that, it is working correctly.

Re: hip9011 integration

Posted: Wed Jul 10, 2019 8:52 am
by md_sanci
kb1gtt wrote:
Mon Jul 08, 2019 5:06 pm
TPIC or HIP chip?

We had many issues getting the XTAL to start clicking away. I believe the chip we happened to use desires a driven signal from an MCU, instead of an XTAL. Once the XTAL starts, often by simply touching it, then it was working OK, but it was difficult to get it to start clocking away.
I have built the circuit as in the frankenso schematic, did somebody tried the schematic from the datasheet?
- 4Mhz XTAL
- 2x 20pF
- 1M resistor?
Is it more stable like this? i plan to try it today.

Re: hip9011 integration

Posted: Wed Jul 10, 2019 10:33 am
by kb1gtt
We tried many configurations, many were even scabbed on hacks that were never published. This has been a huge problem.

Re: hip9011 integration

Posted: Wed Jul 10, 2019 4:19 pm
by andreika
md_sanci wrote:
Mon Jul 08, 2019 6:50 am
Is it normal that it will not respond for the first request?
Here's the "normal" behavior of HIP9011 on Prometheus board (no XTAL issues whatsoever):

Code: Select all

enabled=Yes state=1 bore=87.50mm freq=6.54kHz PaSDO=6
band_index=39 gain 1.00/index=-1 output=PC0
integrator index=-1 knockVThreshold=4.00 knockCount=0 maxKnockSubDeg=20.00
spi=SPI_DEVICE_3 IntHold@PC14/2 response count=3 incorrect response=0 ok
CS@PD1 updateCount=0
hip 0.00v/last=2.26@PC0/max=0.00 adv=0

Re: hip9011 integration

Posted: Thu Jul 11, 2019 2:12 am
by kb1gtt
I believe our issue is with the TPIC8101, which is based on the HIP9011. I suspect the TPIC removed or changed some things, which is causing it to fail to start.

My theory on this is all chicken bones and voodoo. No real evidence, just gut feel.

Re: hip9011 integration

Posted: Thu Jul 11, 2019 4:37 am
by andreika
kb1gtt wrote:
Thu Jul 11, 2019 2:12 am
I believe our issue is with the TPIC8101
Oh, that's unfortunate, as there's actually TPIC8101 on Prometheus:
tpic8101.JPG
tpic8101.JPG (36.56 KiB) Viewed 17964 times

Re: hip9011 integration

Posted: Thu Jul 11, 2019 8:02 am
by kb1gtt
The Frankenso is also the TPIC8101DW G4. We have about a 20% failure to start rate. Some of the crystals will start, others will not. Typically we can make it start by a very light touch. AKA that's enough of an upset to get the crystal oscillating.

Re: hip9011 integration

Posted: Fri Jul 12, 2019 12:42 pm
by md_sanci
I do not have hw knowladge, but i see the reference schematic from hip is using 4Mhz quartz and 20 pF capacitors, this is used in phrometeus as well only with 8Mhz if i remember correctly. In Frankenso it has a resistor in series with XTAL and different capacitor values?

Would this be the case why it has trouble starting? to low voltage to excite the Quartz?

Re: hip9011 integration

Posted: Fri Jul 12, 2019 6:18 pm
by kb1gtt
Part of our headaches did include trying 4MHz and 20pF caps. If we could find the HIP chip, I suspect we would find no problems. The TPIC specifically shows this driven by an MCU not an XTAL. So far I think the best hack was to add a coupling cap to a near by trace. This seemed to smack it sum and get it started. However it's a really crazy garbage way to make it comply.

Re: hip9011 integration

Posted: Thu Jul 18, 2019 10:13 pm
by mck1117
Why not just drive it from the MCU? The STM32 has one or two MCO (master clock out) pin(s) that output a clock divided off of the core clock, which would work great for this application.

Re: hip9011 integration

Posted: Thu Jul 18, 2019 11:03 pm
by kb1gtt
Which discovery pin should be connected? Can we try it by scabbing a wire in there? Once we see it work with a wire, then I could run a trace.

Re: hip9011 integration

Posted: Fri Jul 19, 2019 6:54 am
by MHTSOS
I looked around for other implementations of the HIP9011/TPIC8101 ICs and from what I can see no one is using a crystal for clock. They all seem to use external clock from the CPU. Both chips are clones of each other and they both support xtal, ceramic resonators and external clocks as their clock input according to their datasheets. Maybe there is a flaw with the design of the xtal driver in the chip but no one cared to redesign because everyone is using external clock or maybe these ICs are particularly picky about the xtal used. An 8MHz xtal from one manufacturer doesn't have the same characteristics with one from another manufacturer. I don't know if the discovery board can output a clock signal but if it can it will solve this problem once and for all and it's worth a shot.

Re: hip9011 integration

Posted: Fri Jul 19, 2019 9:14 am
by Fonzie
According to the STM32F411xC/E datasheets (RM0383, DM00115249), PA8 can be configured as alternate function MCO_1 (Microcontroller Clock Output) and PC9 can be configured as alternate function MCO_2.
* MCO_1 can be generated from HSI, LSE, HSE, PLL through a 1 to 5 prescaler;
* MCO_2 can be generated from HSE, PLL, SYSCLK, PLLI2S through a 1 to 5 prescaler.

Re: hip9011 integration

Posted: Mon Jul 22, 2019 9:29 am
by kb1gtt
Can someone scab in a wire from one of these STM pins, then setup the circuit as noted below. You should have some pads at the XTAL circuit, you would just need to add a wire to get the STM signal over to the clock area.

Re: hip9011 integration

Posted: Thu Jul 25, 2019 3:23 pm
by md_sanci
kb1gtt wrote:
Mon Jul 22, 2019 9:29 am
Can someone scab in a wire from one of these STM pins, then setup the circuit as noted below. You should have some pads at the XTAL circuit, you would just need to add a wire to get the STM signal over to the clock area.
Can you point out to what pin should i connect? i can rewire it tomorrow, but it would be faster if the code is modified and i just flash a nightbuild.

Re: hip9011 integration

Posted: Thu Jul 25, 2019 3:39 pm
by AndreyB
i have no idea what would need to be modified in the code for this. this is low priority for me unfortunatelly, i would be happy to meege your high quality pull requests if any but thats all i can help with here :(

Re: hip9011 integration

Posted: Thu Jul 25, 2019 5:28 pm
by kb1gtt
Per the above post from @Fonzie, PA8 or PC9. I think the firmware could be a fairly minimal change. I'm not sure who could make the change. I'd bet ChibiOS has a function or similar which would set this, but I do not know exactly what.

Re: hip9011 integration

Posted: Fri Jul 26, 2019 10:32 am
by Dron_Gus
kb1gtt wrote:
Mon Jul 22, 2019 9:29 am
Can someone scab in a wire from one of these STM pins, then setup the circuit as noted below. You should have some pads at the XTAL circuit, you would just need to add a wire to get the STM signal over to the clock area.
On my version of ECU 9011 is clocked from STM32 this way. But I did not try 9011 yet.

Decided to save some $$ and clock 9011 from clock out of STM32.

Re: hip9011 integration

Posted: Fri Jul 26, 2019 4:50 pm
by kb1gtt
-- Did your version follow the above posted schematic?
-- How did you wire the clock signal?
-- Did it work?
-- Most important, how did the software get changed to generate the clock signal?

Re: hip9011 integration

Posted: Fri Jul 26, 2019 9:37 pm
by Dron_Gus
kb1gtt wrote:
Fri Jul 26, 2019 4:50 pm
-- Did your version follow the above posted schematic?
Yes.
kb1gtt wrote:
Fri Jul 26, 2019 4:50 pm
-- How did you wire the clock signal?
PA8 to input of posted schematic. PA8 has alternative function MCO1. On STM32F7 4 different internal clocks can be routed to MCO1. With dividers from 1/1 to 1/5.
kb1gtt wrote:
Fri Jul 26, 2019 4:50 pm
-- Did it work?
I did not try access 9011 over SPI yet. But I checked clock signal with oscilloscope.
kb1gtt wrote:
Fri Jul 26, 2019 4:50 pm
-- Most important, how did the software get changed to generate the clock signal?
Set proper clock source and divider:
https://github.com/rusefi/rusefi/blob/master/firmware/config/stm32f4ems/mcuconf.h#L96
and correct Alternative Function for pin:
https://github.com/rusefi/rusefi/blob/master/firmware/config/boards/subaru-ej20gn/board.h#L126
https://github.com/rusefi/rusefi/blob/master/firmware/config/boards/subaru-ej20gn/board.h#L193

Re: hip9011 integration

Posted: Fri Jul 26, 2019 11:11 pm
by md_sanci
Hello all, i did tried it and for some reason it is not working. Keep in mind i have a proto pcb on top of stm32 discovery, i will do more checking but the mco1 signal looks ok on my cheap oscope.

Will look into it more next days.

Re: hip9011 integration

Posted: Mon Apr 13, 2020 4:58 am
by AndreyB
As of April 2020 we have no idea if that's real knock data we got from HIP9011 or weather on Mars. As of April 2020 a convincing experiment was not yet performed.