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.

TM4C123gh6pm launcpad query

Genius 3300 points

1. Function SysCtlClockSet(), do not return error flag i.e if successful or not?
What if it failed? Is there any method to check. Currently I am doing like this:

uint32_t freq;
SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ );
freq = SysCtlClockGet();

if(freq != 80000000)
{
/* error */
}


2. On startup, I keep all unsued pin as input pull up to avoid any random signal or current consumption.
Port A to D are full 8 bit. but PE6-7 & PF5-7 are not physically present on 64 pin IC.
Should I also make these pins as input-pull up or they are not in the device at all internally also?

3. What is purpose of giving different drive strngth of GPIO, i.e 2, 4 or 8ma.
What if on 2mA setting a led is connected which tries to consume higher current? Will only 2mA current flows through it?

4. GPIOPinRead function , returns in32_t type. That's not an issue.
I think better would be if it is done uint32_t.

I was oding like:
uint32_t val = GPIOPinRead(...);

& warning comes impilict conversion from int32_t to uint32_t.
Although explicit typecast be done to remove this.

  • Hello Vindhyachal,

    1. SysCtlClockSet does not return anything. On exit of the function, you may use SysCtlClockGet to see the set frequency of the system
    2. All Pins default to input. I would suggest using an external Pull Down so that during power up an unknown state on the IO can be avoided.
    3. Please read the description of Drive Strength. That is the minimum value of Driver
    4. Suggestion welcomed: But since the equivalent ROM function cannot be changed the same shall continue for the time being.

    Regards
    Amit
  • Hi Amit,

    1. i had done line this.
    2. How about only placing external pull-up or down on Jtag & reset pins only. & when MCU power up, make all unused pins as input pull down.
    Otherwise it will add to BOM to place resistors on all unused pins depending upon their number.
    3. Datasheet says:"IO specifications reflect the maximum current where the corresponding output voltage meets the VOH/VOL thresholds. IO
    current can exceed these limits".
    Means if I set drive stregnth 2mA & try to sink/source more current from it, then VOH/VOL thresholds are not guranteed , right?
    4. Ok
  • Hello Vindhyachal,

    1. So did it work or not?
    2. You need Pull Up on JTAG and Reset pin. Putting a Pull Down on the reset pin will keep the device under reset. That is your design call on what to do with unused pins. Note that TM4C123 has a IO latch up issue for which an external pull down is recommended
    3. Yes, that is correct.

    Regards
    Amit
  • Hi Amit,

    1. Yes it had worked fine.
    2. I was reading SPMZ849E, & reading page 25 onwards. No such issue is mentioned.
    Will pin latch can cause MCU not to start. Because as soon as MCU start I will make them input pull down.
    But if it is still recommended to have external pull down resistor , what should be its value, keeping in mind for low power consumption.