Re: Q: lpc921 compatiblity with 8051?




Petar Silic wrote:
> hi,
>
> I have a project with philips p89lpc921, and need to use it as standard 8051
>
> now, this two chips have different clocks per cycle, as I understood,
>
> so delay and timer do not work corectly
>
>
> anyone knows how to make this work? i tried writing DIVM=3,
> but it didn't work
>
> help please, I am out of ideas :o)

Petar,

while the LPC900 family is clock cycle compatible which means that
every instruction takes 1/6 the time of a standard 12 clock 80C51,
timers are based on the input clock without any changes to a standard
51. What you would like to do seems between very difficult and not
possible. I do not know your software but I hope you did not write
delay loops that are based on execution speed. If you use the same
timers on the LPC921 as you used on the 51, running at the same
frequency, the timer delays should be indentical. However, your code
executes 6 times faster. This is a significant difference to other
cores from Dallas, Atmels new "single cycle" or Silabs which are not
cycle compatible. Their 3-4 clock cores or so called single cycle cores
will use a different number of cycles to execute an instruction that do
not scale from the original 80C51.

As a summary, the LPC921 core is fully compatible to the 8051 core, 6x
faster for any instruction. The timers are "even more compatible", no
changes required. This is great for most applications that used timers
for specific wait time for events to happen. The code will be faster
and just waiting longer for the wait to finish. The only problem is
when programmers were counting instruction cycles to calculate delays,
the the relationship between CPU clock and timer clock does not work
any more.

btw. using DIVM slows down the clock to the whole chip, not just
peripherals.

An Schwob

.



Relevant Pages

  • Re: Avoiding meta stability?
    ... the input signal is synchronous to a 1.8 MHz clock and I ... > want to synchronize it to a 24 MHz clock. ... Instead of a full cycle of delay ...
    (comp.arch.fpga)
  • [PATCH] atmel_tc library
    ... or used as somewhat quirky sixteen-bit timers. ... * share individual timers between different drivers. ... * clocks or clock gates, and per-timer TIOA and TIOB signals used for PWM ... * IRQ resources. ...
    (Linux-Kernel)
  • Re: Stepper motor driver with less noise?
    ... sense reference that had slope opposite to the motor current ... each cycle, there were clear current limit signal crossings ... At the beginning of each clock cycle, the the reference voltage is compared to the amplified current measurement, and if the current is less than the reference, the output switch is turned on, till the current exceeds the reference, at which time the switch is turned off. ...
    (sci.electronics.design)
  • Re: Stepper motor driver with less noise?
    ... once I increased the clock frequency ... sense reference that had slope opposite to the motor current ... each cycle, there were clear current limit signal crossings ... At the beginning of each clock cycle, the the reference ...
    (sci.electronics.design)
  • Re: Is this phase accumulator trick well-known???
    ... a 50% duty cycle clock. ... and wanted to try a phase accumulator technique instead of a simple divider. ... save an adder. ...
    (comp.arch.fpga)