National Instruments HPC467064, HPC167064 manual Code Efficiency, Development Support

Page 30

Code Efficiency

One of the most important criteria of a single chip microcon- troller is code efficiency. The more efficient the code, the more features that can be put on a chip. The memory size on a chip is fixed so if code is not efficient, features may have to be sacrificed or the programmer may have to buy a larger, more expensive version of the chip.

The HPC family has been designed to be extremely code- efficient. The HPC looks very good in all the standard cod- ing benchmarks; however, it is not realistic to rely only on benchmarks. Many large jobs have been programmed onto the HPC, and the code savings over other popular micro- controllers has been considerable.

Reasons for this saving of code include the following:

SINGLE BYTE INSTRUCTIONS

The majority of instructions on the HPC167064 are single- byte. There are two especially code-saving instructions: JP is a 1-byte jump. True, it can only jump within a range of plus or minus 32, but many loops and decisions are often within a small range of program memory. Most other micros need 2-byte instructions for any short jumps.

JSRP is a 1-byte subroutine call. The user makes a table of the 16 most frequently called subroutines and these calls will only take one byte. Most other micros require two and even three bytes to call a subroutine. The user does not have to decide which subroutine addresses to put into the table; the assembler can give this information.

EFFICIENT SUBROUTINE CALLS

The 2-byte JSR instructions can call any subroutine within plus or minus 1k of program memory.

MULTIFUNCTION INSTRUCTIONS FOR DATA MOVE- MENT AND PROGRAM LOOPING

The HPC167064 has single-byte instructions that perform multiple tasks. For example, the XS instruction will do the following:

1.Exchange A and memory pointed to by the B register

2.Increment or decrement the B register

3.Compare the B register to the K register

4.Generate a conditional skip if B has passed K

The value of this multipurpose instruction becomes evident when looping through sequential areas of memory and exit- ing when the loop is finished.

BIT MANIPULATION INSTRUCTIONS

Any bit of memory, I/O or registers can be set, reset or tested by the single byte bit instructions. The bits can be addressed directly or indirectly. Since all registers and I/O are mapped into the memory, it is very easy to manipulate specific bits to do efficient control.

DECIMAL ADD AND SUBTRACT

This instruction is needed to interface with the decimal user world.

It can handle both 16-bit words and 8-bit bytes.

The 16-bit capability saves code since many variables can be stored as one piece of data and the programmer does not have to break his data into two bytes. Many applications store most data in 4-digit variables. The HPC167064 sup- plies 8-bit byte capability for 2-digit variables and literal vari- ables.

MULTIPLY AND DIVIDE INSTRUCTIONS

The HPC167064 has 16-bit multiply, 16-bit by 16-bit divide, and 32-bit by 16-bit divide instructions. This saves both code and time. Multiply and divide can use immediate data or data from memory. The ability to multiply and divide by immediate data saves code since this function is often needed for scaling, base conversion, computing indexes of arrays, etc.

Development Support

The HPC167064 acts as a stand alone emulator for either the HPC16083 or the HPC16064. No separate development tool is thus provided to support this emulator device. The user will use either the HPC16083 or the HPC16064 (de- pending on which device is in use) development tools to develop and debug the application hardware and software in their target as normally done for the non-emulator HPC devices. The application software can then be programmed in the on-chip EPROM and the HPC167064 can then be plugged in the target system to run the application like a regular masked ROM device. The HPC167064 can be pro- grammed using a DATA I/O UNISITE with pinsite module.

To support the security feature of the HPC167064, a soft- ware switch is provided with the linker (under PROMHPC) which will generate an encrypted hex file for the user. The purpose is to be able to compare this software generated encrypted data with the encrypted data produced by the actual chip to provide a way to verify on-chip EPROM code after security has been enabled. For details of how to gener- ate encrypted data and all other HPC167064 features, refer to the Appendix K of the HPC Family User’s Manual.

30

Image 30
Contents Features General DescriptionAbsolute Maximum Ratings DC Electrical CharacteristicsReset ALL Other Inputs20 MHz AC Electrical Characteristics UPIDelay from CK2 Rising Edge to ALE Rising Edge Delay from CKI Rising Edge to ALE Rising EdgeDelay from CKI Rising Edge to ALE Falling Edge Delay from CK2 Falling Edge to ALE Falling Edge30 MHz AC Electrical Characteristics CKI Input Signal Characteristics CK1, CK2, ALE Timing Diagram Input and Output for AC TestsRead Cycle Microwire Setup/Hold Timing Functional Modes of Operation Eprom ModeNormal Running Mode EconaErasure Characteristics Memory Map of the HPC167064Pin Descriptions Connection Diagram Ports a & BPorts a & B Operating Modes Wait States Power Save ModesHPC167064 Operating Modes HPC167064 InterruptsBit External Memory Interrupt Processing Timer OverviewInterrupt Arbitration Interrupt Control RegistersBlock Diagram of Interrupt Logic Timers T2 T3 Block Synchronous OutputsMICROWIRE/PLUS Operation Timer RegistersTimer Applications Watchdog LogicMICROWIRE/PLUS MICROWIRE/PLUS ApplicationUart Wake-Up Mode HPC167064 UartUniversal Peripheral Interface Shared Memory SupportMemory Design Considerations Table IV. Memory Map of HPC167064 Emulating an HPC16083 DfffdffeXtal Frequency MHz 1500 1200 910 750 600 470 390 300 220 180 100HPC167064 CPU Addressing ModesHPC Instruction Set Description Ifbit BIT Instructions SbitRbit Memory Transfer InstructionsCode Efficiency Development SupportHPC-DEV-IBMA HOW to OrderProgramming Support HPC-DEV-IBMCPlcc Part SelectionSocket Selection YamaichiPage Physical Dimensions inches millimeters Life Support Policy