Hello,
We want to implement the sent protocol on an HCS08SG device.
(Sent is used in our case on Infineon TLE7998 Hall sensor)
I've connected the digital signal of the sensor to input capture of the processor.
Does it exist some librairies I couldbegin to work for this protocol ?
Best regards
francois
Hello,
I've checked a little more closer and found the following issue :
I think that if the line 0x8be8 (LDA 0x232 which has nothing to do here was replaced by CLRA, it would be OK.
Any help would be wellcome...
I'm a little afraid particulary with all the other pending designs I have with HCS08 and
we start to have serious doubts.
Case not OK
n = (long)(RamRO.Tle[1].TleValueAvg) * (Data.Tle[0].Range);
8bdd: CD9BD5 JSR 0x9BD5 _SEXT16_32 (0x9bd5)
8be0: C68017 LDA 0x8017
8be3: CE8016 LDX 0x8016
8be6: 87 PSHA
8be7: 89 PSHX
8be8: C60232 LDA 0x0232
8beb: 87 PSHA
8bec: 87 PSHA
8bed: 95 TSX
8bee: 89 PSHX
8bef: 8B PSHH
8bf0: AF04 AIX #4
8bf2: CD9B7F JSR 0x9B7F _LMUL (0x9b7f)
Case OK
n = (long)(RamRO.Tle[1].TleValueAvg) * Data.DummyUint;
8bdd: CD9BD0 JSR 0x9BD0 _SEXT16_32 (0x9bd0)
8be0: 328020 LDHX 0x8020
8be3: 4F CLRA
8be4: 89 PSHX
8be5: 8B PSHH
8be6: 87 PSHA
8be7: 87 PSHA
8be8: 95 TSX
8be9: 89 PSHX
8bea: 8B PSHH
8beb: AF04 AIX #4
8bed: CD9B7A JSR 0x9B7A _LMUL (0x9b7a)
typedef struct
{
/* DataFlash area */
/* Parameters for Tle */
StructDataTle Tle[2];
uint DummyUint;
}
StructData;
Hello,
My project works not no bad but I'm facing a strange problem.
I have a c calculation (it can be interrupted by timer interrupt which doent modify the registers of the calculation)
long n;
TleValueAvg is int
Range is uint
In this first case the calculation of n works fine
253 n = (long)(RamRO.Tle[1].TleValueAvg);//
8be3: 32026E LDHX 0x026E
8be6: 9F TXA
8be7: 8B PSHH
8be8: 88 PULX
8be9: 87 PSHA
8bea: CD9C46 JSR 0x9C46 _SEXT16_32 (0x9c46)
8bed: 95 TSX
8bee: AF06 AIX #6
8bf0: CD9C2C JSR 0x9C2C _POP32 (0x9c2c)
256 n = n * Data.Tle[0].Range;
8bf3: 328016 LDHX 0x8016
8bf6: 4F CLRA
8bf7: 89 PSHX
8bf8: 8B PSHH
8bf9: 87 PSHA
8bfa: 87 PSHA
8bfb: 95 TSX
8bfc: 89 PSHX
8bfd: 8B PSHH
8bfe: AF06 AIX #6
8c00: 89 PSHX
8c01: 8B PSHH
8c02: 9EFE03 LDHX 3,SP
8c05: CD9BEA JSR 0x9BEA _LMUL (0x9bea)
8c08: 95 TSX
8c09: AF0C AIX #12
8c0b: CD9C2C JSR 0x9C2C _POP32 (0x9c2c)
In this second case, the calculation of n return errors
n = f9f9f6a0 instead of fffff6a0
or n = fdfdfce0
My concern is that there is an access to 0x0230 which has nothing yo do with this calculation
I use very often this kind of code and I'm afraid of the errors it could create
Thanks very much for the help
francois
253 n = (long)(RamRO.Tle[1].TleValueAvg) * Data.Tle[0].Range;
8be3: 32026E LDHX 0x026E
8be6: 9F TXA
8be7: 8B PSHH
8be8: 88 PULX
8be9: 87 PSHA
8bea: CD9C37 JSR 0x9C37 _SEXT16_32 (0x9c37)
8bed: C68017 LDA 0x8017
8bf0: CE8016 LDX 0x8016
8bf3: 87 PSHA
8bf4: 89 PSHX
8bf5: C60230 LDA 0x0230
8bf8: 87 PSHA
8bf9: 87 PSHA
8bfa: 95 TSX
8bfb: 89 PSHX
8bfc: 8B PSHH
8bfd: AF04 AIX #4
8bff: CD9BDB JSR 0x9BDB _LMUL (0x9bdb)
8c02: AF07 AIX #7
8c04: CD9C1D JSR 0x9C1D _POP32 (0x9c1d)
Hello,
Thank for you idea of schematic, I'll think about that for a programmer of the TLE7998
(Actually,we use the Hitex one and this is a nightmare)
But the Infineon link above is only for programming the sensor once at production of the board
(amplification, offset, cutoff filter etc ...) This is done only once
After, when the sensor is running normally, the sent protocol is measurement of length of pulses
One 56 Unit Time pulse (~168 µs but not so accurate) then 8 pulses of 12 to 27 UT and I have to
calculate the length of these 8 pulses and then the Crc (which is very simple)
I my case (SG32 36 MHz, measurement and storage of pulses takes ~1 ms
decoding the length ~1 ms also. This could be ok but I think that with a 16 bits processor it could be improved
much more. I continue my investigations, but it runs not so bad ....
francois
Thanks for the response,
I've witten a driver on a TPM in input capture mode.
During 2 ms, I store all the interval between pulses with interrupt.
during 2 other ms I decode the length of the pulse based on the initial 56 UT pulse length
I've set the CPU at 36 MHz but it requires effectively a lot of calculation
What kind of CPU could be more suitable for this applicationwith same modules (SCI, COMP, clock etc ...) and same pinout ?
Actually, I use SG32 in TSSOP20 package.
Best regards
Hello, I read a little about the sensor. The clock is driven on the same line VDD, changing the voltage. Then it is a covert means SPI. You could make a driver leaving a port of any microcontroller. Using 2 pin. You can make a driver to control it. I imagine a transistor hung from the connector to 10V and its emitter fed from 5.6V with a diode which fall 0.6V and thus feed sensor handle and turn the clock.
Everything goes through the imagination. When I made the ISO14230 protocol, I used a QY4 @ 4MHz fbus.
You should read carefully and more than once the sensor data sheet.
Regards
Hello Francois,
the S08 core is running up to 20MHz Bus clock. The higher rate bus clock have the new MCUs of Kinetis family. The basic range is 50MHz -> exactly 48MHz -> Bus CLK = 24MHz. It comprises all standard peripherals and also DMA channels. The higher rate is 72MHz -> 36MHz Bus CLK, then 100MHz -> 50MHz Bus CLK or higher. All have basic or more power full peripherals always with DMA. The only one MCU in TSSOP20 package is LPC1111 or LPC1112, but not compatible with SG32 pinning.
I suggest you to use such new Kinetis device, either low power (L-family) with bus up to 24Mhz or higher K-family with bus up to 36MHz. It will be sufficient for SENT decode and manage other tasks also. Here are links:
Ultra-Low Power MCUs – Kinetis L Series|NXP
ARM Cortex-M4 Cores|Kinetis K MCUs|NXP
You can also use the AN4432 about SENT protocol:
I hope this help you. If you need next help, you are welcome.
Best Regards,
Stano.
Hello, you're going to have to read a little and make your own driver to access the sensor. With a timer or two, you can. I recommend you do it in assembler.
This is what I found ... By the way, I found the TLE7998, TLE4998 only.
The SENT protocol SAE J2716. Everything can be done with a micro depends on your imagination. I did the ISO 14230 protocol for accessing a vehicle ECU.
www.zmdi.com/sites/default/files/A_Tutorial_of_Digital_SENT_Interface.pdf
www.infineon.com/dgdl/TLE4998SP_Programming_Guide_Rev1.2.pdf?fileId=db3a30431ce5fb52011d29ca55c11bcd
Hello Francois,
I think there are no libraries for this protocol for S08 device. The MCU needs to have high computing power for the receive and decode the SENT message. It will need to process the interrupt service routine very frequently. It is recommended to use DMA module inside MCU (not S08) for the timer output data transfer to RAM. Please try use such newer MCU with DMA if possible for this application.
Best Regards,
Stano.