Note - Common errors

Here are just some quick notes about common errors

More common errors:

Locked pins:

You can see from this table taken from the datasheet of TM4C123GH6PM that PD7 and PF0 are locked pins. Check your datasheet if you are using other MCU.

You need to do the following lines of code to actually use this pins:

For PF0:

HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;

HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= 0x01;

For PD7:

HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;

HWREG(GPIO_PORTD_BASE + GPIO_O_CR) |= 0x81;

(these lines of code are considering you use TivaWare and you have included the right headers: inc/hw_memmap.h, inc/hw_gpio.h)

Tiva TM4C123 Launchpad Shunted Pins

The pins PB7 is connected to PD1 by a 0 ohm resistors. The same applies to PB6 and PD0. This is due to backwards compatibility with the MSP430G2 launchpad so they use the same boosterpacks. Personally i just find those resistors annoying.

You can see in the following image which are the resistors (enlarge to see better). I don't know which specific one is the PB7-PD1 or the PB6-PD0.

3 to 5 wait cycles after enabling a clock on a peripheral

You probably seen in many of my examples the use of SysCtlDelay() after enabling a clock for a peripheral.

Now this is not needed to all peripherals but I only found out later.

It seems it's only needed for peripherals with a different clock than the System/CPU.

I believe this is due to the ADC always starting with the 16Mhz clock - when XTAL is selected with the PLL -

while you can have the System Control at working up to 80Mhz (which I usually use). Now If you enable the ADC at time=0, the ADC will be ready in his next clock cycle - since the CPU works at 5x the clock speed of the ADC (in this case), the processor can actually execute 5 instructions before the ADC is ready, so if those instructions access the ADC registers you will go into a Fault.

So you should just need the delay after enabling the peripheral clock for the ADC. I can't confirm that for the USB module