Copy Microcontroller CF785 Program

We can Copy Microcontroller CF785 Program, please view the Microcontroller CF785 features for your reference:

The Power Control (PCON) register (See Table 17-2) contains flag bits to differentiate between a:

Power-on Reset (POR)

Brown-out Reset (BOR)

Watchdog Timer Reset (WDT)

External MCLR Reset

The PCON register also controls the software enable of the BOR.

The PCON register bits are shown in Register 2-8.

Unimplemented: Read as ‘0’

Copy Microcontroller CF785 Program
Copy Microcontroller CF785 Program

SBOREN: Software BOR Enable bit (1)

1 = BOR enabled

0 = BOR disabled after

Unimplemented: Read as ‘0’

POR: Power-on Reset Status bit

1 = No Power-on Reset occurred

0 = A Power-on Reset occurred (must be set in software after a Power-on Reset occurs)

BOR: Brown-out Reset Status bit

1 = No Brown-out Reset occurred

0 = A Brown-out Reset occurred (must be set in software after a Brown-out Reset occurs).

Note 1: BOREN<1:0> =01 in the Configuration Word register for this bit to control the BOR.

The Program Counter (PC) is 13 bits wide. The low byte comes from the PCL register, which is a readable and writable register. The high byte (PC<12:8>) is not directly readable or writable and comes from PCLATH.

On any Reset, the PC is cleared. Figure 2-5 shows the two situations for the loading of the PC. The upper example in Figure 2-5 shows how the PC is loaded on a write to PCL (PCLATH<4:0> → PCH).

The lower example in Figure 2-5 shows how the PC is loaded during a CALL (PCLATH<4:3> → PCH).

or GOTO instruction

A computed GOTO is accomplished by adding an offset to the program counter (ADDWF PCL). When performing a table read using a computed GOTO method, care should be exercised if the table location crosses a PCL memory boundary (each 256-byte block).

Refer to the Application Note AN556, “Implementing a Table Read” (DS00556) from microcontroller program.

The CF785 family has an 8-level x 13-bit wide hardware stack (see Figures 2-1 and 2-2). The stack space is not part of either program or data space and the Stack Pointer is not readable or writable. The PC is PUSHed onto the stack when a CALL instruction is executed or an interrupt causes a branch. The stack is POPed in the event of a RETURN, RETLW or a RETFIE instruction execution. PCLATH is not affected by a PUSH or POP operation.

The stack operates as a circular buffer. This means that after the stack has been PUSHed eight times, the ninth PUSH overwrites the value that was stored from the first PUSH. The tenth PUSH overwrites the second PUSH (and so on).