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.

TMS570LS0432 run too slow

Other Parts Discussed in Thread: TMS570LS0432, HALCOGEN

Dear,

    I use TMS570LS0432 generat a pulse, with an oscilloscope to observe the output pulse period actually reached 600ns,
I set the frequency is 80MHz, my code is as follows:

loop:
gioPORTA->DSET=4;
gioPORTA->DCLR=4;
goto loop;


I shut down all the interruptions.I generat code with HALCOGEN, PLLCT1 and PLLCT2 value is right, ECLK output frequency is 80MHz.
Why instruction execution cycle would be so long? Please give me a help.

migmag

  • At 80MHz TMS570LS0432's Instruction cycle Should be 12.5ns,Why the pulse period is 600ns?How can such a slow speed run the program?
  • Hi,
    Can you please tell me two things? First, what is your VCLK frequency? VCLK is the operating clock for GIO module and VCLK is divided from HCLK. To achieve the best performance make sure VCLK=HCLK. Second, are you in strongly-order memory type? If yes, can you please change to 'device' memory type and let me know if it makes a difference.
  • Dear Charles,
    I'm sure VCLK1,VCLK2 and VCLKA are 80MHz. I don't quite understand what you're saying about strongly-order memory type and device memory type? Is not to refer to PIPELINE and normal mode, if so, in the HAC code generator at 80MHz only allowed to set to PIPELINE. I repeated the test, the problem is not resolved, please help to see if there is no other problem.
    thanks
    user4669898
  • Dear,
    I tested several standard TI example program is wrong. Can you give me an example project file to generate a high frequency pulse? With TMS570LS0X32 at 16MHz's Oscillator in CCS6 use below code:
    loop:
    gioPORTA->DSET=4;
    gioPORTA->DCLR=4;
    goto loop;

    thanks
    user4669898
  • Hi,
    I see about 570ns without code optimization. With code optimization I see 500ns period. The disassembly is as follows.

    $C$L1:
    0000323c: E580C00C STR R12, [R0, #12]
    00003240: E580C010 STR R12, [R0, #16]
    00003244: EAFFFFFC B $C$L1

    You can't optimize better than this to set and clear the GIO pin. When CPU writes to a register, there is some latency from the time the instruction is executed until the write is actually written to the register. Normally this is about 20 GCLK cycles. At 80MHz, this means a write takes about 250ns to write to a register. So it makes sense to see 500ns to set the register (250ns) and then to clear the register ( Another 250ns).

    So I will say 500ns is the best period you are able to achieve from an architecture stand point.
  • The N2HET is more appropriate for this.

    If you want a 2MHz PWM frequency though,  with an 80MHz timebase you are going to be limited in resolution.

    On the other hand if you were trying to toggle the GIO as fast as possible but really you want a 100KHz or 10KHz frequency with good resolution then the N2HET is definitely the correct choice.   For the latter you can use the N2HET default timer program and it's PWM tabs in HalCoGen.

    If you need a 2MHz frequency, ~5 bit resolution PWM though - you'll need to develop a spinoff of the N2HET code for that purpose.

    There is an appnote  PWM Generation and Input Capture Using HALCoGen N2HET Module explaining the HalCoGen N2HET example code that you could start with and learn how it works to then customize.

    You would use the HET IDE to customize.

  • Hello, everyone, thank you for your warm help,
    I am in the IO port output pulse is only to test the speed of the CPU, because I found that the implementation of ordinary instructions are very slow, so slow speed is not used, thank you again.

    Best Regards,
    user4669898