infineon4engi@twitter infineon4engineers infineon@linkedin infineon@youtube
twitter Facebook Linkedin Youtube

+ Reply to Thread
Results 1 to 7 of 7

Thread: ISO1H816G SPI communication problem (important)

  1. #1
    Beginner Beginner aliyolcu28 is on a distinguished road
    Join Date
    Dec 2019
    Posts
    6
    Points
    57.5

    ISO1H816G SPI communication problem (important)

    Hi,

    I have a ISO1H816G entegre.
    I could not communicate with this device in any way.
    I use the Tiva TM4C1231D6PZ as a microcontroller.
    When I listen to the CS, CLK and SI pins on the oscilloscope, Looks like the following

    Entegre :
    https://www.infineon.com/dgdl/Infine...20f700bb736a89

    CS + CLK
    Click image for larger version

Name:	cs_clk.PNG
Views:	0
Size:	125.0 KB
ID:	4380
    Click image for larger version

Name:	cs_clk2.PNG
Views:	0
Size:	116.2 KB
ID:	4381

    CS + SI
    Click image for larger version

Name:	cs_si.PNG
Views:	0
Size:	82.0 KB
ID:	4382

    CODE
    Code:
    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_memmap.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/ssi.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    
    #define NUM_SSI_DATA            1
    
    
    uint32_t pui32DataTx[NUM_SSI_DATA];
    uint32_t pui32DataRx[NUM_SSI_DATA];
    uint32_t ui32Index;
    
    unsigned set_bit(unsigned x, unsigned offset, bool value)
    {
        //dizi[5] = set_bit(dizi[5], 3, 1);
    
        return (value)
            ? x | (1 << offset)
            : x & ~(1 << offset);
    }
    
    int main(void){
    
        SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
                         SYSCTL_XTAL_16MHZ);
    
    
    
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
        GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,GPIO_PIN_3);
        GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_3 , GPIO_STRENGTH_12MA,
                         GPIO_PIN_TYPE_STD);
        GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_3 , GPIO_PIN_3);
    
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
        GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE,GPIO_PIN_5);
        GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_5 , GPIO_STRENGTH_12MA,
                         GPIO_PIN_TYPE_STD);
        GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_5 , GPIO_PIN_5);
    
    
        SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
    
        GPIOPinConfigure(GPIO_PH4_SSI2CLK);
        //GPIOPinConfigure(GPIO_PH5_SSI2FSS);
        GPIOPinConfigure(GPIO_PH6_SSI2RX);
        GPIOPinConfigure(GPIO_PH7_SSI2TX);
    
        // Configure the GPIO settings for the SSI pins.  This function also gives
        // control of these pins to the SSI hardware.  Consult the data sheet to
        // see which functions are allocated per pin.
        // The pins are assigned as follows:
        //      PH7 - SSI2Tx
        //      PH6 - SSI2Rx
        //      PH5 - SSI2Fss
        //      PH4 - SSI2CLK
    
        GPIOPinTypeSSI(GPIO_PORTH_BASE, GPIO_PIN_7 | GPIO_PIN_6 |
                       GPIO_PIN_4);
    
        SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_2,
                           SSI_MODE_MASTER, 1000000, 8);
    
        SSIEnable(SSI2_BASE);
    
        while(1){
    
            pui32DataTx[0] = set_bit( pui32DataTx[0],0,1);
            pui32DataTx[0] = set_bit( pui32DataTx[0],1,0);
            pui32DataTx[0] = set_bit( pui32DataTx[0],2,0);
            pui32DataTx[0] = set_bit( pui32DataTx[0],3,0);
            pui32DataTx[0] = set_bit( pui32DataTx[0],4,0);
            pui32DataTx[0] = set_bit( pui32DataTx[0],5,0);
            pui32DataTx[0] = set_bit( pui32DataTx[0],6,0);
            pui32DataTx[0] = set_bit( pui32DataTx[0],7,1);
    
            GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_5, GPIO_PIN_5);
            GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_5, !GPIO_PIN_5);
    
            for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
            {
                SSIDataPut(SSI2_BASE, pui32DataTx[ui32Index]);
            }
    
    
            while(SSIBusy(SSI2_BASE))
            {
    
            }
            GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_5, GPIO_PIN_5);
    
        }
    }
    Where exactly is the problem ?

  2. #2
    Beginner Beginner aliyolcu28 is on a distinguished road
    Join Date
    Dec 2019
    Posts
    6
    Points
    57.5
    There are no authorized people in this forum

  3. #3
    Beginner Beginner forix is on a distinguished road
    Join Date
    Feb 2012
    Location
    Munich
    Posts
    76
    Points
    219.53125
    The SPI Mode of the ISO1H816G as SPI slave is Mode=2. MSB first, SCLK idle = High. At CS# = Low -> SO data out on falling edge of clock, SI data in on rising edge of the clock.

    The description of communication covering SPI interface is in chapter 3.5 of datasheet, moreover chapter 4.8 is covering the timing data for the signals.
    To transfer the information of what output has to be switched on is needed to send a 8 bit sequence with 0 or 1 for off or on status for the 8 channels.

  4. #4
    Beginner Beginner aliyolcu28 is on a distinguished road
    Join Date
    Dec 2019
    Posts
    6
    Points
    57.5
    Hi forix,

    I don't think there's anything wrong with the Times.
    Can you tell me where the" DIAG " pin should be? ( HIGH - LOW )
    I'm throwing you Oscilloscope Pictures again

    TX DATA = 0xFF

    Click image for larger version

