Pic microcontroller project

Posted on Feb 5, 2014

Communication with the MCP3028 ADC chip is done using a simple serial interface compatible with the SPI protocol. The Pic16f84 or Pic16f628 didn`t had hardware SPI peripheral. However, software implemeted SPI protocol can be done to communicate with 12 bit MCP3028 ADC device. The example of this communication shown as following circuit diagram. Th

Pic microcontroller project
Click here to download the full size of the above Circuit.

e ADC result shown on LCD with hex value (conversion from binary code). Press the push button (pin 6, RB0/INT) to select the ADC channel (8 channel from CH0 to CH7). Then, connect the potention meter to the channel and turn it. You will see the hex value change accordingly. The SPI communication protocol need 4 line for interfacing. Using software implemeted SPI protocol enable communication with more than one ADC device. The circuit diagram same as above 12 bit ADC interfacing. The only different is the source code which the binary code has been change to ASCII code with decimen number. This need some math fuction such as divide function and floating point. The math fuction for assembler code can find from Microchip Website. You can also find some documen of math fuction from or use C compiler such as Piclite for PIC16f8X/c8x series, cc5x c, pacific c and so on. The following hex file are use Microchip Math Library (assembler code) for this simple multi channel digital voltmeter device (using 16 bit for calculation). The maximum hex value for the ADC channel is FFF equal to decimel number 4095. This will display on the LCD as 5. 11 volt. Download hex file for Pic16F84 here: F84dec. zip. Download hex file for Pic16F628 here: 628dec. zip. If using PORTA pins as interfacing I/O, you need to define/set the I/O fuction for PIC16f628. Generally, the initial PORTA setting as following for I/O fuction: clrf PORTA movlw 0x07 ;turn...

Leave Comment

characters left:

New Circuits



Popular Circuits

Multilayer capacitor doubles as varactor
Cell Phone Controlled Home Appliance circuit
op amp Flow of current in a simple inverting amplifier circuit
Ding-Dong sound generator
LMZ13608 8A switching power supply circuit design
Linear RF Power Meter
Build Your Own Motorcycle Alarm
Mains Voltage Monitor
Winds from the 555 programmed
Vehicle lights at night rendezvous controlled circuit