Pages

Monday, 25 May 2015

PICKIT2

OVERVIEW
PICKIT2
The PICkit 2 Development Programmer/Debugger is a low-cost development programmer.
It is capable of programming most of Microchip.s Flash microcontrollers and serial
EEPROM devices.

The PICkit 2 Development Programmer/Debugger kit contains the following items:
  1. The PICkit 2 Development Programmer/Debugger
  2. USB cable
  3. PICkit Starter Kit and MPLAB IDE 
PICKIT2 USER’S GUIDE
USB Port Connection
The USB port connection is a USB mini-B connector. Connect the PICkit 2 to the PC using
the supplied USB cable.
Status LEDs

The Status LEDs indicate the status of the PICkit 2.
  1. Power (green) . Power is applied to the PICkit 2 via the USB port.
  2. Target (yellow) . The PICkit 2 is powering the target device.
  3. Busy (red) . The PICkit 2 is busy with a function in progress, such asprogramming
INSTALLATION OF PICKIT2

  1. Download the pickkit2 software.
  2. Run the setup.exe file 

  • Click on next


  • Click on next ->Exit

Check communication 
Check Communication . Verifies USB communication with the PICkit 2 and ICSP
communication with a target device by attempting to identify the connected device
by its device ID.
Setting the VDD
  • This will automatically set VDD when external supply is given .
  • If there is no external supply
Calibrate VDD & Set Unit ID . Opens a wizard that steps the user through calibrating
the PICkit 2 VDD supplied voltage so it is more accurate, and optionally
assigning a Unit ID to identify between multiple PICkit 2 devices

After setting the VDD

Load the hex file


  • Click on open

  • Click on Write


To erase the memory
Click on erase


The Blank Check function will read the entire device to determine if Program Memory,
EEPROM Data memory, User IDs and Configuration bits are erased.

USING MPLAB
  •  Open MPLAB 
  •  Create a folder in any drive.


SELECT DEVICE


SELECT LANGUAGE SUITE

CREATE NEW PROJECT

ADD FILES

PROJECT WIZARD SUMMARY

Write the Program

Save the program in respective folder

Add file 

Select the  .c file

CONFIGURATION BIT SETTINGS

SELECT DEVICE DIALOG

Choosing the pick kit 2 IC (16F877A)

Selecting PICkit 2 as the Debug Tool

Load the program on to pickit2

ICSP(In Circuit Serial Programming)

Pin 1: Ground
Pin 2: VCC
Pin  3: MCLR
Pin 4:PGC
Pin 5:PGD
NOTE:Connect Red strip  to PGD

ICSP is a technique where programmable device is programmed after device is placed in the circuit board


ICSP CONNECTION WITH DEVELOPMENT BOARD



PCF8591 A/D D/A CONVERTER MODULE

OVERVIEW

PCF8591 A/D D/A CONVERTER MODULE

The PCF8591 is a monolithically integrated, and a separate power supply, low-power, 8-bit CMOS data acquisition devices. The PCF8591 has the four analog inputs, one analog output and a serial I2C bus interface. PCF8591 three address pins A0, A1 and A2 can be used in hardware address programmed 8 PCF8591 device allows access to the same I2C bus, without the need for additional hardware. On the PCF8591 device input and output of the address, control and data signals are transmitted in serial fashion via the two-wire bidirectional I2C bus.

FEATURES

  • A module chip using PCF8951
  • Single-Supply Operation
  • PCF8591 operating voltage range of 2.5V to 6V
  • Low standby current through the I2C bus serial input / output
  • PCF8591 by 3 hardware address pins addressing
  • Sampling rate PCF8591 I2C bus rate decided
  • 4 analog inputs programmable as single-ended or differential inputs
  • Automatic incremental channel selection
  • PCF8591 analog voltage range from VSS to VDD
  • PCF8591 built-in track and hold circuit
  • 8-bit successive approximation A / D converter through an analog output DAC gain.
  • module supports external voltage input capture (input voltage range 0-5v)
  • The five-module integrated 1 channel 0-5V voltage input acquisition (blue potentiometer to adjust the input voltage).
  • High quality PCB FR4 Grade with FPT Certified.

BLOCK DIAGRAM

PCF8591 AD/DA Converter Module PIN Description:

  • AOUT chip DA output interface 
  • AINO chip analog input interface 0
  • AIN1 chip analog input interface 1
  • AIN2 chip analog input interface 2
  • AIN3 chip analog input interface 3
  • SCL  IIC interface clock  microcontroller IO port
  • SDA IIC digital interface by microcontroller IO port
  • GND module to earth
  • VCC power supply interface  3.3 v to 5 v.

PCF8591 AD/DA Converter Module Circuit Diagram

CODES

ATMEL
http://researchdesignlab.com/ad/da-atmel-code.html
RASBERRY PI
https://drive.google.com/file/d/0BzrGD4zr88GnWWExa2l2SnBtOVk/view?pli=1

NOTE:you can connect from AN0 to AN0,AN1,AN2,AN3 n check the variation  of the corresponding analog pin

ARDUINO CODE

/*
* Project name:
PCF8591 AD/DA Converter Module
* Copyright
(c) Researchdesignlab.com
* Description:
* Test configuration:
MCU: ATMEGA328
Dev.Board: Arduinouno
Oscillator: 16 MHz
Software: Arduino
*/
#include <Wire.h>
#define PCF8591 (0x90>> 1)                                    
// I2C bus address
#define ADC00x00                                                   
// control bytes for reading individual ADCs
#define ADC10x01
#define ADC20x02
#define ADC30x03
byte value0, value1, value2, value3;
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
Wire.beginTransmission(PCF8591);                                      
// wake up PCF8591
Wire.write(ADC0);                                                                
// control byte - read ADC0
Wire.endTransmission();                                                        
// end tranmission
Wire.requestFrom(PCF8591, 2);
value0=Wire.read();
value0=Wire.read();
Wire.beginTransmission(PCF8591);                                      
// wake up PCF8591
Wire.write(ADC1);                                                                
// control byte - read ADC1
Wire.endTransmission();
// end tranmission
Wire.requestFrom(PCF8591, 2);
value1=Wire.read();
value1=Wire.read();
Wire.beginTransmission(PCF8591);                          
// wake up PCF8591
Wire.write(ADC2);                                                    
// control byte - read ADC2
Wire.endTransmission();                                            
// end tranmission
Wire.requestFrom(PCF8591, 2);
value2=Wire.read();
value2=Wire.read();
Wire.beginTransmission(PCF8591);                          
// wake up PCF8591
Wire.write(ADC3);                                                    
// control byte - read ADC3
Wire.endTransmission();                                            
// end tranmission
Wire.requestFrom(PCF8591, 2);
value3=Wire.read();

value3=Wire.read();
Serial.print(value0);
Serial.print(" ");
Serial.print(value1);
Serial.print(" ");
Serial.print(value2);
Serial.print(" ");
Serial.print(value3);

Serial.print(" ");
Serial.println();
delay(1000);
}

OUTPUT

RELATED PRODUCTS


Bi-Directional Logic Level Converter         DC-DC Adjustable step up power converter module LM2577 4-35V