Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

timer formulae for lpc ARM processor series

Status
Not open for further replies.

sos

Member level 2
Member level 2
Joined
Apr 4, 2008
Messages
43
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,513
hi all
i have developed a timer formulae for lpc series:
((PR+1)*(MR-1))/pclk = time

say for example i want a delay for 1ms than my delay routine will initialise
if pclk=12Mhz
the multiplication :((PR+1)*(MR-1)) should at last equal to 12000

so i can choose
1. PR=0 and MR=11999
or
2.PR=11 and MR=1001

so my question is:
1. Am i correct at acheiving this formulae
2. Will the accuracy be equal in both the cases(say in both cases will i get
1ms accurate)

Any discussion is welcomed
regards
ArmNewbie
 

Well, don't know about your knowledge in regards to ARM but your math lags a little.
if you use your example 1, I get a result of 11998 / 12exp6, that is less than 1 ms.
pclk is by default cclk/4 just in case you did not notice this in the manual. May be it is just me, but I do not really understand what the formula is good for.
Bob
 

    sos

    Points: 2
    Helpful Answer Positive Rating
hi bob
thanks for pointing out the mistake.
the correct one is :
((PR+1)*(MR+1))/pclk = time

i have implemented this formulae and checked on oscilloscope and found out it is correct upto the level of 100usec.

but the problem is beyond that level i am incorrect.
take the case of 10usec.
i select PR as 14 and MR as 7 and i found the delay is 14usec instead of required 10usec.

does this depend on setting of PR and MR(say reducing one and increasing other)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top