Board 4 - PIC 18F2320
Processor board 4 - PIC18F2320
Fig. 1 PIC 18F2320 board
Description:
This is a processor board, and can take various 28 pins Microchip PIC processors. This one is fitted with a PIC 18F2320.
The board is comparable to board 3, but uses a PIC 18F type processor. The differences are the regulator is gone, so the board can be powered from 2.5 to 5V. It has an SPI interface connector, and a 20 MHz oscillator instead of the quartz. It has enough memory for small projects, hardware UART, I2C and SPI ports, 10 10bits ADC, 4 timers and nanoWatt technology. It is plenty to test a lot of the PIC features.
Its main purpose is to be able to develop on the 18F type processor.
It runs at 20 MHz, and has 3 8 bits interfaces, 1 I2C, 1 serial, 1 SPI and 1 ICSP connectors.
The board can be powered by one of the PSU boards (powered from USB port), or between 2.5 to 5V.
Schematic:
Specifications:
ProcessorMicrochip PIC 18F2320
Interfaces3x8bits, 1xI2C, 1xRS232, 1xSPI
Clock20 MHz oscillator
Power supply 2.5 to 5V
Memory4 K word Flash for program
512 bytes RAM
256 bytes EEPROM
Timers 4 (1x8bits and 3x16bits)
2 capture, compare and PWM modules
Analog to digital10x10bits channels
Programmingon board ICSP connector
The components used are mostly components I already have, or recycled from various hardware. Some values are not critical.
The power supply is filtered by C1. D1 protects the board if the power supply connection is inverted.
The processor U2 gets its power from the board power or the ICSP programmer. D2 (Schottky for low voltage drop) supplies the power from the regulator, D3 from the ICSP. C3 filters U2 power and needs to be fitted as close as possible to the chip. D2 can be removed and shorted, which mean the full project will be powered on when programming. With D2 in, the minimum power voltage is 2.5V, which will be around 2V on the processor.
I used an 20MHz oscillator I had for the clock. The processor will need to be configured for ECIO or HS oscillator type. ECIO type will free RA6 as a general IO pin.
C2, C3, C4 and C5 are filters capacitor. Their values is not critical, but 100 nF is a good value to use. You can use between 100nF and 1 uF.
The usual reset signal is provided with D4, D5, R1 and C6. The led simply shows when the board is powered on.
The 3 8 bits interfaces connect port A, B and C to an 8 bits type bus, common across the various boards. Port A only provides RA0 to RA5 or RA6, depending on the oscillator's configuration. Pin 7 is not connected.
Pins 6 and 7 from port B are isolated with a resistor (R2 and R3, 4.7k, but not critical) on the interface, so the various boards plugged in will not interfere with programming. (RB6 and RB7 are used on the ICSP connector to program the processor.
The RS232 (TTL level with Rx and Tx signals), SPI and I2C interfaces just take their signals from the appropriate pins of the processor.
The interrupt signal from the I2C interface is connected to signal Int0 (RB0)
The SPI interface uses SPI slave select input (RA5) for CS0, Interrupt signal Int1 (RB1) for CS1 and generic IO (RC2) for CS2.
Fig. 2 Board 4 schematic
Construction:
The processor boards are build on prototyping strip boards. It can be a bit long, as they are many signals to route. Use the schematic and replicate it on the board. Use a socket for the processor U2.
K7 is for the RS232 interface. The signals are TTL level, and a converter can be fitted on it to provides proper RS232 signals. A pin from the header needs to be remove (pin 4)
Once all the components are soldered, you can test the board as described below before inserting the processor in its socket.
| Interfaces pinout | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Power supply | 8 Bits | I2C | SPI | RS232 | ICSP | ||||||
| 1 | Vcc | 1 | Vcc | 1 | Int | 1 | Gnd | 1 | Gnd | 1 | RB5 (LVP) |
| 2 | Gnd | 2 | bit 7 | 2 | Vcc | 2 | Sck | 2 | Vcc | 2 | RB6 |
| 3 | bit 6 | 3 | Sda | 3 | MISO | 3 | Tx processor | 3 | RB7 | ||
| 4 | bit 5 | 4 | Scl | 4 | MOSI | 4 | NC | 4 | Gnd | ||
| 5 | bit 4 | 5 | Gnd | 5 | CS0 | 5 | Rx processor | 5 | Vpp | ||
| 6 | bit 3 | 6 | CS1 | 6 | Mclr | ||||||
| 7 | bit 2 | 7 | CS2 | ||||||||
| 8 | bit 1 | 8 | Vcc | ||||||||
| 9 | bit 0 | ||||||||||
| 10 | Gnd | ||||||||||
| Board 4 Component list |
|---|
| C1: 10 uF C2, C3, C4, C5: 100 nF C6: 2.2 uF R1: 8.2 K R2, R3: 4.7K R4: 680 U2: PIC 18F2320 or compatible, with 28pins socket D1: 1N4004 D2: BAT42 D3, D4, D5: 1N4148 LED1: led 5 or 3 mm Q1: 20 MHz oscillator (4 to 20 MHz) K1: Connector AMP MT 2pins male K2, K3, K4: Connector AMP MT 10pins male K5: Connector AMP MT 5pins male K6: Connector AMP MT 6pins male K7: pinheader 5 pins K8: Connector AMP MT 8pins male |
How to use / Testing:
To check the board, leave U2 out of its socket, and check voltage across pin 8 and 20, then 19 and 20 when the board is powered on. It must read around the power supply voltage (minus the voltage drop in D2).
Check the power supply pins of the various connectors (K2 to K8).
To check the board fully, you need to fit the processor in its socket and run one of the tutorial projects (8 bits counter for example). Just make sure you set the switch on JP1 to suit the power supply used.
Files and links:
Eagle schematics file for board 4.Eagle pdf file for board 4.
PIC Tutorials.
Microchip PIC 18F2320.

