We are all familiar with AVR and PIC based microcontrollers as they are widely used but ARM based microcontrollers are getting popular nowadays because of their cost and speed. This beautiful shiny Red board is fascinating to work just because of the very fact that it belongs to Texas Instruments. Using this LaunchPad we can work with C series Microcontrollers which offers bit performance with an operational speed up to MHz.
The tutorials will be written for very beginners in electronics and hence every topic would be briefed as crisp as possible. The hardware required for these tutorials would be a laptop and the TIVA LaunchPad Development Toolkit with few other basic electronics components that you can easily find in your local electronics hardware shop.
They all have different number of GPIO pins, speed, memory and connectivity.
All the important features of different TIVA boards are compared in the table given below:. As you can see in above table that all LaunchPad boards feature on-board emulation for programming and debugging code, push buttons and LEDs, as well as connectors which are used to connect TI based BoosterPacks plug-in modules, which adds new functionality to the LaunchPad such as wireless connectivity, LEDs, sensors and more. However, the way they work internally are totally different because they have different registers and different process for using them.
Dimensions of these developments kits are almost same but they have different number of GPIOs and processing speeds. Coding techniques are also different in each family. There are two USB connectors and one power select switch. For programming and Debug purpose you have to use USB connector with Debug written under it, also make the power select switch towards debug to program it. Also, you can power the board using this connector.
Alternatively, for powering the microcontroller you can use second USB connector and make the power select switch towards Device. But this will only power up the board and cannot be programmed. Texas Instruments allows us to program their Microcontrollers through a variety of Environments. These softwares are free but using these requires some minimal level of experience with Microcontrollers. Energia is an Open source and free Environment that enables us to program the TI Microcontrollers easily.
Select the Version based on your operating system, for windows you should notice a ZIP file being downloaded. After downloading the ZIP just extract it on your preferred location and open the folder. You find the application named Energia. Launch it and it should Look something like below. Search for TivaC boards and download it as shown below.
The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. If you check the signal tables on pageyou will see that PF0 ,where one of your switches is connected to, is one of them.
So you need to unlock it.
Learn more. Turn led on when both switches are pressed Ask Question. Asked 4 years, 2 months ago. Active 2 years, 6 months ago.
Viewed 3k times. I'm trying to turn the led on in my tiva launchpad tm4c When I press both or only SW2 nothing happens. When I press SW1 the red led turn on. Could someone explain to me why? Bruno Bruno 3 3 silver badges 15 15 bronze badges. Active Oldest Votes. On pageit says Writing 0x4C4F.
Sign up or log in Sign up using Google.
Project 2 - Flashing all onboard-LED colour combinations
Read up about this project on. December 21, From the previous project we have seen how to blink LED white colour. This project post will demonstrate how to flash the on board LED colour combinations without much math. Therefore to display red we need to output 0x02, here '2' because PF0 is not being used.
Lets find the combination for output bit O0 in terms of D2D1D0, for the above drawn table lets make the KMap 3-variable. After Drawing the chart we get. Now to implement this algorithm in program we need a include file or header file which extracts bits, as it is tedious to repeat the masking procedure multiple times. Visit Project Home Page for further details and projects. Log in Sign up. Project 2 - Flashing all onboard-LED colour combinations. Akash Kollipara. Beginner Full instructions provided Things used in this project.
December 21, From the previous project we have seen how to blink LED white colour. So the LED is connected as follows.
Follow Contact Contact. Related channels and tags arm led microcontroller. Buy from Newark Buy from store. Texas Instruments Code Composer Studio.But we have not generated the delay in micro controller.
In this section we will generate delay using different methods and blink on board LEDs. There are two types of delays that can be generated by our program:. For generation of accurate delay in microsecond we prefer hardware delay. SysTick is a simple counter that we can use to create time delays and generate periodic interrupts.
It exists on all Cortex-M microcontrollers, so using SysTick means the system will be easy to port to other microcontrollers. As we learned earlier that modifying registers are the key for configuration and desired functionality. Hence systick timer can be used by modifying these registers.
We will see how to reload and check flag bit in the next few steps. Now we are going to trigger our timer by writing ENABLE bit 1 so writing 0x5 will trigger our timer at the same time it will also set the configuration. Now the loaded value will be started to count down. When the timer gets rollover the bit 16 will set to one.
Subscribe to RSS
Since we are working with external clock i. So if we load into the RELOAD register and trigger the counter it will count down with next pulse and will take Hence, In order to generate the delay, we can calculate the approximate value that has to be loaded into this register by the formula. By subtracting by one will give exact time delay. Therefore in one shoot, we can only generate maximum of Time delay.
However, in this first example interrupts will not be generated. There are two types of delays that can be generated by our program: Software delay Hardware delay Software delay This type of delay is nothing but making the controller busy, doing the task which will occupy a certain duration.
For example if we want our friend to wait for us then instead of telling him to wait we can simply engage him in other task. But the generated time may or may not be so accurate. Example: In C code if we can use this for loop for generating a delay of 1 second. Interrupt Enable 0: Interrupt generation is disabled 1: when SysTick counts to 0 an interrupt is generated.This example shows the simplest thing you can do with an Arduino or Genuino to see physical output: it blinks the on-board LED.
This LED is connected to a digital pin and its number may vary from board type to board type. To make your life easier, we have a constant that is specified in every board descriptor file.
Here is the correspondence between the constant and the digital pin. Connect the long leg of the LED the positive leg, called the anode to the other end of the resistor.
The value of the resistor in series with the LED may be of a different value than ohm; the LED will lit up also with values up to 1K ohm. After you build the circuit plug your Arduino or Genuino board into your computer, start the Arduino Software IDE and enter the code below.
This supplies 5 volts to the LED anode. That creates a voltage difference across the pins of the LED, and lights it up.
Then you turn it off with the line:. In between the on and the off, you want enough time for a person to see the change, so the delay commands tell the board to do nothing for milliseconds, or one second. When you use the delay command, nothing else happens for that amount of time. Once you've understood the basic examples, check out the BlinkWithoutDelay example to learn how to create a delay while doing other things.
Once you've understood this example, check out the DigitalReadSerial example to learn how read a switch connected to the board.The switch will be configured as an input with edge triggering i. And the LED pin will be configured as output. After the configuration steps portion I will explain you how to write a C language code to do the task.
Mechanical switches are commonly used to feed any parameters to the digital systems. The switches can be interfaced to a microcontroller using digital inputs. The software program for switch interfacing can be implemented using one of the following methods. We will discuss polling based switch interfacing in this tutorial.
Before proceeding further, it is important to first make ourselves familiar with the physical behavior of switch and be will describe switch bouncing next, which is one of the critical attribute of its physical behavior. Electrical switches that use mechanical contacts to close or open a circuit are subject to bouncing of the contacts. Switch inputs are asynchronous and are not electrically clean. When a hardware switch is pressed the mechanical contact of the switch that is made to complete the electrical connection will start bouncing.
This bouncing effect will read a single press I in the software as multi presses of the switch. The software will get confused whether about how many time the switch was pressed. Both software as well as hardware solution to this problem are present. If we want to remove this problem using a hardware circuit, we will be using a simple RC filter.
The values of resistor and capacitor will be chosen such that the input will be captured after the bouncing period is over. The bouncing effect of a switch is shown in the figure below. The above figure is the exact elaboration of the deb bouncing effect of the switch. At the start the switch is at off 0 state.
When the switch is activated it will result in multiple bouncing as is obvious from the figure, before actually coming to steady ON 1 state. Same is the case when the switch is deactivated. This issue may not cause any problem where you are working solely with hardware, but while working with the GPIO pins of TIVA board one press will be interpreted as multiple presses and the results may not be in accordance with the desired or required results.
This is one of the most important points to be considered while working with switches. If we are interested in using the built in switch of the board we must configure the corresponding pin of the board as input pin.
The pin will read data from the switch and according to the data obtained from the switch it will control the built in LED of the board which is configured as output. The configuration steps of the switch are almost same as that of the LED configuration steps except the configuration of pull up resistor. In this example I will explain the working of a C program that will toggle the blinking of LED with the help of switch. At each press of the switch the LED will toggle its present state i.
This is called edge triggering.It is recommended to download any files or other content you may need that are hosted on processors. The site is now set to read only. LaunchPad Resource Portal. In this project we will walk you through the process of importing your first project and modifying the project behavior.
There are two ways to get all the tools you will need. One is to download a single package that contains all of the installers and documentation. The alternate if you already have one or more of the components needed is to download them separately. If you run into trouble double check device manager and the three Stellaris devices are listed as mentioned above.
Occasionally you must re-install the drivers even though the devices are listed as working correctly. All of these binaries are tested and known to work. Make sure you select an ek-tm4cgxl binary that you have not rebuilt or modified. If you are still in a debug session terminate the session and return to the CCS Edit perspective. Copy Lines 82 through 90 of project0. Note that the 2nd parameter serves as a bit mask for which pins to write. Click the bug icon to build, download and debug your changes.
CCS will change back to the Debug Perspective. The code will run until the first line of main and then stop. Click the run icon to resume operation.
Observe red, blue and green blinking pattern. You have just imported, modified, downloaded and debugged your first TivaWare Project. From Texas Instruments Wiki. Jump to: navigationsearch.