??? 11/29/06 04:33 Modified: 11/29/06 04:41 Read: times |
#128644 - Calculating a delay on Dallas 89C4XX uC |
I'm hoping one of you fine chaps might lend me a hand with calculating delays on a Dallas 89C450 uC. I'm doing this as a hobby and am a programmer by trade so treat me with kid gloves if you can.
From the documentation on this uC, it differs from the traditional 8051 in that it only uses one clock per machine cycle ( though instructions can now take between one to ten cycles). So I'm assuming then that using a 16.384MHz crystal and keeping the default clock divide at divide by 1 that the uC will be able to perform 16,384,000 machine cycles per second. Is this correct? If so then I'd further assume that an instruction such as DJNZ Rn,rel , taking 5cycles on the 89C450, could be called ~3,276,800 per second ( 16384000/5). Is this right? Again, assuming the above is correct I'd imagine I could then create a somewhat accurate delay routine by creating a simple loop of instructions whose cycle sum when divided into 16384000 results in my desired delay? I've no true need for super accuracy but when I want to create a delay routine for an LCD init process, for instance, I'd like a 5us delay to be fairly close to 5us of real time. And yes I've a copy of the bible. And yes I've a copy of Dallas' data sheet for this uC as well as their user guide for this series of controllers. So please don't just reply with a link to any of them. If you want to lend a hand, reference a page and be prepared for some questions because I'm beginning to think I'm quite dense when it comes to hardware. ^_^ |
Topic | Author | Date |
Calculating a delay on Dallas 89C4XX uC | 01/01/70 00:00 | |
Timer and an interrupt | 01/01/70 00:00 | |
Yup, not ideal | 01/01/70 00:00 | |
ADC 16-b it ACQUISITION IS NOT DESCRIPTIVE | 01/01/70 00:00 | |
It\'s time for a little reading | 01/01/70 00:00 | |
Read the book | 01/01/70 00:00 | |
start a new thread![]() | 01/01/70 00:00 |