Forums

short pulse generation with DSK6416

Started by farzinalm May 2, 2019
Hello,

I'm trying to generate short pulses with DSP's 32-bit timer. I'm using the
DSK6416 board (@1GHz) . 
I need to have pulse widths as short as 10ns-50ns and be able to change
the duty-cycle. I try to read the CNT register of the timer and set DATOUT
to be driven on TOUT pin of timer when the proper width has reached. The
problem is that when I use the TIMER_setDatOut API it is not possible to
get 10-50ns pulse widths. The shortest pulse width you can get is 100ns.
As the datasheet for the TMS320C6416T says, the timer is able to output
5ns pulse duration at high state.

Here is my simple code:

#include <stdio.h>
#include <csl.h>
#include <csl_timer.h>


TIMER_Handle hTimer;

TIMER_Config MyConfig = {
                         0x00000300,   //Clock mode, Internal clock source
f_cpu/8, DATOUT is 
                                                                          
              driven on TOUT    DSK runs at 1GHz
                         0x0000003E,   //f=125MHz/(this value) 1MHz
frequency as an example
                         0x00000000
};
 
void main()
 {

CSL_init(); 
TIMER_config(hTimer,&MyConfig);
hTimer = TIMER_open(TIMER_DEV0,0);
TIMER_start(hTimer);

while(1)
 {
 
if(TIMER_getCount(hTimer)<10){
   TIMER_setDatOut(hTimer,1);}
else
{
TIMER_setDatOut(hTimer,0);}

  }
   }

Thank you.


---------------------------------------
Posted through http://www.DSPRelated.com
I don't think you're going to get a good performance doing this in code.
The "5 ns" pulse duration be achieved using the timer hardware. See
section 5 in this document:

  TM320C6000 Peripherals Reference Guide, SPRU582

--Randy

"farzinalm" <135271@DSPRelated> writes:

> Hello, > > I'm trying to generate short pulses with DSP's 32-bit timer. I'm using the > DSK6416 board (@1GHz) . > I need to have pulse widths as short as 10ns-50ns and be able to change > the duty-cycle. I try to read the CNT register of the timer and set DATOUT > to be driven on TOUT pin of timer when the proper width has reached. The > problem is that when I use the TIMER_setDatOut API it is not possible to > get 10-50ns pulse widths. The shortest pulse width you can get is 100ns. > As the datasheet for the TMS320C6416T says, the timer is able to output > 5ns pulse duration at high state. > > Here is my simple code: > > #include <stdio.h> > #include <csl.h> > #include <csl_timer.h> > > > TIMER_Handle hTimer; > > TIMER_Config MyConfig = { > 0x00000300, //Clock mode, Internal clock source > f_cpu/8, DATOUT is > > driven on TOUT DSK runs at 1GHz > 0x0000003E, //f=125MHz/(this value) 1MHz > frequency as an example > 0x00000000 > }; > > void main() > { > > CSL_init(); > TIMER_config(hTimer,&MyConfig); > hTimer = TIMER_open(TIMER_DEV0,0); > TIMER_start(hTimer); > > while(1) > { > > if(TIMER_getCount(hTimer)<10){ > TIMER_setDatOut(hTimer,1);} > else > { > TIMER_setDatOut(hTimer,0);} > > } > } > > Thank you. > > > --------------------------------------- > Posted through http://www.DSPRelated.com
-- Randy Yates, DSP/Embedded Firmware Developer Digital Signal Labs http://www.digitalsignallabs.com
Randy Yates <yates@digitalsignallabs.com> writes:

> I don't think you're going to get a good performance doing this in code. > The "5 ns" pulse duration be achieved using the timer hardware. See > section 5 in this document: > > TM320C6000 Peripherals Reference Guide, SPRU582
Correction: that is the "TMS320C6000 DSP 32-Bit Timer Reference Guide." It is SPRU582B.
> > --Randy > > "farzinalm" <135271@DSPRelated> writes: > >> Hello, >> >> I'm trying to generate short pulses with DSP's 32-bit timer. I'm using the >> DSK6416 board (@1GHz) . >> I need to have pulse widths as short as 10ns-50ns and be able to change >> the duty-cycle. I try to read the CNT register of the timer and set DATOUT >> to be driven on TOUT pin of timer when the proper width has reached. The >> problem is that when I use the TIMER_setDatOut API it is not possible to >> get 10-50ns pulse widths. The shortest pulse width you can get is 100ns. >> As the datasheet for the TMS320C6416T says, the timer is able to output >> 5ns pulse duration at high state. >> >> Here is my simple code: >> >> #include <stdio.h> >> #include <csl.h> >> #include <csl_timer.h> >> >> >> TIMER_Handle hTimer; >> >> TIMER_Config MyConfig = { >> 0x00000300, //Clock mode, Internal clock source >> f_cpu/8, DATOUT is >> >> driven on TOUT DSK runs at 1GHz >> 0x0000003E, //f=125MHz/(this value) 1MHz >> frequency as an example >> 0x00000000 >> }; >> >> void main() >> { >> >> CSL_init(); >> TIMER_config(hTimer,&MyConfig); >> hTimer = TIMER_open(TIMER_DEV0,0); >> TIMER_start(hTimer); >> >> while(1) >> { >> >> if(TIMER_getCount(hTimer)<10){ >> TIMER_setDatOut(hTimer,1);} >> else >> { >> TIMER_setDatOut(hTimer,0);} >> >> } >> } >> >> Thank you. >> >> >> --------------------------------------- >> Posted through http://www.DSPRelated.com
-- Randy Yates, DSP/Embedded Firmware Developer Digital Signal Labs http://www.digitalsignallabs.com