Pic18 start-project for beginners.

This is an easy and cheap project.

Home

Pic Home

pic_jdm_spel.html

PIC_scope.htm 

På Svenska  

                                        

The project has four parts: an LCD, a programmer, a keyboard and the main PIC18 board.

  • The LCD is one of the most expensive parts but it is easy to find. The drivers support only HD44780 compatible LCDs.
  • The programmer is realy simpe. It has two parts the programmer and a serial interface. The programmer connects to th ICSP interface and it is compatible with JDM-programmer but this seems to be better. The programmer also have a serial iterface that is used for downloading programms and for debugging.This programmer works for programmint through ICSP with DL4YHF's PIC Programmer. The programmer has been tested on several and different processors with great success. My students use it with no problems. The ICSP interface is only used one time for programming the booloader. After Pic-taker is used with the serial interface (RS232).
  • The keybord is the simpliest part.
  • The mainboard has a PIC18F4520 or PIC18F4620 and connectors for portA, portB, portD, SPI, keybord, ICSP and serial (RS232).

Progamming is done with Microchip's MCC18 C-compiler and Microchip's MPLAB IDE. This is a great package for Pic18 programming.

It could be found at the Microchip.com site.

To program the Pic18 processor the first time with a bootloader i use DL4YHF's PIC Programmer or Picpgm. Those is programs that transfers a Pic-progran through the ICSP interface to the processor. It could be found at: http://people.freenet.de/dl4yhf/winpicpr.html or http://www.members.aon.at/electronics/pic/picpgm/index.html .

When the bootloader, "Fboot.hex", is in place in the pic18 you use the Pic-taker program. Look at the download section.

The Pic-talker comunicates through the serial interface (RS232). It tansfers your program to the processor and could display messages from the processor. Pic-taker helps you to find problems in your program.

 

The programmer

It has two inteface: ICSP with 5 pins and Serial with 4 pins.
To select interface use the jumper in the middle of the card.

  • 1-2 selects serial ( 1 is nerarest the ICSP)
  • 2-3 selects ICSP( 3 is nerarest the9-pin D-sub)

When selecting ICSP there is two options, normal (VCC before Vpgm) and "Vpgm before VCC".
The "Vpgm before VCC" mode alows programing of devicees that uses the MCLR as a digital input.

The associated jumper is at the cads edge, close to the ICSP interface.

  • 1-2 Normal ( 1 is nerarest the9-pin D-sub)
  • 2-3 "Vpgm before VCC" ( 3 is nerarest the ICSP)

 

The keyboard

There is 6 buttons, one connected to a digital input and the other is connected to a analogue input

 

The PIC18 board

The mainboard has a PIC18F4520 @32Mhz, 8Mhz crystal and connectors for:

  • PortA, Analogue inputs and/or digital inputs/outputs.
  • PortB, digital inputs/outputs.
  • PortD, digital inputs/outputs.
  • SPI, Serial Periferal Interface, synchronous serial transfer wih several channels.
  • Keybord
  • ICSP, In Circuit Serial Programming interface.
  • Serial (RS232), asynchronous serial transfer.

There is also an IC-socket for SPI-EEPROM

The SPI-system is NOT complete! You must connect them yourselves with pinns from PortA,PortB, PortC, PortD and PortE.

3-pins from PortC is not connected, so you can connect then to whatever you like, SPI or
"PortA+Port E"-connector

 

First project
This is a MPLAB MCC18 project that contains:

  • LCD drivers that alows you to connect the LCD with 6-connections, freely choosen.
  • Keybord drivers.
  • Serial drivers. You could send messages to the Pic-talker.
  • AD-converter drivers.
  • Number to txt converter, advanced.

The whole system.

LCD, programmer, 
keyboard and
the PIC18 mainboard.

There also a reset button, to make it easier to restart. It is connected to the ICSP-interface.

Mainboard

With a PIC18F4520 running at 32MHz

The programmer

Keyboard

The PIC-talker

This progran comunicates with the PIC though the serial (rs232) connection

Programmer schematic

Programmer Components positions

 

 

 

 

 

 

 

 

 

 

 

Jumper positions and function.

 

 

 

 

 

 

 

 

 

Connectors pin-description.

Keyboard schematic

Keyboard components possitions

Mainboard schematic

Mainboard components possitions

The SPI cable with 3-connectors. That makes it possible to connect two SPI devices.

If you like, it easy to get a 4 or 5 connectors cable.

Download

Here is the layouts and PCBs for the boards, the Pic-boottalker and a sample start project.

Programmer: rs232+jdm_brd.pdf  , rs232+jdm_sch.pdf  

Keyboard: keyb_brd.pdf  , keyb_sch.pdf   

Mainboard: Pic_Start_2_brd.pdf  , Pic_Start_2_sch.pdf   

Pic-talker: BootTalker.zip  

First project: Pic18_start.zip  

Links

This is more advanced projects.

pic_jdm_spel.html

and

PicScope: PIC_scope.htm