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.

TM4C speed operation?

Other Parts Discussed in Thread: TM4C123GH6PM, TM4C1294NCPDT

Hi everyone!

I have a strange doubt that I can't understand. I configured my TM4C123GH6PM from my Launchpad with the maximum clock frequency of 80MHz. Why did I obtain a signal output of 1MHz and 2 MHz respectively with only the next code? What is it happen me with the time? With my TM4C1294NCPDT from the Connected Launchpad with the maximum clock frecuency of 120MHz happens the same. 

CODE which output is square signal of 1MHz:

while(1)

{

GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_6, GPIO_PIN_6);

//SysCtlDelay(1);

GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_6, 0x00);

//SysCtlDelay(1);

}

CODE which output is square signal of 2MHz:

while(1)

{

HWREG(0x40007100) = 0x40;

//SysCtlDelay(1);

HWREG(0x40007100) = 0x00;

//SysCtlDelay(1);

}

I expect a square signal with either 20MHz or 40MHz.

Someone know what is it the problem?

Thanks in advance!

  • Hello Salvador,

    What is the Clock API being used for TM4C123 and TM4C129 to configure the System Clock Frequency and the parameters being parsed to the API?

    Regards
    Amit
  • Hello Amit. Thanks for your quickly reply.

    This is the code for TM4C123:

    SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

    GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_6);

    GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_6, 0x00);

    And this is the code for TM41294:

    uint32_t     ui32ClockFreq;

    ui32ClockFreq = SysCtlClockFreqSet((SYSCTL_CFG_VCO_480 | SYSCTL_USE_PLL | SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN), 120000000);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

    GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_6);

    GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_6, 0x00);

    If I start debug mode, "ui32ClockFreq" variable value is 120 000 000. That seems good.

  • Hello Salvador,

    The code is perfectly fine. And the 1MHz/2MHz toggle rate is not possible with the settings mentioned. Did you check the sampling setting on the scope or LA. I can try to check on my side but I am 101% sure that it is way more than 1/2MHz.

    Regards
    Amit
  • Hello Amit. You right. I gain a little more frequency. I wrote without checking the right numbers. I have just repeated  the experiment and this is the results.

    TM4C123GXL:

    Using GPIOPinWrite with SysCtlDelay(1):  1.330 MHz

    Using GPIOPinWrite without Delay:            2.347 MHz

    Using HWREG with SysCtlDelay(1):            2.222 MHz

    Using HWREG without Delay:                      5.650 MHz

    But with HWREG without delay I expected more frequency. I would like to do a RGB TFT driver with 24-bit color but if the most quick toggle frequency is this I think I won't be able to do it working with the typical 9MHz which screen needs.

    What do you think about it?

    I attach some pictures with the oscilloscope results. I apology because the signals aren't perfectly square because my probes have capacitive effect.

     

  • Hi Salvador,

    See if this can help you out:


    Why not use a LCD already with a SPI interface? SPI speeds of 10Mhz are very easy to use on the any of the Tivas.
    The TM4C1294 has a LCD driver, would it not be enough?
    If you really need to use the GPIO why not use the DMA? I believe that speeds of up to 10Mhz on the TM4C123 are possible (I remember that it can take 4 to 8 cycles to perform a DMA transfer)

  • Salvador Ballesteros said:
    like to do a RGB TFT driver with 24-bit color but if the most quick toggle frequency is this I think I won't be able to do it working with the typical 9MHz which screen needs.

    You seize upon GPIO toggle frequency - but is that not (just) the "tip of the iceberg?"   Along w/those 9MHz (likely 4.3" 480x272, TFT) clocks - you'll need to read & present that 24 bit pixel data - will you not?

    Unmentioned - perhaps not fully considered - is "How & where" you'll store (and load) your screen data.   That memory space surely exceeds that w/in the MCU.

    TFT Control ICs are marketed which "do" effectively answer these (and other) TFT & memory access considerations.   Wanting to employ the MCU as "kitchen sink" may (greatly) tap into its resources - and (still) not meet the performance of a low-grade cell or tablet!

    Vendor's 129x series attempts to "approach" this issue w/external memory and wide bus outputs.   That said - comparison of 129's "results" may not fare well when measured against cells/tablets - which employ far more powerful MCU...

  • Luis Afonso said:
    Why not use a LCD already with a SPI interface? SPI speeds of 10Mhz are very easy to use on the any of the Tivas.
    The TM4C1294 has a LCD driver, would it not be enough?

     Hi Luis, using a "SPI" RGB display so called LVDI serial require a clock more faster than it can be obtained on SPI port of 123 series and 129 too.

     Anyway primary post was stating about an RGB parallel LCD; as CB1 pointed to, this device require a parallel feed of 24 bit@ rate variable from about 5 to somee tens of Mega Hertz, this case can just be addressed by 129 series thru EPI but it lose additional ram required to store raster image. Again 129 has an LCD controller on board can better solve dirving LCD, this controller is great but lack of suitable chip carrier discouraged me from usage due to high cost of ultra fine line pcb.

     So final solution was VHDL on FPGA, here detail of test bed on a cheap few US$ maxV 240 and evaluation of TM4c129 in front of 256 1mm spaced FPGA casing. 100uM lines are not a trouble but cost is not affordable other than reliability of this on a mechanical machinery.

    and here is the comparison of 256 balls  1mm spaced fpga with 212 balls ultra thin tm4c129, this was the worst past issue, now I got a workhorse where all code and IPcore are on same chip.

  • Hello Salvador,

    With the following code

    int
    main(void)
    {
    //
    // Set the system clock to run at 80MHz from the PLL.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
    SYSCTL_XTAL_16MHZ);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    MAP_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
    MAP_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, 0x0);
    while(1)
    {
    HWREG(0x40025008) = 0x2;
    HWREG(0x40025008) = 0x0;
    }
    }

    I am getting 13.33MHz on the scope. Based on the placment of the code and considering the prefetch mechanism on TM4C123, it can go upto 20MHz.

    Now since the requirement is to drive a parallel LCD port, TM4C129 would be a better replacement due to increased RAM (ability to interface more in form of SDRAM) and a dedicated LCD controller.

    Regards
    Amit
  • Amit Ashara said:

    Now since the requirement is to drive a parallel LCD port, TM4C129 would be a better replacement due to increased RAM (ability to interface more in form of SDRAM) and a dedicated LCD controller.

     Hi Amit, just a question, I seen no plan for new device, why not release new part just differently cased? example for 129 with LCD or not TQFP144 176 or 208 @500um pitch?

     These case are best handled in prototypes and don't require an expensive pcb technology. Also 50Ohm impedance is best matched than on actual fine pitch tqfp 128.

     This is just a curiosity.

     

  • Hello Robert,

    The number of usable IO's on the 128 pin package for TM4C129 will reduce once LCD and EPI are brought together. A 144 pin package makes a lot of sense but as of now there are no plans to do a 144 pin bond out.

    Regards
    Amit
  • Thanks to all of you.

    I was thinking use an external SD memory as a main memory for the raster image and I'd like to create my own TFT driver for 4.3'' 480x272 TFT with uDMA with either the tm4c123 Launchpad or the tm4c1294 Connected Launchpad. Like some of you said, the TM4C129x has an LCD controller inside of it, but the TM4C1294GXL (Connected Launchpad) doesn't have any LCD controller inside, so I'd like to do a dedicate LCD controller with it.

    So do you think that it isn't possible with them (tm4c123 and tm4c1294)?

  • Hello Salvador,

    Please check the DK-TM4C123G which uses a smaller OLED display or the Kentec Booster Pack for SPI based display (320x240).

    Regards
    Amit
  • Should you consider SPI - do perform a careful calculation to determine the time to perform a "CLS."   (Clear screen) 

    Unfortunately cell phones & tablets (now) set the standard against which your development will be compared.   And as each employ far faster - more display focused MCU - your results may be seen as, "lacking."

    As always much depends upon your application - and that's (yet) to be described.   That said - if (reasonable) screen draws & clears are required - "culling yourself" so far from the (existing) cell/tablet "herd" may not prove entirely wise...

  • Hello cb1,

    Indeed. DSI port has been very successful in the tablet/phone business with high speed LVDS and 3 pair of interface line doing multi panel

    Regards
    Amit
  • Agreed Amit.   Users would do well to, "Test for Reality" prior to committing: time, effort, funds to a (desired) new MCU-based project.  Similarly cars, small planes - used for commuting - cannot expect to fare well when moved to the race-track or "air to air" combat!  (methinks so basic a point is too often missed - here!)

    Imagination and desire have their place - yet reality may intrude with a "heaviness" - especially so when it's impact has not received full/proper consideration...

  • Or buy a module that already implements the screen drawing primitives that you send to it.

    Probably can't do video but is likely a faster graphic engine than send bits over a relatively slow interface.

    Robert

    And don't forget laptops, PCs, tablets and 'real' HMIs. Evaluate if you really need a built in highly functional display.
  • Robert Adsett said:
    Or buy a module that already implements the screen drawing primitives that you send

    Mais oui mon ami - c'est tres bien!   Such enables a lower grade MCU to (almost) play w/the Big Boyz!

    Your later point - "Is a highly functional display needed" also deserves note.  Recall that in the past - Steve Jobs (almost exclusively) thought that users would enjoy video on a "small screen!"   And he proved "so right!"   (and this reporter - in the display biz - so wrong.)

    That said - thanks to small yet capable displays - the "Walkman" (Sony) was effectively (and brutally) displaced by the "display equipped" iPod (Apple).   (the small Samsung hard drive - also - "may" have helped...)  (for sure - it did!)

    When my past firm pioneered small Lcd modules - smart, fellow biz travelers asked, "Who'd need them?"   Today - better question - who does not?

  • Hello Robert,

    Enlighten us as it does sound interesting (now I am being "give me a code")

    Regards
    Amit
  • Hi Amit,

    Re: Give me the code!

    We'd say that this (one) - out of your 10,11x post total - (may) be overlooked... (so long as this is not your "homework" assignment - or that you do not state your MCU, "Does NOT Work!"...)   We do understand that - as always - need is URGENT!

  • The most sophisticated one I've seen and the ones I remember are from Amulet technologies

    www.amulettechnologies.com/index.php

    They sell kits, modules and even ICs that you can hook up your own panel to. Nearly an HMI. I looked into these a while back but didn't end up with the need for a display. For small quantities at least the modules are cheaper than development costs. Not sure at what point rolling your own becomes cheaper than the chip set.

    FTDI does something as well and I remember coming across modules that had a set of primitives for controlling the screen. Basically draw text, draw lines, draw shapes, draw points etc... Might have been an OLED display.

    Robert