work in progress hip9011 integration

It's all about the code!
User avatar
russian
Site Admin
Posts: 9772
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: hip9011 integration

Post by russian » Sun Dec 30, 2018 12:14 am

Non-hip9011 implementation forked into viewtopic.php?f=5&t=1469
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Mon Jul 08, 2019 6:50 am

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
russian
Site Admin
Posts: 9772
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: hip9011 integration

Post by russian » 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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Mon Jul 08, 2019 9:58 am

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: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » 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.
Welcome to the friendlier side of internet crazy :)

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Wed Jul 10, 2019 8:44 am

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.

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Wed Jul 10, 2019 8:52 am

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: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Wed Jul 10, 2019 10:33 am

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: 419
Joined: Mon Feb 13, 2017 2:35 pm
Location: Kiev

Re: hip9011 integration

Post by andreika » Wed Jul 10, 2019 4:19 pm

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: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Thu Jul 11, 2019 2:12 am

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: 419
Joined: Mon Feb 13, 2017 2:35 pm
Location: Kiev

Re: hip9011 integration

Post by andreika » Thu Jul 11, 2019 4:37 am

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 805 times

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Thu Jul 11, 2019 8:02 am

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 794 times
Welcome to the friendlier side of internet crazy :)

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Fri Jul 12, 2019 12:42 pm

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: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Fri Jul 12, 2019 6:18 pm

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: 248
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by mck1117 » Thu Jul 18, 2019 10:13 pm

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: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Thu Jul 18, 2019 11:03 pm

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: 9
Joined: Sun Jun 02, 2019 6:46 pm
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by MHTSOS » Fri Jul 19, 2019 6:54 am

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: 8
Joined: Sun Jan 28, 2018 3:06 pm
Location: France (Jura)
Soldering skill: yes
Coding skill?: yes
Contact:

Re: hip9011 integration

Post by Fonzie » Fri Jul 19, 2019 9:14 am

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: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » 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.
Attachments
TPIC_Clock_Circuit.PNG
TPIC_Clock_Circuit.PNG (14.58 KiB) Viewed 684 times
Welcome to the friendlier side of internet crazy :)

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Thu Jul 25, 2019 3:23 pm

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
russian
Site Admin
Posts: 9772
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: hip9011 integration

Post by russian » Thu Jul 25, 2019 3:39 pm

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 :(
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Thu Jul 25, 2019 5:28 pm

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
donator
donator
Posts: 160
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb

Re: hip9011 integration

Post by Dron_Gus » Fri Jul 26, 2019 10:32 am

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 fome $$ and clock 9011 from clock out of STM32.

User avatar
kb1gtt
contributor
contributor
Posts: 3489
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

Re: hip9011 integration

Post by kb1gtt » Fri Jul 26, 2019 4:50 pm

-- 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
donator
donator
Posts: 160
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb

Re: hip9011 integration

Post by Dron_Gus » Fri Jul 26, 2019 9:37 pm

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/m ... conf.h#L96
and correct Alternative Function for pin:
https://github.com/rusefi/rusefi/blob/m ... ard.h#L126
https://github.com/rusefi/rusefi/blob/m ... ard.h#L193

md_sanci
Posts: 33
Joined: Thu May 30, 2019 6:13 am
Soldering skill: yes
Coding skill?: yes

Re: hip9011 integration

Post by md_sanci » Fri Jul 26, 2019 11:11 pm

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 542 times

Post Reply