SlideShare a Scribd company logo
Lab 1
EENG 3910: Project V - Digital Signal
Processing System Design
9/14/2015
Joseph Chandler
University of North Texas
College of Engineering
Electrical Engineering
Introduction
Lab 1 introducesthe TivaTM
C SeriesEK-TM4C123GXL. Code ComposerStudio(CCS) isusedforsoftware
supportand boththe hardware and software are productsof TexasInstruments.
Results and Discussion
Problem 1
The firstproblemisan introductiontoCCS.It explainshow toconfigure the TivaTM
CSeriesEK-
TM4C123GH6XL. Afterthe hardware parametersare set,a sample programisaddedto the new project
for analysis.The buildfunctionisshownandthe debuginterface isshown.
Problem 2
#include <stdint.h>
Thisline containsthe headerfile for variabledefinitions.The headerfileisalreadydefinedinthe CCS
software.Examplesof the valuesare bitsize,precision,andsignedorunsignedintegers.
#include <stdbool.h>
Thisline containsthe headerfile forBooleandefinitions.The headerfile isalreadydefinedinthe CCS
software.The file definitionsare usedforoperations,comparingvariables,andprogramcontrol flow.
#include "inc/hw_memmap.h"
Thisline containsthe headerfile forthe TivaCSeriesdevice memorymapdefinitions.The headerfile
containsmanyof the same definitionsusedfordirectregisteraccess.The headerfilecontainsmacros
and definitionstosimplifyprogrammingthe peripheral'sregistersandinterruptcontrol.The definitions
are usedbydriverlibrariesandare hiddenfromthe programmer.
#include "inc/hw_types.h"
Thisline containsthe headerfile forcommontypesandmacros.The headerfile containsmanyof the
same definitionsusedfordirectregisteraccess.The valuesare awide varietyof general use for items
such as arithmetic,clocktiming,file recognition,anddevicerecognition.
#include "driverlib/sysctl.h"
Thisline containsthe headerfile forthe SystemControl APIdefinitionsandmacros.The headerfile isin
the directory"driverlib"of the CCS software.The driversprovideguidedcontrol of the peripheralsand
allowsforquickapplication.Enablingperipheralsisanexampleof thiscontrol.
#include "driverlib/gpio.h"
Thisline containsthe headerfile forGPIOAPIdefinitionsandmacros.The headerfile isinthe directory
"driverlib"of the CCSsoftware.The driverprovidesasetof functionstocontrol the inputand output
module.
int main(void){
The main processcalls andacts on variables,macros,definitions,andothersystemfunctions.
uint8_t pin_data=2;
An unsigned 8-bitintegervariable isinitializedto2
uint32_t delay_count=2.66e7;
An unsigned 32-bitvariable isinitialized to2.66e7
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SystemControl ClockSet setsthe clockingof the device. Osc_Mainconfiguresthe oscillatorsource.
XTAL_16MHZ usesa 16 MHZ crystal clock. USE_PLL is a phase lockedloopat 400 MHz. SYSDIV_5divides
the clock bythe numberspecifiedgivingcontrol of the frequency
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
Enablesthe peripheral forthe general purpose input/outputportF
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
Thisline configurespinsforuse asGPIOoutputs.The firstparameteristhe base addressof the GPIO
port. Inthisapplicationthatwouldbe portF. The nextparameteristhe bit-packedrepresentationof the
pins. Thisfunctionprovidesproperconfigurationof the pinswithoutprogramming registers.Type of
outputwill be the three onboardLEDs that use portF.
while(1) {
The while loopprovidesa continuousloop whensetto"1".
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, pin_data);
Thisline writesavalue tothe specifiedpins. The valueiscontainedinthe variable"pin_data".The initial
state of "pin-data"is2. Therefore,the value2is giventoall of the pins.Yet,onlyone of the pinswill
correspondtothe givenvalue due toa pre-setconditionof 2mA,4mA,and 8mA.
SysCtlDelay(delay_count);
Thisline providesadelay.The variable "delay_count"holdsthe value of the delayloop. The constantis
2.66e7. The loopiterates3 times.
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);
Thisline writes avalue tothe specifiedpins. Therefore,the value0is giventoall of the pins. This
essentiallyclearsthe LEDsof all "high"input.NoLED action.
SysCtlDelay(delay_count);
Thisline providesadelay.The variable "delay_count"holdsthe value of the delayloop.The constantis
2.66e7. The loopiterates3 times.
if(pin_data == 8)
The "if"statementischeckingif the current value of the pinvariable isequal to8.
pin_data = 2;
The value of the pinvariable issetto2.
else
The "else"statementisusedwhenthe currentvalue of the pinvariable isnotequal to8.
pin_data = pin_data*2;
The value of the pinvariable ismultipliedby2.
Problem 3
The EK-TM4C123GXL LED clock rates are increasedwhenthe numberof systemdivisionsare decreased.
SysCtlClockSet(SYSCTL_SYSDIV_10|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
20 MHz
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
40 MHz
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
50 MHz
SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
80 MHz
Next,the valuesof the variable "delay_count"weredeterminedfor1secondaccordingto the rise in
frequency. The desiredfrequencywasdividedby3 cpu cyclesto determinethe time delayinterval
neededinthe systemvariable"delay_count".
uint32_t delay_count=0.66e7; // For about 1s delay at 20 MHz clock rate.
20MHZ/3 = 0.67e7
uint32_t delay_count=1.33e7; // For about 1s delay at 40 MHz clock rate.
40MHZ/3 = 1.33e7
uint32_t delay_count=1.66e7; // For about 1s delay at 50 MHz clock rate.
50MHZ/3 = 1.67e7
uint32_t delay_count=2.66e7; // For about 1s delay at 80 MHz clock rate.
80MHZ/3 = 2.67e7
Finally,the variable"delay_count"waschangedtothe resultsabove.The resultof the LED displayis 1
seconddelay.
Problem 4
An Introductiontothe TivaC SeriesPlatformof Microcontrollerswasanoverview of TI'snextgeneration
of ARM Cortex M4 processors.The reportonthe new microprocessorsboastedof the new 32-bit
architecture andhighprecision.The serieshasalarge instructionset andbetterresolutionforcapturing
samplesof analogsignalsandconvertingthemtodigital.Multi-taskingandreal-time applicationhas
greatlyimproved.Also,the durabilityhasimprovedalongwithlow energyconsumption.
TivaWare Peripheral DriverLibraryisa setof driversthatmake the TIVA C Serieseasiertoprogram.They
are writteninCfor the most part and efficient.There are multiplesoftwarepackagesthatare available
to use all the driversare mappedout fordirectregisteraccess.The driverlibrarycanbe usedalongwith
directregisteraccessformore efficientprogramming.The generalpurpose input/outputmodule has8
pinsthat can be configuredasan inputor an outputwithdifferentcapabilities.Also,more thanone pin
can be operatedonat one time.The systemcontrol givesmore flexibilitywithabilitiestochange
frequency,timing,clock-type,energyuse,andthree differentoperatingmodes.
The TM4C123GH6PM MicrocontrollerOverview givesdetailedinformationaboutthe Core,
Performance,Flash,SystemSRAM,EEPROM,Internal ROM,Security,CommunicationInterfaces,System
Integration,AdvancedMotionControl,AnalogSupport,andhardware layout.
The three LEDs are connectedthroughportF of the GPIO module.The schematicshowsthe three LEDs
have diodescontrollingthe input.The diodesturnonfor the gatesthat correspondto2, 4, and 8. This
referstothe mA that activateseachLED. If itdoesnot containthe right amountof mA the transistoris
not activated. Eachiterationof the loopsends a "0" or "off" to all the gatesbefore the new loop
iterationiscalculated.
Summary and Conclusion
The Tiva C SeriesTM4C123G MicrocontrollerwasattachedbyUSB to the CPU and there were notany
problemswithpowering onorcompatibilitywithWindows7.CCS wasveryuserfriendlyandoffered
differenthardware implementation.The programswere builtwithouterrorandran accordingto plan.
CCS programsusedsoftware driverstomapmostof the hardware and applications.
References
TexasInstruments.(2014).TivaWarePeripheral Driver Library: User'sGuide. Austin,Texas:TI.

More Related Content

PDF
TinyML - 4 speech recognition
PPT
07 processor basics
PDF
Tensorflow lite for microcontroller
PDF
Synthesis & FPGA Implementation of UART IP Soft Core
PPTX
Modules and ports in Verilog HDL
PPT
09 accelerators
PDF
Analog to Digital Converter
PDF
Writing c code for the 8051
TinyML - 4 speech recognition
07 processor basics
Tensorflow lite for microcontroller
Synthesis & FPGA Implementation of UART IP Soft Core
Modules and ports in Verilog HDL
09 accelerators
Analog to Digital Converter
Writing c code for the 8051

What's hot (20)

PPTX
Matlab source codes section | Download MATLAB source code freerce-codes
PDF
5.MLP(Multi-Layer Perceptron)
PDF
Lecture5(1)
PDF
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
PDF
A study to Design and comparison of Full Adder using Various Techniques
PDF
Pragmatic optimization in modern programming - modern computer architecture c...
PPTX
Dr.s.shiyamala fpga ppt
PPT
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
PDF
17443 microprocessor
PPTX
Embedded system (Chapter )
PDF
PDF
Ebc7fc8ba9801f03982acec158fa751744ca copie
PDF
Code GPU with CUDA - SIMT
PDF
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
PDF
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
PDF
FPGA Implementation of High Speed FIR Filters and less power consumption stru...
DOCX
8086 MICROPROCESSOR
PDF
LinuxCNC 入門簡介
PPTX
Melp codec optimization using DSP kit
Matlab source codes section | Download MATLAB source code freerce-codes
5.MLP(Multi-Layer Perceptron)
Lecture5(1)
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
A study to Design and comparison of Full Adder using Various Techniques
Pragmatic optimization in modern programming - modern computer architecture c...
Dr.s.shiyamala fpga ppt
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
17443 microprocessor
Embedded system (Chapter )
Ebc7fc8ba9801f03982acec158fa751744ca copie
Code GPU with CUDA - SIMT
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
FPGA Implementation of High Speed FIR Filters and less power consumption stru...
8086 MICROPROCESSOR
LinuxCNC 入門簡介
Melp codec optimization using DSP kit
Ad

Similar to DSP_Assign_1 (20)

PDF
Bascom avr-course
PPT
20081114 Friday Food iLabt Bart Joris
PDF
Design and Implementation of Pulse Width Modulation Using Hardware/Software M...
PDF
LPCT controller Types on transceiver chip on pin count testing
DOCX
DSP_Assign_3
DOCX
Applications - embedded systems
DOCX
DSP_Assign_2 (Autosaved)
PPTX
EC18713 EMBEDDED SYSTEMS LABORATORY, EC18713
PPTX
Crypto Performance on ARM Cortex-M Processors
PPT
Microprocessor Systems and Interfacing Slides
PDF
Lorenzo 1210 features
PDF
Embedded processor system for controllable period-width multichannel pulse wi...
PDF
Dsp lab manual 15 11-2016
PPT
My seminar new 28
PPT
Picmico
PPTX
Bhabha atomic research Centre (BARC)
PDF
[IJET-V1I3P17] Authors :Prof. U. R. More. S. R. Adhav
PPT
An Overview of LPC2101/02/03
DOCX
Assignment
PDF
ESPM2 2018 - Automatic Generation of High-Order Finite-Difference Code with T...
Bascom avr-course
20081114 Friday Food iLabt Bart Joris
Design and Implementation of Pulse Width Modulation Using Hardware/Software M...
LPCT controller Types on transceiver chip on pin count testing
DSP_Assign_3
Applications - embedded systems
DSP_Assign_2 (Autosaved)
EC18713 EMBEDDED SYSTEMS LABORATORY, EC18713
Crypto Performance on ARM Cortex-M Processors
Microprocessor Systems and Interfacing Slides
Lorenzo 1210 features
Embedded processor system for controllable period-width multichannel pulse wi...
Dsp lab manual 15 11-2016
My seminar new 28
Picmico
Bhabha atomic research Centre (BARC)
[IJET-V1I3P17] Authors :Prof. U. R. More. S. R. Adhav
An Overview of LPC2101/02/03
Assignment
ESPM2 2018 - Automatic Generation of High-Order Finite-Difference Code with T...
Ad

DSP_Assign_1

  • 1. Lab 1 EENG 3910: Project V - Digital Signal Processing System Design 9/14/2015 Joseph Chandler University of North Texas College of Engineering Electrical Engineering
  • 2. Introduction Lab 1 introducesthe TivaTM C SeriesEK-TM4C123GXL. Code ComposerStudio(CCS) isusedforsoftware supportand boththe hardware and software are productsof TexasInstruments. Results and Discussion Problem 1 The firstproblemisan introductiontoCCS.It explainshow toconfigure the TivaTM CSeriesEK- TM4C123GH6XL. Afterthe hardware parametersare set,a sample programisaddedto the new project for analysis.The buildfunctionisshownandthe debuginterface isshown. Problem 2 #include <stdint.h> Thisline containsthe headerfile for variabledefinitions.The headerfileisalreadydefinedinthe CCS software.Examplesof the valuesare bitsize,precision,andsignedorunsignedintegers. #include <stdbool.h> Thisline containsthe headerfile forBooleandefinitions.The headerfile isalreadydefinedinthe CCS software.The file definitionsare usedforoperations,comparingvariables,andprogramcontrol flow. #include "inc/hw_memmap.h" Thisline containsthe headerfile forthe TivaCSeriesdevice memorymapdefinitions.The headerfile containsmanyof the same definitionsusedfordirectregisteraccess.The headerfilecontainsmacros and definitionstosimplifyprogrammingthe peripheral'sregistersandinterruptcontrol.The definitions are usedbydriverlibrariesandare hiddenfromthe programmer. #include "inc/hw_types.h" Thisline containsthe headerfile forcommontypesandmacros.The headerfile containsmanyof the same definitionsusedfordirectregisteraccess.The valuesare awide varietyof general use for items such as arithmetic,clocktiming,file recognition,anddevicerecognition. #include "driverlib/sysctl.h" Thisline containsthe headerfile forthe SystemControl APIdefinitionsandmacros.The headerfile isin the directory"driverlib"of the CCS software.The driversprovideguidedcontrol of the peripheralsand allowsforquickapplication.Enablingperipheralsisanexampleof thiscontrol. #include "driverlib/gpio.h"
  • 3. Thisline containsthe headerfile forGPIOAPIdefinitionsandmacros.The headerfile isinthe directory "driverlib"of the CCSsoftware.The driverprovidesasetof functionstocontrol the inputand output module. int main(void){ The main processcalls andacts on variables,macros,definitions,andothersystemfunctions. uint8_t pin_data=2; An unsigned 8-bitintegervariable isinitializedto2 uint32_t delay_count=2.66e7; An unsigned 32-bitvariable isinitialized to2.66e7 SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); SystemControl ClockSet setsthe clockingof the device. Osc_Mainconfiguresthe oscillatorsource. XTAL_16MHZ usesa 16 MHZ crystal clock. USE_PLL is a phase lockedloopat 400 MHz. SYSDIV_5divides the clock bythe numberspecifiedgivingcontrol of the frequency SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); Enablesthe peripheral forthe general purpose input/outputportF GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); Thisline configurespinsforuse asGPIOoutputs.The firstparameteristhe base addressof the GPIO port. Inthisapplicationthatwouldbe portF. The nextparameteristhe bit-packedrepresentationof the pins. Thisfunctionprovidesproperconfigurationof the pinswithoutprogramming registers.Type of outputwill be the three onboardLEDs that use portF. while(1) { The while loopprovidesa continuousloop whensetto"1". GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, pin_data); Thisline writesavalue tothe specifiedpins. The valueiscontainedinthe variable"pin_data".The initial state of "pin-data"is2. Therefore,the value2is giventoall of the pins.Yet,onlyone of the pinswill correspondtothe givenvalue due toa pre-setconditionof 2mA,4mA,and 8mA. SysCtlDelay(delay_count); Thisline providesadelay.The variable "delay_count"holdsthe value of the delayloop. The constantis 2.66e7. The loopiterates3 times. GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);
  • 4. Thisline writes avalue tothe specifiedpins. Therefore,the value0is giventoall of the pins. This essentiallyclearsthe LEDsof all "high"input.NoLED action. SysCtlDelay(delay_count); Thisline providesadelay.The variable "delay_count"holdsthe value of the delayloop.The constantis 2.66e7. The loopiterates3 times. if(pin_data == 8) The "if"statementischeckingif the current value of the pinvariable isequal to8. pin_data = 2; The value of the pinvariable issetto2. else The "else"statementisusedwhenthe currentvalue of the pinvariable isnotequal to8. pin_data = pin_data*2; The value of the pinvariable ismultipliedby2. Problem 3 The EK-TM4C123GXL LED clock rates are increasedwhenthe numberof systemdivisionsare decreased. SysCtlClockSet(SYSCTL_SYSDIV_10|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); 20 MHz SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); 40 MHz SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); 50 MHz SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); 80 MHz Next,the valuesof the variable "delay_count"weredeterminedfor1secondaccordingto the rise in frequency. The desiredfrequencywasdividedby3 cpu cyclesto determinethe time delayinterval neededinthe systemvariable"delay_count". uint32_t delay_count=0.66e7; // For about 1s delay at 20 MHz clock rate. 20MHZ/3 = 0.67e7 uint32_t delay_count=1.33e7; // For about 1s delay at 40 MHz clock rate. 40MHZ/3 = 1.33e7
  • 5. uint32_t delay_count=1.66e7; // For about 1s delay at 50 MHz clock rate. 50MHZ/3 = 1.67e7 uint32_t delay_count=2.66e7; // For about 1s delay at 80 MHz clock rate. 80MHZ/3 = 2.67e7 Finally,the variable"delay_count"waschangedtothe resultsabove.The resultof the LED displayis 1 seconddelay. Problem 4 An Introductiontothe TivaC SeriesPlatformof Microcontrollerswasanoverview of TI'snextgeneration of ARM Cortex M4 processors.The reportonthe new microprocessorsboastedof the new 32-bit architecture andhighprecision.The serieshasalarge instructionset andbetterresolutionforcapturing samplesof analogsignalsandconvertingthemtodigital.Multi-taskingandreal-time applicationhas greatlyimproved.Also,the durabilityhasimprovedalongwithlow energyconsumption. TivaWare Peripheral DriverLibraryisa setof driversthatmake the TIVA C Serieseasiertoprogram.They are writteninCfor the most part and efficient.There are multiplesoftwarepackagesthatare available to use all the driversare mappedout fordirectregisteraccess.The driverlibrarycanbe usedalongwith directregisteraccessformore efficientprogramming.The generalpurpose input/outputmodule has8 pinsthat can be configuredasan inputor an outputwithdifferentcapabilities.Also,more thanone pin can be operatedonat one time.The systemcontrol givesmore flexibilitywithabilitiestochange frequency,timing,clock-type,energyuse,andthree differentoperatingmodes. The TM4C123GH6PM MicrocontrollerOverview givesdetailedinformationaboutthe Core, Performance,Flash,SystemSRAM,EEPROM,Internal ROM,Security,CommunicationInterfaces,System Integration,AdvancedMotionControl,AnalogSupport,andhardware layout. The three LEDs are connectedthroughportF of the GPIO module.The schematicshowsthe three LEDs have diodescontrollingthe input.The diodesturnonfor the gatesthat correspondto2, 4, and 8. This referstothe mA that activateseachLED. If itdoesnot containthe right amountof mA the transistoris not activated. Eachiterationof the loopsends a "0" or "off" to all the gatesbefore the new loop iterationiscalculated. Summary and Conclusion The Tiva C SeriesTM4C123G MicrocontrollerwasattachedbyUSB to the CPU and there were notany problemswithpowering onorcompatibilitywithWindows7.CCS wasveryuserfriendlyandoffered differenthardware implementation.The programswere builtwithouterrorandran accordingto plan. CCS programsusedsoftware driverstomapmostof the hardware and applications. References TexasInstruments.(2014).TivaWarePeripheral Driver Library: User'sGuide. Austin,Texas:TI.