Electronics > Beginners
N76E003 pin high/low takes larger time
(1/1)
Vindhyachal.takniki:
1. I am using N76E003, keil v9.51 . Controller is running at 16Mhz, I can measure this on Clockout pin by DSO.
2. Internal clock diagram shows, Clockout frequency & peripheral frequency is same.
3. Timers works correctly accroding to 16Mhz clock.
4. Issue I faced is when I write:
P04 = 0; or P04 = 1;
it takes around 250ns as measured on DSo with 10x probe for single instruction.
5. Disassembly on keil shows:
C:0x07FE C284 CLR P04(0x80.4)
C:0x0800 D284 SETB P04(0x80.4)
6. These are single cycle instruction. What I dont understand is when cpu is running at 16Mhz, single cycle time should be 1/16Mhz i.e 62.5ns, but on DSO it takes 250ns around
7. Then why pin high low takes large time
garethw:
Clock cycles and machine cycles are not the same.
For example: Your clock is 16MHz. If your mcu is running 4 clock cycles per machine cycle then each instruction takes 1 / 4MHz = 250ns.
The data sheet will explain how long each instruction will take in machine cycles as well as how long a machine cycle is.
Sent from my iPhone using Tapatalk
garethw:
Checking the N76E003 datasheet reveals:
1 clock cycle per Machine cycle.
SETB (set bit) = 4 Machine cycles
CLR (clear bit) = 4 Machine cycles
Hope that helps
Gareth
Vindhyachal.takniki:
thanks
Navigation
[0] Message Index
Go to full version