15.08.2013 Views

DESIGN OF A CUSTOM ASIC INCORPORATING CAN™ AND 1 ...

DESIGN OF A CUSTOM ASIC INCORPORATING CAN™ AND 1 ...

DESIGN OF A CUSTOM ASIC INCORPORATING CAN™ AND 1 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.3.20.2 PIC® MCU Initialization<br />

Initialization of the PIC12CE674 is straightforward. There are three major functions that<br />

need to be properly configured within the PIC12CE674:<br />

General Purpose I/O (GPIO) pins<br />

Timer0 module<br />

A/D Converter module<br />

Figure 5.34 shows the pin diagram and names for the PIC12CE674.<br />

Figure 5.34 PIC12CE674 Pin Names [42].<br />

The GPIO pins are the six I/O pins that are used to interface the PIC12CE674 to the<br />

MCP2515 and sample the analog signals. The PIC® MCU OPTION, TRIS and INTCON<br />

registers are used to control the setup of the GPIO pins. For the CAN nodes used in the<br />

prototype system, the OPTION register is programmed to disable the internal pull-up resistors on<br />

GP0/GP1/GP3. It also configures GP2 to generate an interrupt on the negative edge (to match<br />

the MCP2515 device’s active low INT output). The TRIS register, which controls whether<br />

each I/O pin is configured as an input or an output, is configured to set GP0/GP1/GP3 as inputs,<br />

173

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!