Name:	giden1.PNG
Views:	0
Size:	449.0 KB
ID:	4389
    -------------------------------------------------------------
    Click image for larger version

Name:	giden2.PNG
Views:	0
Size:	464.3 KB
ID:	4390

    Can you send me the code you burned 1 ledi if you have it?
    I'm curious about the value sending structure.


    pui32DataTx[0] = set_bit( pui32DataTx[0],0,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],1,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],2,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],3,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],4,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],5,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],6,1);
    pui32DataTx[0] = set_bit( pui32DataTx[0],7,1);

    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_3 , GPIO_PIN_3); // CS = ON
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_3 , !GPIO_PIN_3); // CS = OFF

    for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
    {
    SSIDataPut(SSI0_BASE, pui32DataTx[ui32Index]); //Data Put
    }
    while(SSIBusy(SSI0_BASE))
    {
    }
    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_3 , GPIO_PIN_3); //CS=ON


    Thanks for the answer.

  5. #5
    Beginner Beginner forix is on a distinguished road
    Join Date
    Feb 2012
    Location
    Munich
    Posts
    76
    Points
    219.53125
    The output pin DIAG# provides an open drain functionality. A current source is also connected to the pin DIAG#. In normal operation the signal DIAG is high. When overtemperature or Vbb below ON-Limit is detected the signal DIAG changes to low.
    Looking to the oscillograms: Are the channel settings for the amplitudes correct? Signal TX is below 1V ? Anyway the quality of the signal clock is bad. You may use 10k pullups for the SPI pins CLK, SI and SO to have better view on th scope.

    For seeing the shift out and sample in of the data a screenshot of clock together with SI or SO will better show what is happening.
    Last edited by forix; Jan 16th, 2020 at 01:28 AM. Reason: adding a comment.

  6. #6
    Beginner Beginner aliyolcu28 is on a distinguished road
    Join Date
    Dec 2019
    Posts
    6
    Points
    57.5
    My DIAG pin is in a constant low position, but there's no heating or voltage issues.
    Write me the data structure I need to send ISO1H816G or the HEX character I need to send.
    If you have used this entegre before, you can write the sample code or structure.

  7. #7
    Beginner Beginner forix is on a distinguished road
    Join Date
    Feb 2012
    Location
    Munich
    Posts
    76
    Points
    219.53125
    DIAG# pin has a pullup resistor? VCC is 3.3V Can you please comment on the osci screenshots and signal levels? The TAB is connected to Vbb? Vbb is > 11V? The two voltage domains VCC and VBB are isolated from each other?

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.