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:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    Frequency meter 1KHz to 1MHz
    Wireless doorbell 300MHz
    12V to 5V 3A DC converter step down Regulator
    ADum3223 issue (H bridge)
    USB sound card
    transformerless low cost power supply
    Vacuum Fluorescent Device Regenerative Receiver
    How To Build An Anti-Hijack Vehicle Alarm
    Emergency lighting circuit diagram
    Audio-frequency generator circuit
    General Purpose Amplifier circuit diagram
    IC OCL power amplifier circuit



    Top