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.

Nanosecond-width pulse generator with Tiva TM4C123G

Other Parts Discussed in Thread: MSP430G2553

Hi forum!

Im new in programming TI launchpads, and I was wondering if I can make a nanosecond-width pulse generator with this device.

I know that for the Stellaris it can be done, so I assume that with Tiva it's also possible. The problem it's that I already have this Launchpad but I know nothing about programming it; I only find codes for Stellaris, and in a low order width.
If someone could help me with codes or tutorials I would appreciate it.

Thanks in advance!

  • My belief - such "nanosecond-width" pulse generators are normally the province of FPGAs or CPLDs - or custom devices designed/groomed especially for such purposes.  Use of an example may prove helpful...

    If we assume that your MCU can support a System Clock of up to 80MHz - and if one of the MCU's Timers may be clocked at that 80MHz rate - and if that same Timer - set-up/config'ed w/in PWM Mode - then "yes" - a sub microsecond output may be achieved.  I don't believe that you will achieve much generator, "window/room" below 100nS - though.

    With low duty PWM Settings - I suspect 100nS should be achievable - perhaps even half of that width - if many things, "break your way."  But beware - those narrow pulse widths subject your desire to layout and signal transmission concerns.  Even if the MCU can produce so short an output - the remainder of the signal propagation path - and termination - must be well anticipated-chosen-managed!

    In summary - the MCU (from this maker & others) would seem better suited for micro-second thru seconds pulse generation.  My belief is that surely the Timer is the way to go - and that the Timer w/in PWM Mode is the only means for most of these MCUs to "escape" the timer signal to the actual timer pin - for output to the outside world.

    You may further consider "beefing up" that Timer output pin - if that is indeed possible.  (clearly a gpio pin may be ordered to higher output current - but I'm uncertain if a pin configured as Timer - then placed w/in PWM mode - may maintain that higher output current...)

    And - it may be that the Timer's ability to produce such short duration signal is aided by forcing the containing MCU Port to be the, "high performance bus."  (i.e. if you choose a timer w/in Port X - Port X should be first configured to its "fast bus" incarnation)  This may or may not prove beneficial - but deserves (I feel) mention...

    Experimentation is a good (and memorable) teacher. (and so your feedback as "reward" for your helpers)

    Of course a neat Lcd/Oled and keypad, "jump to mind" as essential, "co-conspirators" in such a project.

  • Fernando Hinojosa said:
    I know that for the Stellaris it can be done, so I assume that with Tiva it's also possible.

     Please can you explain what is your need? Nanosecond, how many or what is resolution? 1nS require clock in the order of 1GHz or more, I don't know TIVA nor Stellaris can run so high clock.

     Are you sure the application you mention is not C2000 series based? There you can get these resolution or better.

  • Any such ~1nS output is likely to "only result" when running, downhill...

  • We may wish to "keep in mind" the fact that "massaging" single digit nanosecond resolution from a standard MCU - without proper power supply, tight temperature control, and special, precision, frequency generation components - is unlikely.  Usually such generators boast "oven controlled - exhaustively designed/tweaked frequency sources" - not the "usual" province of a standard (even high frequency) MCU.

    Unstated - the cost and availability of the special equipment (surely required) to perform the necessary calibration and on-going "test/verify" of such a Pulse Generator system.

    This reporter stands by earlier assertion that such design - based upon MCUs here (or next level up) - may be capable of 100's of nanoseconds at best...  As started above - many other considerations must be recognized/attended...

  • Hello All,

    This is interesting indeed. single ns resolution is something none of the peripherals are either designed for. We may want to know as well on the solution that existed on Stellaris, if the poster may be kind enough to send links/codes?

    Regards

    Amit

  • Thanks for your comments, they´re very helpful.

    I realize that for the application that I want, none of this devices works. I need to measure the S parameters of a impedance matching school proyect. The original intention was to create a nanosecond avalanche pulse generator, so that the risetime become faster (ps). Something like the page 14 of this document:

    http://www.home.agilent.com/upload/cmc_upload/All/TDR_S-Parameters_Differential_Meas-0906.pdf?&cc=MX&lc=eng

    But I need to put a BNC 50Ω connector, something that I think its not possible in a launchpad...

    As I mentioned, I know nothing about TI Launchpads, but the "equivalent" code that I want for Tiva was something like this:

    #include <msp430g2553.h>

    void main(void)

    {

    WDTCTL = WDTPW + WDTHOLD; // Stop WDT

    P1DIR |= 0x21; // P1.1 output

    P1SEL |= 0x20; // P1.1 option select

    TA0CCTL0 = OUTMOD_4 + CCIE;

    TA0CCR0 = 5000;

    TA0CTL = TASSEL_2 + ID_3 + MC_2;

    __bis_SR_register(CPUOFF+ GIE); // CPU off

    }

    # pragma vector= TIMER0_A0_VECTOR

    __interrupt void TIMER0_A0_ISR(void)

    {

    P1OUT ^= 0X01;

    TA0CCR0 = TA0CCR0 + 5000;

    }

    I also read that for Arduino UNO it's actually possible to create a nanosecond pulse generator (5th comment):

    http://forum.arduino.cc/index.php?topic=209994.0

    I think I'll have to wire some circuits, in fact, my original intention was to avoid welding components >-<

  • Fernando Hinojosa said:
    read that for Arduino UNO it's actually possible to create a nanosecond pulse generator

    Mon ami - it's the internet - anyone can say/do anything! 

    If the quote above proves true - appears the 30+ serious, power-house, licensees of ARM Holdings have made a grave mistake - should have vectored instead to Arduino!  (all hale the AVR)

    I'd love to see the justification - technical support - which "proves" such claim.  Especially like to see it, "peer-reviewed" - of course that's not likely - anytime soon - as claim is w/out merit.

    Agilent is big league - very likely has temperature controlled, uber-precise frequency generation components - doubtful we'll see them (anytime soon) replacing their existing design w/Arduino...

    Arduino does serve some limited, introductory, pre-assembled (likely) training purpose.  But w/ ARM M0 boards available @ sub 8 USD (Q1) - as the illustrious/ex Sec'ty of State gratingly proclaims - "What is the point?"

  • Fernando Hinojosa said:

    I also read that for Arduino UNO it's actually possible to create a nanosecond pulse generator (5th comment):

    http://forum.arduino.cc/index.php?topic=209994.0

    I think I'll have to wire some circuits, in fact, my original intention was to avoid welding components >-<

     Arduino creator do some BLA BLA BLA.. the one presenting to my pupils stated someone wrote a program to do FFT on that platform then present it to a TV set as video...

     Ehm.. It was a bank of filter not FFT and video yes it generate video like many old pc like the ZX80 was doing in the past but nothing usable... So my student got fooled by, FFT where not possible at all, on try implement reduced resolution we got a lot of troubles, FFT was impossible even at worst resolutio and I never wish ear about arduino is doing all and better.....

     About

    Fernando Hinojosa said:

    #include <msp430g2553.h>

    void main(void)

     This code is mainly not TIVA but MSP430, it set some way timer to generate an hardware event and respond to interrupt toggling a bit in a port.. This processor has a max clock of 16MHz and cannot generate nanosecond pulses...

     

    Fernando Hinojosa said:

    Thanks for your comments, they´re very helpful.

    I realize that for the application that I want, none of this devices works. I need to measure the S parameters of a impedance matching school proyect. The original intention was to create a nanosecond avalanche pulse generator, so that the risetime become faster (ps). Something like the page 14 of this document:

    http://www.home.agilent.com/upload/cmc_upload/All/TDR_S-Parameters_Differential_Meas-0906.pdf?&cc=MX&lc=eng

     Avalanche pulse generator, now i see what is on page can be a good way to obtain a very narrow pulse, in case junction is well ionized can be as narrow in the fS range but nothing to do with processors or launchpad, structure cannot confine rf energy nor respond to how a similar pulse get constructed.

     Ok I seen the analyzer from Agilent, what are you thinking to do? Are you owning one?

     I fear this project can be more and more far from your understanding of problem where behind the lines.. Also strip lines too ;)

     Again S parameters of what what frequency resoultion and more... You must measure pS or fS delay , propagation and other thing... May be some knowledge of high speed and fpga are necessary to solve at almost part of this task.. not a simple school project..

  • cb1_mobile said:

    Agilent is big league - very likely has temperature controlled, uber-precise frequency generation components - doubtful we'll see them (anytime soon) replacing their existing design w/Arduino...

     Expecially if pS or Fs has to be measured.... <<Arduino do the best... And never have the processing power nor EMF resilience a Launchpad has....>>

     My SMA from old "sharp avalanche pulse generator" is soldered on metal case where it is built in many time ago, I never think use a BNC to do that, better an SMB or SMC but never a big connector like BNC..

     The blade is at you...

  • Roberto Romano said:
    The blade is at you...

    If you don't instantly recognize - look up, "hoist by your own petard!"

    Your, "Arduino do the best" some way/how escapes comprehension...

  • cb1_mobile said:
    Your, "Arduino do the best" some way/how escapes comprehension...

      Are not my word.. I heard from religious people say Arduino is better.. or Windows is better than Linux.. forever why?

     Simple.. they say also:

     we like have all done by others....

  • Fernando Hinojosa said:

    I also read that for Arduino UNO it's actually possible to create a nanosecond pulse generator (5th comment):

    http://forum.arduino.cc/index.php?topic=209994.0

    I think I'll have to wire some circuits, in fact, my original intention was to avoid welding components >-

      Poor laser diode!

     Learn read all word letter and NUMBER too.. 62.5 nanosecond...

     They where fooled can do a single clock cycle pulse.. no no and NO the best pulse may be in the range of n*62.5nS with n>=3 and ... how many time is required to charge gate capacitance from a uC pin than using a driver with some amp peak current

  • cb1- said:
    I don't believe that you will achieve much generator, "window/room" below 100nS - though.

    And arrives now from friend, Roberto, "best pulse may be in the range of n*62.5nS with n>=3"

    Let the record show - very first post in answer to op (long ago) is (now) seconded by guru, Roberto... 

    Unrealistic user expectations running rampant - cascading - taking over this (heretofore) pristine ARM Space..   Rarely (and barely) discouraged by forum guards - left to unkempt outsiders to properly, "police."  (to the forum's clear benefit - otherwise 100 post threads detail (repeatedly) how to set/clear a gpio...)

    Along those lines - too many posts here escape reality - posters' "saw, heard, or dreamed" that everything could be done via Arduino!  Real world teaches, "not so fast" - and/or "not to spec."

    Indeed "reality does - more often than not - "bite.""

  • cb1_mobile said:
    Indeed "reality does - more often than not - "bite.""

     After reading what was on referred arduino forum... Can I use my FemtoSecond pulse generator to Arduino so better hardware than build a metal dedicated case or buy a so expensive Agilent instrument???... Uhm.. My logic analyzer from Agilent is no more able to measure under 100pS nor sampling scope cannot resolute less than few hundred femtosecond too, I need ask also them why Arduino for few dollar can do what is not possible from a so EXPENSIVE instruments, just like when I proposed a 32bit processor to do FFT someone (Arduino internal) said but this do that and also display on tv... I assure my ex student was more and more clever than presentor and FFT was yourself done on multithreaded on Linux .... CB1 we are on a nightmare, a bad dream or this is real dumbness?

  • Roberto Romano said:
    CB1 we are on a nightmare, a bad dream...

    Might you, Sir - be a bit harsh in your, "lack of faith?"

    Suspect that the combination of forces - nanosecond pulse gen. AND 24 bit ADC (on a breadboard - w/out doubt) all under the exacting command of discounted Arduino - is sure to cause great/grave concern @ Agilent - other skilled/practiced others.  If the internet hints/claims it can be done - then it must be so...

    Enough mon ami - je suis departer - a quelle heure...

  • cb1_mobile said:
    If the internet hints/claims it can be done - then it must be so...

     So (don't laugh.. don't laugh.. don't......)

     Sorry I was a cough about recent meal... I was saying, all is said also with some some idea of fraught can be done...

     So can I post this on InstaSpin area to show just a simple capacitor can spin a motor and also produce enough free energy to light up an incandescent lamp?

     I am hiring paying partner to collect funds to construct a similar generator instead of actual.

     See yourself

    http://www.youtube.com/watch?v=XDnMODCdhB0

     Spam, lessening of knowledge and everything seen on internet or TV is forever true!!

     First phishing spam was received from Compuserve, I still remember I asked myself what is asking for that guy and why to me I was not knowing at all.

     Amit, I promise this is last one.. But please help ask your boss clean forum! Otherwise use that example to show where we can risk land on with a lot of alien biting all us.

     And now please let me :D :D :D So sorry sometimes this is necessary...

     Remember Proteus generation movie?