work in progress hip9011 integration

It's all about the code!
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post by AndreyB »

Non-hip9011 implementation forked into https://rusefi.com/forum/viewtopic.php?f=5&t=1469
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
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post 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.
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
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Welcome to the friendlier side of internet crazy :)
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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.
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post by kb1gtt »

We tried many configurations, many were even scabbed on hacks that were never published. This has been a huge problem.
Welcome to the friendlier side of internet crazy :)
User avatar
andreika
donator
donator
Posts: 461
Joined: Mon Feb 13, 2017 2:35 pm
Location: Kiev

Re: hip9011 integration

Post 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
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Welcome to the friendlier side of internet crazy :)
User avatar
andreika
donator
donator
Posts: 461
Joined: Mon Feb 13, 2017 2:35 pm
Location: Kiev

Re: hip9011 integration

Post 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 17693 times
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Attachments
Frankenso_TPIC_close_up-gimp-exported.jpg
Frankenso_TPIC_close_up-gimp-exported.jpg (4.23 MiB) Viewed 17682 times
Welcome to the friendlier side of internet crazy :)
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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?
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Welcome to the friendlier side of internet crazy :)
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: hip9011 integration

Post 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.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Welcome to the friendlier side of internet crazy :)
User avatar
MHTSOS
Posts: 74
Joined: Sun Jun 02, 2019 6:46 pm
Github Username: MHTSOSVOODOO
Slack: Dimitri C

Re: hip9011 integration

Post 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.
User avatar
Fonzie
Posts: 13
Joined: Sun Jan 28, 2018 3:06 pm
Location: 39000 Lons-le-Saunier, France
Github Username: duparq
Contact:

Re: hip9011 integration

Post 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.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Attachments
TPIC_Clock_Circuit.PNG
TPIC_Clock_Circuit.PNG (14.58 KiB) Viewed 17572 times
Welcome to the friendlier side of internet crazy :)
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post 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 :(
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
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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.
Welcome to the friendlier side of internet crazy :)
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: hip9011 integration

Post 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.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: hip9011 integration

Post 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?
Welcome to the friendlier side of internet crazy :)
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: hip9011 integration

Post 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
User avatar
md_sanci
Posts: 69
Joined: Thu May 30, 2019 6:13 am
Location: Romania
Github Username: shadowm60
Slack: Alex M
Contact:

Re: hip9011 integration

Post 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.
Attachments
IMG_20190726_192803_3.jpg
IMG_20190726_192803_3.jpg (4.61 MiB) Viewed 17430 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: hip9011 integration

Post 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.
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