Posts

Showing posts with the label cortex-m4

TIVA Launchpad TM4C123 Part 2 - Push Button

SW1 Push button is connected to PF0 Pin, SW2 Push button is connected to PF4 Pin. Notice that there is no pull up resistor connected to SW1 or SW2. To use SW1 and SW2 we need to enable the internal pull-up resistor for PF0 and PF4 pins. Steps for Switching Green LED on SW1 push and RED Led on SW2 Push 1. Enable the clock to PORTF 2. Set the Direction Register PF4, PF0 as input and PF1, PF3 as output 3. Select the Digital I/O feature of PORTF 4. Enable the pull-up resistor option in PUR register for PF0 and PF4 pins 5. Read GPIODATA value and set the LED depending on which button is pressed 6. Repeat Step 5 For SW2, extra steps need to be taken as PF0 pin to which SW2 is shared with NMI. To prevental accidental write to configuration registers and thus NMI, the configuration register bits for PF0 are normally locked. It may be unlocked by writing a passcode value of 0x4C4F434B to the LOCK register followed by setting bit 0 of the commit register. main.c Now press SW1 ...

TIVA Launchpad TM4C123 Part 1 - Blinking RGB LED

Image
Before we start writing programs, we need to install the following softwares. 1. Download and install the latest version of Code Composer Studio (CCS): http://processors.wiki.ti.com/index.php/Download_CCS 2. Download and install the full version of TivaWare from below link. The file name to download is SW-TM4C-x.x.exe http://www.ti.com/tool/sw-tm4c 3. Download and install the latest LM Flash Programmer http://www.ti.com/tool/lmflashprogrammer 4. Download the TM4C123GHGPM Microcontroller datasheet and User Guide http://www.ti.com/lit/ds/symlink/tm4c123gh6pm.pdf http://www.ti.com/lit/ug/spmu296/spmu296.pdf 5. Run the Code Composer Studio 6. File -> New -> CCS Project 7. Select 'TIVA TM4C123GH6PM' from the drop down list, enter the Project Name: 'LED_BLINK' and click on 'Finish' 8. On the board, PF1 is connected to RED LED, PF2 is connected to BLUE LED and PF3 is connected to GREEN LED. GPIO Registers in TM4C123: Dat...