circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

November 2000 , Issue 124

A PIC17C44-Based Computer


by Duane Perkins

THE SOFTWARE

Programs can be assembled for internal or external program memory. A program to run in external memory requires a program in internal memory with code at the reset vector (zero) where execution starts. This code can be as simple as a branch (call or goto) to code in external memory, but be sure to set pccalth to a range of 20–3Fh before the branch instruction.

If any interrupts are to be enabled, appropriate code beginning at the interrupt vector is also required. It is convenient to program a PIC17C44 with sbc17C44.hex, which provides a program loader, interrupt service code, and a number of commonly used functions that can be called by the application.

A program assembled for internal memory can include sbc17C44.int. This includes initialization code and a few functions. Interrupt code also will be included if service is defined prior to the #include line.(see Table 2).

Model Code

Program
memory

Data
memory

External program memory
Small 1 £2 Kb £8 Kb Yes
Compact 2 £2 Kb >8 Kb No
Medium 3 >2 Kb £8 Kb Yes
Large 4 >2 Kb >8 Kb No
Table 2—Here are the memory model designations.

The model defaults to small if not defined before sbc17C44.int code. RAM at 2000:3FFF can be used for data if the compact or large model is specified. Program code can reside in external program memory if the small or medium model is specified.

A program coded for external memory can include sbc17C44.inc. intsvc must be defined as 0 if interrupts are not enabled or with the label of the interrupt service if interrupts are enabled. The label "main" must be included as the entry point of the application code. "Endcode" must precede the end line. See key2lcd.ext and clock.ext for examples. See monitor.lsr for more information.

 Duane Perkins is a self-taught engineer who has made computers and electronics his avocation since retiring in 1980. In recent years, he has specialized in PIC microcontrollers. You may reach Duane at dmperkins@ compuserve.com.