This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
#include<stdint.h>
#include <stdio.h>
#include "inc/tm4c129encpdt.h"
void delay(int value);
int main(void)
{
SYSCTL_RCGCGPIO_R |=(1<<0);
GPIO_PORTA_AHB_DIR_R &=(1<<6);
GPIO_PORTA_AHB_AFSEL_R &=(0<<6);
//GPIO_PORTA_AHB_PC_R |=(1<<0);
//GPIO_PORTA_AHB_DR4R_R |=(0<<0);
//GPIO_PORTA_AHB_DR8R_R |=(1<<0);
//GPIO_PORTA_AHB_ODR_R |=(1<<0);
//GPIO_PORTA_AHB_DEN_R |=(1<<0);
while(1)
{
GPIO_PORTA_AHB_DATA_R &=(1<<6);
delay(30000);
GPIO_PORTA_AHB_DATA_R &=~(1<<6);
delay(30000);
}
return 0;
}
void delay(int value)
{
int i,j;
for(j=0;j<1000;j++)
for(i=0;i<value;i++);
}
When the code is run then port A pin 6 are not toggle. What is my problem. Please some help me..
Hi,
Your "treatment" of both DEN & DIR appears incorrect. (DEN is commented out) Try:
SYSCTL_RCGCGPIO_R |=(1<<0);
GPIO_PORTA_AHB_AFSEL_R &=(0<<6);
GPIO_PORTA_AHB_DIR_R |=(1<<6);
GPIO_PORTA_AHB_DEN_R |=(1<<6);
Note too that your while loop will never "turn on"
imtiaj hossain said:while(1)
{
GPIO_PORTA_AHB_DATA_R &=(1<<6);
You intended: GPIO_PORTA_AHB_DATA_R |=(1<<6); which should work once your PORT_A set-up is corrected...
CB1,
Thank you!
Imtialj Hossain,
We discourage the use of direct register writes like you have done in the code above, especially for new users. Please take a look at the TivaWare library functions and examples. Using proven library functions will decrease your coding errors and help you to come up to speed on the TM4C family more quickly. It will also make it easier for the rest of us on this forum help you.
Thanks. I solved the problem like that --
#include<stdint.h>
#include <stdio.h>
#include "inc/tm4c129encpdt.h"
void delay(int value);
int main(void)
{
SYSCTL_RCGCGPIO_R |=(1<<0);
GPIO_PORTA_AHB_DIR_R |=(1<<6);
GPIO_PORTA_AHB_DEN_R |=(1<<6);
GPIO_PORTA_AHB_AFSEL_R &=~(1<<6);
while(1)
{
GPIO_PORTA_AHB_DATA_R |=(1<<6);
delay(3000000);
GPIO_PORTA_AHB_DATA_R &=~(1<<6);
delay(3000000);
}
return 0;
}
void delay(int value)
{
int i,j;
//for(j=0;j<1000;j++)
for(i=0;i<value;i++);
}
Thank you - it is normal & customary to click the "Verified" button which appears at the bottom of the post which "Solved your issue." (i.e. not your own post.)
Do note as the vendor agent advised that your use of the API will, "Speed, Ease & Enhance" your programming efforts. You can find hundreds of programming examples - and a highly detailed "Peripheral Driver User Guide" is additionally included.
As you've just proved - your use of the alternative "Direct Register" method (can) succeed - yet the degree of effort is far higher - the solution takes longer - & it is (very) easy to produce code errors!
How can i add / import library for direct register programming in a ccs project ??
Please tell me. It's my first time to use
To add a library to the search path of the linker for your project, right click on the project name in the Code Composer "Project Explorer" window. Then select "Show Build Settings...". A dialog box will open. Expand the selection tree "CCS Build" -> "ARM Linker" -> "File Search Path". Your dialog box should now look like the one below. You can use the "+" button highlighted in the image to add an new library to your project.
Dear Bob Sir,
Hope you are fine .I use TM4C129EXL launchpad board.I install SW-EK-TM4C129EXL-2.1.4.178 software. I want to a boot loader programming.How can I do?
Please help me.
Thanks
imtiaj
There is information on different types of bootloaders in your TivaWare directory:
C:\ti\TivaWare_C_Series-2.1.4.178\docs\SW-TM4C-BOOTLDR-UG-2.1.4.178.pdf
You need to determine if you can use one of the existing built-in ROM bootloaders, or if you need a flash based bootloader.
Before I can give you and example, you need to tell me how you plan to send the new code to the TM4C device. Using UART, USB, CAN, SPI or Ethernet?
Dear Bob Sir,
Hope you are fine. Allah blase you long and healthy life.I can't understand how can i start for a boot loader program. You know, I am a fresher. I will disturb you at that time. You can handle me as a teacher. So please please help me.
Thanks
Imtiaj
OK, let us start with the most simple bootloader, the serial boot loader. Have you downloaded the TivaWare library? Are you using Code Composer Studio? If so, Can you open Code Composer Studio? Have you been able to import projects like blinky and program it into your EK-TM4C129EXL?
C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c129exl\blinky
If you can do these steps, then import the project boot_serial from the same TivaWare examples. Use CCS to program this project into your EK-TM4C129EXL launchpad. Then read the file: C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c129exl\boot_demo1\readme.txt
You can then use LMFlashProgrammer connecting your PC serial com port to UART0 on the TM4C129 device and program in the new project:
C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c129exl\boot_demo1\ccs\Debug\boot_demo.bin