EETimes

Embedded Systems September 2000 Vol13_10

Issue link: http://dc.ee.ubm-us.com/i/71837

Contents of this Issue

Navigation

Page 52 of 229

The Z80 architecture is simple to learn and still quite powerful. And, like any popular platform, there is a lot of valuable legacy software floating around for it. Z80 de riva tives. Around that same time, a new company called Rabbit Semiconductor introduced its own new generation of Z80 derivatives. ZiLOG's offering is called the eZ80 and i expected to hit the street in the second half of 2000. Rabbit Semiconductor's new processor is called the Rabbit 2000; it started ship- ping in Novembe r 1999. Rabbit Semiconductor was founded by its par- ent company Z World Inc. Z World has been around since 1981 and has been u ing the Z80 and Z180/ 64180 exten- sively in its board-level controllers. Annual volumes of Z80 flavors are reported to be at around 200 million units. I asked both ZiLOG and Rabbit why they would introduce new prod- ucts based on a 25-year-old architec- ture. I got the same response from both: a lot of engineers (about 100,000), have used these chips at some point in their career, and are already familiar with the architecture. The Z80 architecture is simple to learn and still quite powerful. And, like any popular platform, there is a lot of valu- able legacy software floating around for it. Finally, it's quite difficul t and expensive to introduce comple tely new architectures. Both ZiLOG and Rabbit claim that their new processors rival 16-bit processors in performance. The original The register model of the Z80 is shown in Figure 1. The Z80 can only address 64K of memory but has a sep- arate 64K 1/0 address space. The Z80 has two sets of 8-bit registers but only one is visible at any given time. Most 8- bi t operations are performed on the A register. The F 1 ·egister contains the six CPU flags (Sign, Zero, Half carry, Parity/ oVerflow, Negative, and Carry). The flags are automatically changed based on the result of the Real-time kernels A real-time kernel is software that manages the use of a microprocessor or microcontroller to ensure that all current operation. Regi ters B, C, D, E, H, and L are general-purpose 8-bi t registers that can be used during 8-bit operations. These last registers can be combined in pairs to form 16-bit regis- te rs: BC, DE, and HL. The BC, DE, and HL registers can be used in 16-bit arithmetic operations or can be used as pointers. The I register is used to hold the upper 8-bit address of the in terrupt vector table. When an intermpt is gen- erated, the CPU uses the I 1 ·egister and an 8-bit value provided by tl1e inter- rupting device to form a 16-bit inter- rupt vector address. Determining the source of an in te rrupt- ing device and vector- ing to the approp1·iate interrupt service rou- tine (ISR) is thus han- dled in hardware. The R regi ter is incremented on each instruction and is used to provide a refresh addre s fo r dynamic memory dur- ing a refresh cycle that is btu·ied in each instruction cycl e. However, it is unlikely tl1 at anyone would use dynamic memory nowadays because static memory is more appro- priate for a Z80 design. Both the IX and IY registers are 16-bi t pointers. Finally, SP is the stack poin ter and PC is the program counter. On average, a Z80 processor executes an instruction every 10 to 12 clock cycles. Newer Z80 derivative processors cut tl1is to two to five cycles per instruction, depending on tl1e archi tecture. elements called tasks. A task is a pro- gram iliat competes for CPU time and is generally written as an infinite loop as shown in Listing 1. With most real-time kernels, each task is given a priori ty based on its importance and its own stack space. You allow the kernel to manage each task by calling a function provided by the kernel, as shown in Listing 2. When you design a product using a real-time kernel you split the work to be done into tasks, each responsible for a portion of the problem solution. A real-time kernel also provide valu- able services to your application such as time delays, system time, mes age Embedded Systems Programming SEPTEMBER 2000 51 } LISTINCi 2 } time-critical events are processed as efficiently as pos ibl e. A real-time ker- nel can help simplify your design because it allows your proj ect to be divided into multiple independent LISTINCi 1 void TaskCode (void) { while (1) { Do something useful; Wait for event or time to expire; } Letting the kernel manage your tasks . void main (void) { OSTaskCreate(Task1Code, TopOfStack1, Priority1); OSTaskCreate(Task2Code, TopOfStack2, Priority2);

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems September 2000 Vol13_10