Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h>

ID: 2085742 • Letter: #

Question

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>

#include "TM4C123GH6PM.h"
void DelayMs(int s);

int main(void)
{
    // GPIO Configuration


    // 1. Enable Clock on Port F (SYSCTL_RCGCGPIO)

    // allow time for clock to stabilize (SYSCTL_PRGPIO)

    // 2. Unlock GIOD[7] and GPIOF[0] on TM4C123G (GPIOn->LOCK and GPIOn->CR)


    // 3. Clear AMSEL to disable analog

    // 4. Config PCTL to select GPIO

    // 5. Set DIR to 0 for input, 1 for output
      // PF3,PF2,PF1 for Output
    // 6. Clear AFSEL bits to 0 to select regular I/O

    // 7. Set PUR bits to 1 to enable internal pull-up resistor

    // 8. Set DEN bits to 1 to enable data pins
     // Enable all digital pins on PortF (PF3,PF2,PF1,PF0)

    while(1){
        if ( GPIOF->DATA & ){
            GPIOF->DATA =   ;
            DelayMs( );
            GPIOF->DATA = ;
            DelayMs( );
            GPIOF->DATA =   ;
            DelayMs(   );
        } else {
            GPIOF->DATA = ;
            DelayMs( );
            GPIOF->DATA = ;
            DelayMs( );
        }
    }
}

void DelayMs(int s)
{
    volatile int i, j;
    for (i = 0; i < s; i++)
        for (j = 0; j < 3180; j++)
            {};
}

need help for the keil C code, plz. I dont know hwo to do it.

4C123G LaunchPad The TM4C123GXL LaunchPad comes with an RGB LED and two user buttons. Table 1 shows how these features are connected to the pins on the microcontroller EK-TM4C123GXL LaunchPad TM4C123GHGPM PA1 PAR PB1 PDS PD4 Serial PF4 PF3 PF2 PF1 PF0 USB PO1 ePB7 Table 1: User Switches and RGB LED Signals GPIO Pin Pin Function PF4 PFO PF1 PF2 PF3 GPIO GPIO GPIO GPIO GPIO User Device SW1 SW2 RGB LED (Red) RGB LED (Blue) RGB LED (Green) In your assembly code, you need to initialize GPIO Port F pin 0 and pin 4 as inputs, Port F pin 1, pin 2 and pin 3 as outputs. Note: The SW1 and SW2 are directly connected with GND. Therefore, these pins are negative logic, you have to configure the internal resistive for these pins Go to top

Explanation / Answer

#include<reg52.h>           // special function register declarations
                            // for the intended 8051 derivative

sbit LED = P2^0;            // Defining LED pin

void Delay(void);           // Function prototype declaration

void main (void)
{
    while(1)                // infinite loop
    {
        LED = 0;            // LED ON
        Delay();
        LED = 1;            // LED OFF
        Delay();
    }
}

void Delay(void)
{
    int j;
    int i;
    for(i=0;i<10;i++)
    {
        for(j=0;j<10000;j++)
        {
        }
    }
}

1. Enter the source code.

2. Save it

3. Then Compile it. Click Project>>Build Target or F7

The hex file will be generated in your Project Folder.

TM4C123GXL needs a oscillator for its clock generation, In this way we ought associate outside oscillator. Two 22pF capacitors need aid used to settle those operation of the gem oscillator. Ea ought to a chance to be strapped with VCC for inner project executions. AT89C51 need no inside control around Reset, Along these lines we must do it remotely through those RST pin utilizing capacitor Furthermore resistor. The point when the energy will be switched ON, voltage over capacitor will a chance to be zero, In this way voltage over resistor will make 5V Also reset happens. Concerning illustration the capacitor charges voltage over the resistor bit by bit lessens should zero.