2006-10-15 10:38 PM
2006-07-07 04:11 AM
2006-09-22 09:36 PM
Hello simointe
were u ale to solve ur problem? Even i too have the same question.I want to cll a delay.I can understand whats the clock cycle and machine cycle for each instruction.(STR710FZ2) kindly help if u've the answer. Thanks and regards Sany2006-09-24 01:51 PM
Try this routine. In my project, it's ok.
delayUS ; r0 is n US ; We assume cpu running in 48Mhz and code is located in RAM. mov r1, #12 ;If CPU running in 16Mhz, change 12 to 4. mul r0, r1, r0 ;Be careful in r0 overflow. delayUS_loop subs r0, r0, #1 bcs delayUS_loop bx lr [ This message was edited by: dawei on 25-09-2006 02:25 ]2006-09-27 12:34 AM
hello!!!
can anybody tell me about the time taken to execute one instruction.I want to create a delay of say 4 microsecond.I am using STR710FZ2t6 Kindly help. Regards Sany2006-09-28 01:43 PM
Quote:
On 27-09-2006 at 18:07, peterwrigley wrote: One cycle will be used to execute a NOP. The precise length of time will depend on the CPU operating frequency, which will depend on the PLL status and the crystal used. The compiler may optimise out your instruction, which would give no delay as the function would not be executed. Overhead will be generated in calling the function and in returning from it. The precise overhead will depend on the calling conventions of your compiler (look at the disassembly listing). Whether or not you are using Thumb mode may have an effect. Personally I would configure the PLL then use a timer to generate a delay. You can then set a bit to flag to the rest of the application that ''something needs done'' or do small calculations in the interrupt routine. This is actually easier! Also note you can configure the hardware to automatically do things on counter matches; if you need to output a square wave (say to measure the frequency) the PWM, OPM or OCMP modes should be of use to you. These also have the advantage that the CPU does not intervene so the value you load into the timer module will have a direct relationship with the length of any output pulse.2006-10-12 04:55 PM
2006-10-13 01:57 AM
Yes and yes, nice isn't it?
You can dynamically configure the clock to any mix of frequencies you like. This is not necessarily a good idea in normal operation, but during a low power state you will find that the core clock has stopped and is waiting for an interrupt, which usually will come from one of the APB peripherals. P46 of the STR7 reference manual might help you here. Also note that branches may require up to three cycles to execute as the pipeline is flushed. More info (p34 of 360): http://www.arm.com/pdfs/DUI0068B_ADS1_2_Assembler.pdf If you are new to the architecture AND you're programming in assembly, you're braver than me! I suggest you look at the ST C libraries for the chip. Even if you are working in assembly they may clear up some problems later on.2006-10-14 12:59 AM
Thank you very much for the reply...and valuable suggestion..
2006-10-15 10:38 PM
You're welcome :)