Jump to content
igor

eLua for Stellaris Launchpad

Recommended Posts

Igor, I haven't downloaded your latest fixes yet. I re-read the errata and my interpretation was incorrect. I tried ssi0 on PA2,3,4,5 and it works - but not with your code. I explicitly set each port bit. 

 

if (id == 0)
  {
//
    // Enable pin PA4 for SSI0 SSI0XDAT0
    //
    MAP_GPIOPinConfigure(GPIO_PA4_SSI0XDAT0);
    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_4);
 
    //
    // Enable pin PA3 for PIO as slave select
    //
    MAP_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_3);
 
    //
    // Enable pin PA5 for SSI0 SSI0XDAT1
    //
    MAP_GPIOPinConfigure(GPIO_PA5_SSI0XDAT1);
    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5);
 
    //
    // Enable pin PA2 for SSI0 SSI0CLK
    //
    MAP_GPIOPinConfigure(GPIO_PA2_SSI0CLK);
    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2);
 
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE,GPIO_PIN_2,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_3,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_4,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_5,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
    }
 
My suspicion is MAP_GPIOPinConfigure() and/or  MAP_GPIOPinTypeSSI();
won't work for multiple bits - I have not looked further into the code for these functions to verify this. Anyway, using a switch rather than a table approach will get around these problems as well as SSI1

Share this post


Link to post
Share on other sites

After doing a bit more fiddling:

 

if (id == 0)
  {
//
    // Enable pin PA4 for SSI0 SSI0XDAT0
    //
    MAP_GPIOPinConfigure(GPIO_PA4_SSI0XDAT0);
 
    //
    // Enable pin PA3 for PIO as slave select
    //
    MAP_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_3);
 
    //
    // Enable pin PA5 for SSI0 SSI0XDAT1
    //
    MAP_GPIOPinConfigure(GPIO_PA5_SSI0XDAT1);
 
    //
    // Enable pin PA2 for SSI0 SSI0CLK
    //
    MAP_GPIOPinConfigure(GPIO_PA2_SSI0CLK);
 
 
    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_4 | GPIO_PIN_5);
 
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE,GPIO_PIN_4,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_3,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_2,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_5,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
    }
 
was the simplest I could make it.
 
MAP_GPIOPadConfigSet() didn't like multiple bits
nor did
MAP_GPIOPinConfigure()

Share this post


Link to post
Share on other sites

Interesting. Doing the pins together worked on older chips with Stellarisware.  Will look at updating the code with your workaround.  Thanks.

By the way when posting code you may want to use the code attribute (the icon is less than obvious - the pair of angle brackets <> ).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×