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.

OMAP-L138 EVM (c6748) - trigger external device on j22 pin (GP8[0])

Other Parts Discussed in Thread: SYSCONFIG

Hi everyone,

I'm working on a project where I've just purchased an OMAP-L138 EVM  from Logic PD and gone through the test programs, which seems to be working fine. But to continue with my project I need to be able to trigger an external device.

I think this can be achieved by doing this:

1. Using pin 9 on the J22 pins (JTAG_RTCK) as the trigger pin.

2. Setting GP8[0] high would trigger an external event on that pin, hence my external device.

I'm using the code below, while having pin 9 connected to a oscilloscope, to investigate whether or not he pin is getting set to high and low.

    GPIO_setDir(GPIO_BANK8,GPIO_PIN0,GPIO_OUTPUT);
    for (i = 0; i<20; i++)
    {
        GPIO_setOutput(GPIO_BANK8,GPIO_PIN0,OUTPUT_HIGH);
        USTIMER_delay(DELAY_1_SEC);
        GPIO_setOutput(GPIO_BANK8,GPIO_PIN0,OUTPUT_LOW);
    }

But, as usual, a problem arises! I  simply can't see these triggers. Not even when I'm using breakpoints and stepping through the code. Isn't the GP8[0] connected to pin 9 on j22 ()? Do I need to make any more configurations of the GPIO8[0]? Or am I just missing something obvious?


Best regards,

Abebe Hailu

  • Hi again,

    After some further investigation, this is what I've got:

    1. It seems like it's not enough to just describe what direction the GP8[0] should have. I need to configure it to have the specific function and not the reserved one (which is the default). This is by setting the PINMUX19_31_28 in the PINMUX19 register to 0x8. - Datasheet spruh79a

    2. By taking a glance at spraat2e  I saw that this can be done my masking the PINMUX[19] in the struct sysconfig_regs_t in the sysconfig.h file with a mask that will give the bits 31-28 the binary value 1000.

    Pinmux[REGNUM]=(Pinmux[REGNUM]&~MASK)|(MASK & VALUE)

    Is this the right way to go or is it any easier way of doing this? As I stated earlier, I want to use the GP8[0] (which is connected to pin 9 on j22) to trigger another device.

    Regards,

    Abebe Hailu

  • It seems to work! The code I wrote for this is:

    #include "evmc6748_sysconfig.h"

     

               uint32_t mask0 = 268435455;      // Bits 31-28 is set to 0 because they are in an unstable state.

               uint32_t mask1 = 2147483648;     //Bit 31 is set to 1 so that GP8[0] function is  activated.

               SYSCONFIG->PINMUX[19] = (SYSCONFIG->PINMUX[19] & mask0);

               SYSCONFIG->PINMUX[19] = (SYSCONFIG->PINMUX[19] | mask1);

              

               GPIO_setDir(GPIO_BANK8,GPIO_PIN0,GPIO_OUTPUT);

                         

               for (i = 0; i<10; i++)

               {

                          GPIO_setOutput(GPIO_BANK8,GPIO_PIN0,OUTPUT_HIGH);

                          GPIO_setOutput(GPIO_BANK8,GPIO_PIN0,OUTPUT_LOW);

                          USTIMER_delay(DELAY_1_SEC);

               }

    I can see the bit going from high to low when I connect the pin to an oscilloscope. The problem now is that it's in the 100mv range (I need it to be in the 1v range). Is there anything I can do in the software to amplify this or do I need to construct a hardware solution?

    Regards,

    Abebe