Jump to content
43oh

driverlib speed anomaly (_ROM) (TIVA TM4C123GXL)


Recommended Posts

Hello,

after fooling around a little bit, I recognize following driverlib behavior:

 

While I get with this sketch about 450kHz on  my oscilloscope

 

#include <stdint.h>
#include <stdbool.h>


#define PART_TM4C123GH6PM
#include "inc/tm4c123gh6pm.h"
#include "driverlib/gpio.h"
byte running=1;
void setup()
{
  GPIOPadConfigSet(GPIO_PORTA_BASE, 0xff, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
  GPIODirModeSet (GPIO_PORTA_BASE, 255, GPIO_DIR_MODE_OUT);
}


void loop()
{
  while(1)
  {
  running=!running;
  GPIOPinWrite(GPIO_PORTA_BASE,128,running<<7);
  }} 

...I'll get only 176kHz with the ROM_ equivalent:

 

#include <stdint.h>
#include <stdbool.h>


#define PART_TM4C123GH6PM
#include "inc/tm4c123gh6pm.h"
#include "driverlib/gpio.h"
byte running=1;
void setup()
{
  ROM_GPIOPadConfigSet(GPIO_PORTA_BASE, 0xff, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
  ROM_GPIODirModeSet (GPIO_PORTA_BASE, 255, GPIO_DIR_MODE_OUT);
}


void loop()
{
  while(1)
  {
  running=!running;
  ROM_GPIOPinWrite(GPIO_PORTA_BASE,128,running<<7);
  }
}

Does anyone have any idea why is that?

Remember, that all energia stuff is related to the ROM_* commands (like wiring_digital.c)

 

 

Link to post
Share on other sites

Ok, it seems, that my DS201 is out of range for this measure, can someone check this two codes out with "real equipment"?

Meanwhile I've stripped the code down to complete low level: (Measuring pin is PA7)

 

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_gpio.h"
#define PART_TM4C123GH6PM
#include "inc/tm4c123gh6pm.h"
#include "driverlib/gpio.h"
byte running=1;
void setup()
{
  GPIOPadConfigSet(GPIO_PORTA_BASE, 0xff, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
  GPIODirModeSet (GPIO_PORTA_BASE, 255, GPIO_DIR_MODE_OUT);
}


void loop()
{
  while(1)
  {
  running=!running;
  HWREG(0x40004200)=running<<7;
  }
}
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...