This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Olimex TMS570-CAN board - control of LED1 and LED2 thru SPI / DMM

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Sirs:

I am working with the Olimex TMS570-CAN board, trying to control LED1 and LED2.  Schema for TMS570-CAN (TMS570LS20216SPGE ) indicates LED1=DMMDATA[11]/MIBSPI5SIMO[3] and LED2=DMMDATA[13]/mIBSPI5SIMO[1].  SPNS141F–JULY 2011, table 2-8 page 25 indicates pins are multiplexed.  There is no multiplexing registers in the LS20216 part.  Same document, section 4.6.2 page 49 indicates multiplexing is accomplished by enabling/disabling the MIBSPIP5 and DMM modules.  I believe after deciding which module has pin control, you can then, in the module set-up, configure pins for either peripheral or GIO function to drive the LEDs. Are my assumptions correct?

When using HalCoGen V3.04.00 configured for TMS570LS20216SPGE (TMS570-CAN board processor): on the “General” tab the DMM Module is “Grayed” out, can I assume HalCoGen software is incomplete?  Will I need to create my own DMM control routine?  Do you have a solution to configure the TMS570-CAN board to drive LED1 and LED2?

Thank You, Leonard Cronk 08MAR13

  • Leonard Cronk said:

    Sirs:

    I am working with the Olimex TMS570-CAN board, trying to control LED1 and LED2.  Schema for TMS570-CAN (TMS570LS20216SPGE ) indicates LED1=DMMDATA[11]/MIBSPI5SIMO[3] and LED2=DMMDATA[13]/mIBSPI5SIMO[1].  SPNS141F–JULY 2011, table 2-8 page 25 indicates pins are multiplexed.  There is no multiplexing registers in the LS20216 part.  Same document, section 4.6.2 page 49 indicates multiplexing is accomplished by enabling/disabling the MIBSPIP5 and DMM modules.  I believe after deciding which module has pin control, you can then, in the module set-up, configure pins for either peripheral or GIO function to drive the LEDs. Are my assumptions correct?

    HW: TRUE

    When using HalCoGen V3.04.00 configured for TMS570LS20216SPGE (TMS570-CAN board processor): on the “General” tab the DMM Module is “Grayed” out, can I assume HalCoGen software is incomplete?  Will I need to create my own DMM control routine?  Do you have a solution to configure the TMS570-CAN board to drive LED1 and LED2?

    HW: You need to create your own software for DMM. If you want to drive the DMM pin in GIO mode, that should not be difficult. I dont have the schematic of your board. Which pin do you want to toggle?

    Thank You, Leonard Cronk 08MAR13

  • Just adding this as a possible shortcut.

    If you create another project for the TMS570LS3137 device, then the DMM will not be greyed out and when you generate code it will generate a

    dmm.c,  dmm.h and reg_dmm.h file.

    At minimum, using the LS3137 the reg_dmm.h file might save some time,  if you copy it into your LS20216 project.

    I am not sure if DMM is 100% compatible from LS20216 to LS3137 but it should certainly be very close.  I would just recommend checking the reg_dmm.h against the technical reference manual for the LS20216 before using it.

    -Anthony

  • Haiziao,

    Schema for TMS570-CAN (TMS570LS20216SPGE ) indicates LED1=DMMDATA[11]/MIBSPI5SIMO[3] and LED2=DMMDATA[13]/mIBSPI5SIMO[1].  The LEDs are the pins I wish to toggle.

    Leonard 11MAR13

  • I dont have the hardware setup. 

    sth like this might work:

    *((volatile int *) 0xFFF7FC00) = 1;//take the SPI5 out of reset mode.
    //by default, all pin are in GPIO mode, anyway configure SIMO 1 and 3 in GIO mode
    *((volatile int *) 0xFFF7FC14) &= ~(0xA<<16);
    //Configure the SIMO1 and 3 in output mode
    *((volatile int *) 0xFFF7FC18) |=0xA<<16;
    while(1)
    {
    temp = *((volatile int *) 0xFFF7FC1C);//read the input register
    if(temp & 0x00020000) //pin SIMO1
    *((volatile int *) 0xFFF7FC28) = 0x00020000;//clear the pin
    else
    *((volatile int *) 0xFFF7FC24) = 0x00020000;//set the pin

    if(temp & 0x00080000) //pin SIMO3
    *((volatile int *) 0xFFF7FC28) = 0x00080000;//clear the pin
    else
    *((volatile int *) 0xFFF7FC24) = 0x00080000;//set the pin

    //wait for some time
    for(temp=1;temp++;temp<10000);
    }

  • Do you have further questions?

    Regards,

    Haixiao