Quantcast
Channel: Other Projects - PIC Microcontroller
Viewing all 223 articles
Browse latest View live

MTM Scientific, Inc… PIC Project for CATV Tuner

$
0
0

The CATV Tuner sold by MTM Scientific, Inc can be used for wideband audio and video reception, as described on our other project pages such as the FM Wideband Receiver and Radio Telescope Project. A common requirement in all these projects is the need to program the CATV tuner with a serial bit stream to establish operating frequency. We have previously described a method which uses a computer’s parallel port with software, and another method which uses DIP switches with CMOS circuitry. Here we present a 3rd way of programming the tuner by using a PIC microcontroller, more specifically a PICAXE-08M. Here is the circuit diagram for connecting the PICAXE chip to the CATV Tuner. The PICAXE-08M chip provides three signals to the tuner: Enable, Data and Clock.  The Enable line prepares the tuner to accept a programming signal, the Clock line establishes the communicaton rate, and the Data line is the actual bit data.

MTM Scientific, Inc... PIC Project for CATV Tuner

The PICAXE chip must be supplied with a well regulated +5VDC source. Also, the tuner must be supplied with +5VDC, and additionally voltages of +12 VDC and +30 VDC. (In the photo example, two +15 VDC supplies were connected in series to create +30 VDC, and the +5 and +12 voltages were derived using LM05 and LM12 regulators off the lower +15 VDC supply.)

The code for the PICAXE chip is written in a very simple programming language which is specific to the PICAXE controller chips.  The source code is listed below in the appendix. As written, this code will tune to UHF channel 37, for doing Radio Astronomy. Of course, the source code can be modified for tuning a different frequency.

The program code is fairly simple and self explanatory. The code generates the clock signal using software, and programs each of 27 bits in the data line to be either ON or OFF. The purpose of the 27 bits is for programming the tuner. Each programming bit has a specific purpose. We have written a short explanation of the programming bits in a tutorial available here: 27 Bit Tutorial

The PICAXE chips are available from fellow hobbyist Phil Anderson. Here is a link to his site: http://www.phanderson.com/picaxe/

MTM Scientific, Inc... PIC Project for CATV Tuner

The free software for programming the PICAXE chips with the source code (via a serial port connection) is available at this site: http://www.rev-ed.co.uk/picaxe/

Of course, this simple project is only the start of what is possible with the CATV Tuner and a PICAXE chip. Obvious next steps would be to monitor the LOCK signal from the tuner, program the chip to scan frequencies, or even add a numeric keyboard interface and LCD display. If you do happen to develop a good PICAXE based project for the tuner, please forward it to us here at MTM and we will post the details for other experimenters to use.

For more detail: MTM Scientific, Inc… PIC Project for CATV Tuner

The post MTM Scientific, Inc… PIC Project for CATV Tuner appeared first on PIC Microcontroller.


Microcontroller Based Password Verification System

$
0
0

Aim: –

To simulate a circuit using microcontroller 8051 for verifying password.

Theory: –

The block diagram for microcontroller based password verifying system is shown. The purpose of the circuit is to verify the password entered by the user.

An 8-bit password is the input to this system (A simple example has purposely been dealt with here for the convenience of an average student. The student may modify the circuit and program to try 16 or higher bit password input as an intellectual exercise). In the first section of the circuit the password entered by the user (user-password) is compared with the actual password (password set in the microcontroller using the microprogram) by the microcontroller. The result of the comparison process is an 8-bit output at the output port, which is fed to a logic circuit. If the user-password is correct, the output of the logic circuit will be high. The high output of the logic circuit enables the AND gate in the next section, which has an asynchronous counter as its second input. The digital output of the AND gate is converted to the corresponding analog voltage using a 12-bit DAC.

Microcontroller Based Password Verification System

A microcontroller is a single chip microcomputer, which contains CPU, ROM/ EPROM, RAM and I/O ports. The main features of 8051 microcontroller are: –

    • 8-bit CPU optimized for control applications,
    • extensive Boolean processing capabilities,
    • 64K Program Memory address space,
    • 64K Data Memory address space,
    • 4K bytes of on-chip Program memory,
    • 128 bytes of on-chip Data RAM,
    • 32 bi-directional and individually addressable I/O lines,
    • two 16 bit timers/ counters- Timer 0 and Timer 1,
    • Full Duplex serial port,
    • 6-source/ 5-vector interrupt structure with two priority levels and
    • On-chip clock oscillator.

Memory can be extended using external EPROM and RAM. 8051 contains an ALU, Timing and Control Unit, Accumulator, B register, PSW (Program Status Word), Stack Pointer, Data Pointer, Timer Registers, Serial Buffer, Program Counter, RAM Address Register, Program Address Register, Instruction Register, Control Registers etc. 8051 is a 40-pin chip operating with 12MHz clock and a single +5V supply. The 8051 has 111 instructions: 49 single byte, 45 two-byte and 17 three-byte.

The comparison operation within the microcontroller is performed by means of instructions fed to it known as microprogram. The microprogram constitutes instructions called microinstructions. Our microprogram has microinstructions for setting the password as 0x21 and comparing it with the user-password. If the user-password is correct, the port- P0 gives 8-bit digital output equivalent to 0x0F. If not, the output will be 0xFF and the user again has the option to enter the password. The output of the microcontroller (8-bit digital output) is fed to a logic circuit, which consists of a four input AND gate and a four input NOR gate and an AND gate. The lower order four bits of port- P0 of the microcontroller are fed to the AND gate so that its output is high only when all the four lower order bits are high. The higher order four bits of port- P0 are connected to the NOR gate so that its output is high only when all the four higher order bits of P0 are low. These two outputs are fed to the AND gate which produces a high output only when both its inputs are high. In other words, the output of the logic circuit is high only when the user-password is correct.

The high output of the logic circuit enables the AND gate in the next section. The asynchronous counter is realized using D-Flip-flops, inverters, four-input NAND gates and XOR gate as shown in the circuit diagram. The asynchronous counter output is passed to the Digital to Analog Converter (DAC) through the AND gate only when the password entered is correct. As the counter counts, an equivalent analog voltage is generated using the DAC.

Microcontroller Based Password Verification System schematic

The Digital to Analog Converter used here is LTC1450CG. This device has 12 input data pins. This DAC has an output buffer amplifier, reference (voltage) and a double buffered parallel digital interface. The digital data is fed to twelve data lines. The analog output voltage is obtained from the Vout pin. Depending upon the logic state of the CLR, WR, CSLSB, CSMSB and the LDAC pins, the input data is loaded and latched into the 12 bit DAC latch present within the DAC. The output buffer is configured such that the gain is 2 by setting the Gain/Gain2 pin to ground. The analog voltage from the DAC (i.e. the output of the whole system) indicates the correct entry of password. Otherwise, the DAC output is null. Thus the microcontroller performs the password verification.

For more detail: Microcontroller Based Password Verification System

The post Microcontroller Based Password Verification System appeared first on PIC Microcontroller.

IO Controller with serial port CLI using PIC16F627A

$
0
0

This code runs on a PIC 16F627A or 628A (and A.F.A.I.K 627/628 parts).  It uses the serial USART on the PIC to communicate with a PC. Through this a simple CLI (Command Line Interface) is implemented that allows commands to be sent to the PIC to control output lines and read and return the status of inputs on the PIC

The serial interface is configured to operate at 9600bps, 8bits, No Parity, 1 stop bit.

IO Controller with serial port CLI

Port A is configured as the output port, not forgetting that RA4 is an ‘input only’.  Port B is used as the input port, again RB1 and RB2 are used by the PIC USART so aren’t available. In addition I have reserved RB0 for a Dallas 1-wire interface. Although the code isn’t implemented here, the RB0 port along with RB1 and RB2 is masked from the input status command so bits RB2,1,0 always return 0.

To summarise;
Outputs are RA0-3, RA5-7
Inputs are RB3-7

The CLI commands and functions are described below:

;
; Code displays the following message after a reset
; ‘PIC Serial IO controller ready’
; A ‘#’ is used as the command prompt.
; A ‘?’ is sent to the terminal when any command is either not
; recognised, or contains invalid or insufficient arguments.
;
; Commands (All commands are lowercase except the Restart command)
;
; v – display firmware version
; i – display value on input port
; o – display value of outputReg variable (see below)
; nx – set output bit x
; fx – clear output bit x
; tx – toggle output bit x
;   where x is in the range 1 to 8 or 0 to operate on all bits simultaneously
; sxxxxxxxx/ – set output to bit pattern specified by xxxxxxxx mask
;   where x must be 0 or 1. MSB is leftmost.
; All 8 bits must be specified and must terminate with ‘/’
;
; c – Continuous monitor and display of the input port
; . – Stop continuous monitor of the input port and return to command prompt
;
; m[io] – Toggle port value display format [ i = input, o = output ]
;   displays port value as hex ‘HH’ or binary ‘bbbbbbbb’ MSB leftmost
;   At startup the format will be hex.
;
; p[io] – Toggles between displaying the port status only, or printing a text string
;   followed by the port status.
;   e.g. with text “Input status : A5”, without “A5”
;   At startup print mode will be port status only, no preceding text.
;
; w[ed] – Enable or Disable the weak pull-up feature on Port B
;   Weak Pull Up is disabled at startup.
;
; R – Do a software restart (note: Uppercase R)
;
;
; Note: All output commands work on the outputReg memory variable.
; This is copied to the output port register on completion of each command.
; The show output port command does not read the port register, it reads
; and displays the value in the outputReg memory variable.

Screen dump of a sample terminal session

  • Source Code (ZIP archive)
  • Hex (right-click Save As) for 16F627A (also tested with 16F628A)

Notes:

  • There are no schematics for this since it’s designed as a building block.  You will need to interface pins RB1 and RB2 to a serial interface. RB1 is RXD input and RB2 is TXD output.  The code configures the PIC to use the internal 4Mhz oscillator so no external crystal is needed.

 

For more detail: IO Controller with serial port CLI using PIC16F627A

The post IO Controller with serial port CLI using PIC16F627A appeared first on PIC Microcontroller.

IR Tracking Turret with PIC and C

$
0
0

This is a good learning project that is fun to build – I got a lot out of making it. I think this has been done quite a bit already, but I did not find a straightforward way of doing this with PICs. When I finally got it working, I thought I’d share it. It might be useful for someone that wants to learn or apply I2C, Interrupts and Callbacks, PWM, or Servo Control.

Basic Functionality

Detects and tracks an infrared light source. Pans or tilts when the light source moves away from the center of the frame, attempting to keep it in the center.

Main Components

  • Pixart IR Camera
  • PIC16F1503 (a 14-pin, 8-bit PIC microcontroller)
  • Voltage Regulator
  • Servos

Assumptions

  • You can solder and desolder through-hole components
  • You have a computer
  • You can read a data sheet

IR Tracking Turret with PIC and CTake-Away Skills

  • 8-bit PIC programming in C using MPLAB X, XC8 and MPLAB X Code Configurator
  • I2C Protocol
  • Using microcontroller timers
  • PWM servo control, and getting maximum resolution in movement
  • Using an adjustable voltage regulator

You might also learn a little about

  • IR Wavelengths
  • Camera field of view
  • Using one power source for servos and microcontroller
  • Calibrating the Pixart camera module
  • Making something with room for expansion

No PCB etching required 🙂 I made this with stripboard and just cut traces and added jumpers where needed. It is also doable on a small breadboard. My first prototype fit the voltage regulator and main board components on one 17×10 breadboard.

This project should cost less than 25 EUR even if you have no spare parts laying around.

There are unused pins on the PIC16F1503 and I’ve included male headers for all pins in the stripboard pcb, so in-circuit programming is possible and there is room for expansion (another servo, more sensors, rocket launchers…).

Step 1: Tools and Materials

Most of this stuff you already have. You can use any sort of proto-board you want, but I recommend the strip kind for this project since I designed the PCBs using them.

Tools

  • Soldering Iron
  • Desoldernig braid
  • Small hacksaw
  • Heatshrink tubing ~5mm
  • Pickit3-compatible programmer

Optional Tools

  • hobby knife
  • debug header for PIC16F1503

Materials

  • Solder
  • Stripboard PCB
  • 10x20cm female-female breadboard wires
  • 6x10cm female-female breadboard wires
  • Assorted jumper wires
  • 4×1.5v batteries and holder (AA recommended)
  • 3V coin battery (CR2430 or CR2450 recommended)

Optional Materials

  • Double sided tape
  • Electrical tape
  • Tic-Tac boxes
  • ESD component capsules

Step 2: Components

You can find a broken WiiMote for cheap,I got one from Game Over in Amsterdam for 1 EUR. Broken WiiMotes are usually easy to find and the camera module is almost always OK – it’s the buttons that wear out.

Pixart Camera Board

  • 1.5×1.3cm pice of stripboard (6×5 holes, with 5 holes along the strip)
  • 6×1 male header
  • 3×2 or two 3×1 male headers
  • Something to pot the camera connections

For the camera module

Front of Camera (bottom view)

7 5 3 1
8 6 4 2

  • Remove it from the WiiMote – desoldering braid works best, but I did manage to remove two intact with a blowtorch 🙂
  • Clip pins 3 and 4 – we don’t need them
  • Nudge pins 5 and 6 a little toward the center and nudge the other as necessary to make them line up with the pins on the 3×2 or two 3×1 headers
  • Solder the camera pins to the header pins
  • Test the continuity of the connections
  • Pot the soldered connections in sugru, silicone, etc. – or just carefully wrap it with a piece of tape 🙂
  • Done!

Voltage Regulator Board

  • 2.4×1.2cm piece of stripboard (9×4, with 9 holes along the strip)
  • LM317
  • 240 ohm resistor (I used two 120 ohm in series)
  • 380 ohm resistor
  • .1 uF capcitor
  • 3300 uF capacitor (you can get this from the WiiMote as well, else anything comparable will do)
  • 4×1 male header

Main Board

  • 4x4cm piece of stripboard (15×15 holes)
  • 2x 7×1 make headers
  • 2x 6×1 male header
  • 4×1 male header
  • PIC16F1503
  • 25MHz oscillator
  • Red LED
  • 1x 220 ohm resistor
  • 2x 2.2K ohm resistor
  • .1 uF capacitor

Notes

Headers: Right-angle or straight will work – I actually wish I had used right-angle headers on the main board to keep things flatter.

Step 3: Design

This was intended to be an inexpensive learning project with room for expansion, simple enough to put on a small breadboard, programmed and assembled without too much difficulty.

Requirements

  • Tracks at least one beacon 1-4 meters away, and pans/tils to keep it in frame
  • Around a 20 EUR build
  • Relatively small and light (all boards, servos and wiring, without batttery ~40g)
  • Runs off 6VDC
  • Reacts quickly to movement
  • Broken into modules
  • Camera module board as small as possible
  • Room for expansion

As a bonus to you, there is also room for improvement 🙂

IR Tracking Turret with PIC and C Schematic

Why Stripboard?

I did not feel like making one from scratch for this – since the circuit is not very complex I thought I would tr to use proto board. I had worked out the circuit to be pretty compact on the breadboard and wanted to move it easily to the PCB, so I chose stripboard. With a few cuts and some jumpers I was able to keep things within 4×4 cm for the main board.

Why the WiiMote?

The camera module in the WiiMote uses an I2C interface and does all the heavy lifting for you. It provides pixel coordinates for up to 4 IR beacons, so you can easily figure out how much to pan/tilt to center the target. It has a high frame rate – something like 50 fps, so it can quickly detect and react to rapid movement. You can also configure it when initializing it to tune it to your use.

There are a lot of very informative sites out there that fully explain every aspect of this module. Finally – most broken WiiMotes have a fully functional camera inside and can be had for a buck or two. Cheap, readily available and does exactly what I needed for this build.

Why 8-Bit PIC?

They are powerful enough for this project, cheap and readily available in most regions. There is good support for both assembler and C. The development tools are all free. Programmers are reasonable. Plus, with the PIC16F1503 you can use code generation tools in MPLABX (Microchip’s programming IDE). Unfortunately this PIC does not have built-in debugging capabilities – you need a header to do that. But with this project you should not need one – it is pretty straightforward, and a good intro project for someone past the blinky stage.

 

For more detail: IR Tracking Turret with PIC and C

The post IR Tracking Turret with PIC and C appeared first on PIC Microcontroller.

Push Button as Input and Led as Output with Pic Microcontroller

$
0
0

This is a simple tutorial/project on how to interface a transistor (2n2222), led and push button with Pic microcontroller. In the project i am going to switch on and off(blink) an led with the help of a push button. Since transistors are used at outputs we can drive heavy loads with the same circuit. Pic16f877 microcontroller is used in the project. Port-B of Pic16f877 is used as output port. Port-B of pic16f877 is an 8-bit port. 8 transistors are connected to the General purpose input/output pins (gpio’s) of this port. Transistors bases are connected directly to the pins of port-b. Led’s are connected to emitter side of transistor in series to a 560 ohm resistor. Collector side of each transistor is supplied an external 5 volt signal.

An external 20 Mhz crystal is used to supply clock to microcontroller. Crystal is attached to microcontroller in parallel to two 33 pf capacitors. Push button is attached to Port-D Pin#7. 1 K resistor is attached in series to a push button, other leg of push button is attached to +5v signal. 

Led with Pic Microcontroller

Led with Pic Microcontroller

Push Button and Led with PIC16f877a microcontroller
Code is written using MPLAB-IDE and High Tech C compiler is used to compile code and generate Intel hex file of the code. First the necessary header file htc.h is included in the code. This header file is necessary to be included in every code that is written in MPLAB-IDE and uses High Tech C compiler to compile the code. If you didn’t include this header file in your code the htc(high tech c compiler) compiler will be unable to recognize the code. This header file tells the htc compiler that this is his code and he has to compile it.

_XTAL_FREQ 20e6 statement is specifying the crystal frequency that is attached to the microcontroller. I am Using 20 Mhz external crystal with the controller so i specified 20e6(Equivalent to 20e6=20,000,000).

Statement #define Input RD7 is defining Port-D Pin#7 as Input. Now we can access Port-D Pin#7 with the name ‘Input’. TRISB=0x00; Statement is declaring Port-B as Output. TRISD=0x80; Statement is declaring Port-D Pin#7 as Input. (0x80=1000 00000

The post Push Button as Input and Led as Output with Pic Microcontroller appeared first on PIC Microcontroller.

PicKit2 Clone Designed and Manufactured at Home

$
0
0
PicKit2 is a programmer designed by Microchip to program its pic microcontrollers. PicKit2 supports many 8-bit pic microcontroller series. PicKit2 supports almost all Pic-10/12/16/18/24 and dspic-30/33 flash series microcontroller’s. Pickit 2 is an ICSP (In-circuit serial programmer) programmer. In icsp interface, microcontroller can be programmed while its working in the circuit. An icsp programmer uses 5 pins to program the target microcontroller. Pickit 2 uses an on board pic18f2550 microcontroller that programs the target microcontroller. Pic18f2550 communicates with the computer software using its usb interface and talks with the target microcontroller using its icsp interface. Thanks to microchip that they released the pic18f2550 program software. Now one can reverse the pickit 2 circuit can make pickit 2 programmer at home as a diy project.

Pickit 2 requires the following pic microcontroller pins to program it. 

  • PGC   (Clock input to microcontroller)
  • PGD   (Data Input to microcontroller)
  • Vpp    (Programming Mode voltage)
  • Vdd    (Power Pin Apply 5v to it)
  •  Gnd    (Ground this Pin)

To program a pic microcontroller one have to Identify the upper 5 pins on his pic microcontroller and then make connections with the pickit 2 icsp header. See the datasheet of your pic microcontroller to Identify these pins and then connect the signals from PicKit2 to these pins. Normally all the pic microcontrollers have icsp pins located on the pin numbers given below.

5459479_orig
If you use the circuit given at tiktakx.wordpress.com you will be unable to load the boot loader, if in case it is corrupted. You than have to manually remove the Pic18F2550-ICSP controller from Kit and reprogram it from another Pickit2. Circuit diagram of the clone is given below.
7829161_orig
My final kit is below. I made Pickit2 and program executor on a single board. I program Pic microcontroller on one side, then remove the controller, put it on other side of zif socket, apply power and my program starts executing.

The post PicKit2 Clone Designed and Manufactured at Home appeared first on PIC Microcontroller.

Interfacing SD card with PIC12F1822 (Raw data read)

$
0
0

With the tiny microcontroller PIC12F1822 we can read raw data (sectors) stored in the SD card. The SD card can work in SPI mode which makes our interfacing more better since the PIC12F1822 MCU has a built-in SPI module (MSSP module).
This post shows how to interface the SD card with the PIC12F1822 microcontroller in order to read the raw data stored in it (the SD card).
SD card raw data means that there is no use of system files like FAT16 or FAT32. Serial monitor is used to display the data after reading it and here the UART protocol is used.
the link below shows a small PIC12F1822 MCU UART example:
PIC12F1822 UART example with CCS C compiler
In this project I used the MMC/SD card driver for CCS C compiler which is described in the post at the link below:
MMC/SD Card driver for CCS PIC C compiler
Hardware Required:

  • PIC12F1822 microcontroller
  • SD Card
  • AMS1117 3.3V voltage regulator
  • 3 x 3.3K ohm resistor
  • 3 x 2.2K ohm resistor
  • 10K ohm resistor
  • 5 x 10uF polarized capacitor
  • 100nF ceramic capacitor
  • MAX232 chip
  • Female RS232 connector
  • 5V Power source
  • Breadboard
  • Jumper wires

Interfacing SD card with PIC12F1822 MCU circuit:

pic12f1822-spi-mmc-sd-card-sector-read

for more detail:  Interfacing SD card with PIC12F1822 (Raw data read)

The post Interfacing SD card with PIC12F1822 (Raw data read) appeared first on PIC Microcontroller.

Automatic Railway Gate Control System Using PIC16F877A microcontroller

$
0
0

Generally railway gates are closed or opened menually by gatekeeper to prevent collision between road traffic and train . Time schedule and other information are sent from the main controller station menually in this tutorial we will try to make a railway line which has automatic gate open and closed system .

Hello everybody ,welcome
In this tutorial we will describe how to make automatic railway system using PIC microcontroller . Before that you need to know about working principle of railway system . When road cross railway line then traffic must wait and let the train pass , to prevent the collision . For that train time should be fixed and set inside the microcontroller and that perticular time the gate of train will open and road side traffic should wait and let train pass . The concept behind this project is very simple and is intended for beginner as a learning purpose . In this content we will only show you design concept in simulation based , but you can design your own concept in the real hardware .

Automatic Railway Gate Control System Using PIC16F877A microcontroller (Schematic Diagram)

Automatic Railway Gate Control System Using PIC16F877A microcontroller schematioc diagram

The post Automatic Railway Gate Control System Using PIC16F877A microcontroller appeared first on PIC Microcontroller.


The ‘One Chip Spinning RGB POV Display’ with conversion software using PIC18f4680

$
0
0

The ‘One Chip Spinning RGB POV Display’ with conversion software.

If you have been on the look out for a project that combines, RGB LED’s, a motor, a microcontroller and a ridiculous amount of hot melt glue, then you have certainly come to the right place.

One Chip Spinning RGB POV Display
Allow me to introduce the ‘One Chip’ Spinning RGB POV Display

This project allows you to create (with minimal components) a fantastic customizable display capable of displaying graphics, animations and text. You can scroll your graphics from top to bottom or use it as a scrolling message display, scrolling from right to left.

The project uses just one chip, eight RGB LED’s and a handful of other components to paint animations in ‘mid-air!’ Plus, together with the included graphic conversion software (download link in step 2) you can easily create your own animations because the software creates all the code for you.

So please, read on and enjoy!

Step 1

Get your required parts and tools.

Before we set out on this venture, you will need both the components and tools.

Parts List:

1x PIC 18f4680 microcontroller
1 x 40 pin IC socket (optional – to house the microcontroller)
8 x Common cathode RGB LED’s
24 x 100 ohm resistors (any wattage)
1 x 0.1 uF capacitor (optional)
2 x 100 uF capacitors
1 x 7805 (5 Volt Regulator)
2 x 10k ohm resistors
1 x hall effect sensor / hall effect switch
1 x 5 pin header (to plug in the pickit2 programmer)
1 x small rare earth magnet (to be used with the sensor)
1 x screw in type mains wiring terminator (See last photo – you get these from a hardware store)
1 x 12v motor
1 x motor (any motor that you can destroy for parts – I.E. the graphite brushes)
1 x 12v powersupply (for the motor)
1 x 7.5 volt power supply (for the POV display – can be upto about 18v)
1 x (5.5cm x 5.5cm blank pcb – aka blank copper clad) – this will be used to transfer power to the display
Holt Melt Glue Sticks
Solder
Veroboard / experimenters board
Thin enamel wire (see pic)
Standard single core wire (Like they use in network cable)

Tools:

– Soldering Iron
– Screw Driver
– hot melt glue gun
– Stanley knife
– side cutters
– pliers
– pickit2 programmer
– desoldering tool (solder sucker or solder braid – just in case!)
– computer running windows
– swordfish basic compiler (this is a free download – it compiles the code for the microcontroller)
– POV Image Converter (Software that I have made, download link is included in the instructable)Now that you have all of that, let’s get into the construction.

Step 2

Downloads

First and foremost, you will want to download the schematic so that you are not building this blindly, and perhaps you may want to experiment with the conversion software also. All these downloads are provided here:

Please read the readme.txt file for instructions on how to install the software.

Click this link to download the schematic:
http://www.bradsprojects.com/forum/download/file.php?id=297

Click this link to download the scroll down conversion software:
http://www.bradsprojects.com/forum/download/file.php?id=294

Click this link to download the scroll left conversion software:
http://www.bradsprojects.com/forum/download/file.php?id=290

Click this link to download swordfish basic (free version):
http://www.sfcompiler.co.uk/downloads/SwordfishSE.exe

Step 3

Let construction commence!

Now the beauty about this project is that you don’t have to make it exactly how I have made it.

my original intention was just for me to see how small a board I could fit this project onto. But as you will see, there is plenty of space to work with when we attach the main arm that connects the display to the motor. So by all means, have a look at my design – but there are certainly other ways (simpler ways) of achieving the desired outcome.

I have cut my board so that I have 26 holes by 10 holes.

Step 4

Solder in the LED’s and cut some tracks

I have used surface mount LED’s just to see how they would go (I have previously used through hole LED’s in a past project)

Solder the Red, Green and Blue connections to the board.

The three connections on the top are the cathodes. (this may differ for your LED’s – give them a quick check with your multimeter to verify)

You will also notice I have cut a line through the tracks connected to the LED’s. This is so we can solder in some series resistors to limit each LED’s current.

IMPORTANT NOTE: You need to make sure that the bottom LED is connected as your least significant LED. I.E. this led will connect to PORTA pin 0, PORTB pin 0 and PORT D pin 0. You then work your way up from there. Follow the schematic and you will be fine = )

Step 5

Solder in your resistors.

I have also used surface mount resistors to keep my project small, you may very well want to use through hole to make things a little easier.

The resistors solder in over the tracks that you have just cut.

Step 6

Cut some more tracks and solder in a ground wire.

Solder in your resistors
Now that the resistors are in place, you will want to cut another line of tracks on the other side of these resistors, getting them ready to solder to the microcontroller. – see the first photo

Once done, get a length of uninsulated wire and solder it along the length of the LED cathodes. then solder it to the veroboard (this will be our ground connection) – see second photo

Step 7

Time for a quick test.

Progressive tests are always a good thing, so let’s do one.

Grab a 5 volt power supply and solder your negative end to our ground connection. then with the positive side, connect it to each resistor one at a time – you should have each LED light up with the respective color as you work your way through all 24 connections.

It’s nice to pick up on faults before we get to carried away!

Step 8

Install the microcontroller, socket and cut some more tracks.

Now it is time to solder in the socket which will house the microcontroller. Or if you wish, just solder the microcontroller straight in (if it is to be a permanent arrangement).

Then you will need to cut a line of tracks so that we do not short each end of the microcontroller together. – see the last photo.

For more detail: The ‘One Chip Spinning RGB POV Display’ with conversion software using PIC18f4680

The post The ‘One Chip Spinning RGB POV Display’ with conversion software using PIC18f4680 appeared first on PIC Microcontroller.

Record Infrared Codes of Any Remote Control Unit for Usage with Linux Infrared Remote Control (LIRC) on Raspberry Pi

$
0
0

Introduction

The remote controls that are orphaned when the device they control stopped working are reusable on your Raspberry Pi. After completing this instructable, you may be interested in trying out the following instructables:

Reuse Unwanted Remote Control to Shutdown and Reboot Raspberry Pi

Reuse Unwanted Remote to Launch Graphical Application in Raspberry Pi

Scope

This instructable will show how to use program irrecord to:

  1. Capture infrared codes of any remote control
  2. Map the infrared codes with Linux Infrared Remote Control (LIRC) events

Target Readers

Anyone with Raspberry Pi that has infrared (IR) interface)

Any remote controlRecord Infrared Codes of Any Remote Control Unit for Usage with Linux Infrared Remote Control (LIRC) on Raspberry Pi

Step 1: Add Infrared Interface to Your Raspberry Pi

Complete the steps in my instructable of the above.

Step 2: Install Linux Infrared Remote Control (LIRC) package

The program irrecord is provided by the LIRC package.

Complete the steps in my instructable of the above.

Step 3: Test whether the remote control unit is transmitting any IR signal

Complete the steps in my instructable “Use Raspberry Pi To Test Your Remote Control”Record Infrared Codes of Any Remote Control Unit for Usage with Linux Infrared Remote Control (LIRC) on Raspberry Pi schmatic

Step 4: Record infrared (IR) codes of the remote control and map it to LIRC events

Get your remote control unit ready

Open terminal emulator of Raspberry Pi.

Stop the LIRC daemon

Run the program irrecord

When the irrecord program wizard ask you to map key names, open another terminal emulator and list all the possible key names available in LIRC so that you can choose the best one that fits your requirement. The output of the command below is shown in the screenshot

Finally, the irrecord program will process your input and create a configuration file ~/my_remote_control.conf as shown in the third screenshot.

 

For more detail: Record Infrared Codes of Any Remote Control Unit for Usage with Linux

Infrared Remote Control (LIRC) on Raspberry Pi

The post Record Infrared Codes of Any Remote Control Unit for Usage with Linux Infrared Remote Control (LIRC) on Raspberry Pi appeared first on PIC Microcontroller.

MTM Scientific, Inc… PIC Project for CATV Tuner

$
0
0

The CATV Tuner sold by MTM Scientific, Inc can be used for wideband audio and video reception, as described on our other project pages such as the FM Wideband Receiver and Radio Telescope Project. A common requirement in all these projects is the need to program the CATV tuner with a serial bit stream to establish operating frequency. We have previously described a method which uses a computer’s parallel port with software, and another method which uses DIP switches with CMOS circuitry. Here we present a 3rd way of programming the tuner by using a PIC microcontroller, more specifically a PICAXE-08M. Here is the circuit diagram for connecting the PICAXE chip to the CATV Tuner. The PICAXE-08M chip provides three signals to the tuner: Enable, Data and Clock.  The Enable line prepares the tuner to accept a programming signal, the Clock line establishes the communicaton rate, and the Data line is the actual bit data.

MTM Scientific, Inc... PIC Project for CATV Tuner

The PICAXE chip must be supplied with a well regulated +5VDC source. Also, the tuner must be supplied with +5VDC, and additionally voltages of +12 VDC and +30 VDC. (In the photo example, two +15 VDC supplies were connected in series to create +30 VDC, and the +5 and +12 voltages were derived using LM05 and LM12 regulators off the lower +15 VDC supply.)

The code for the PICAXE chip is written in a very simple programming language which is specific to the PICAXE controller chips.  The source code is listed below in the appendix. As written, this code will tune to UHF channel 37, for doing Radio Astronomy. Of course, the source code can be modified for tuning a different frequency.

The program code is fairly simple and self explanatory. The code generates the clock signal using software, and programs each of 27 bits in the data line to be either ON or OFF. The purpose of the 27 bits is for programming the tuner. Each programming bit has a specific purpose. We have written a short explanation of the programming bits in a tutorial available here: 27 Bit Tutorial

The PICAXE chips are available from fellow hobbyist Phil Anderson. Here is a link to his site: http://www.phanderson.com/picaxe/

MTM Scientific, Inc... PIC Project for CATV Tuner

The free software for programming the PICAXE chips with the source code (via a serial port connection) is available at this site: http://www.rev-ed.co.uk/picaxe/

Of course, this simple project is only the start of what is possible with the CATV Tuner and a PICAXE chip. Obvious next steps would be to monitor the LOCK signal from the tuner, program the chip to scan frequencies, or even add a numeric keyboard interface and LCD display. If you do happen to develop a good PICAXE based project for the tuner, please forward it to us here at MTM and we will post the details for other experimenters to use.

For more detail: MTM Scientific, Inc… PIC Project for CATV Tuner

The post MTM Scientific, Inc… PIC Project for CATV Tuner appeared first on PIC Microcontroller.

Microcontroller Based Password Verification System

$
0
0

Aim: –

To simulate a circuit using microcontroller 8051 for verifying password.

Theory: –

The block diagram for microcontroller based password verifying system is shown. The purpose of the circuit is to verify the password entered by the user.

An 8-bit password is the input to this system (A simple example has purposely been dealt with here for the convenience of an average student. The student may modify the circuit and program to try 16 or higher bit password input as an intellectual exercise). In the first section of the circuit the password entered by the user (user-password) is compared with the actual password (password set in the microcontroller using the microprogram) by the microcontroller. The result of the comparison process is an 8-bit output at the output port, which is fed to a logic circuit. If the user-password is correct, the output of the logic circuit will be high. The high output of the logic circuit enables the AND gate in the next section, which has an asynchronous counter as its second input. The digital output of the AND gate is converted to the corresponding analog voltage using a 12-bit DAC.

Microcontroller Based Password Verification System

A microcontroller is a single chip microcomputer, which contains CPU, ROM/ EPROM, RAM and I/O ports. The main features of 8051 microcontroller are: –

    • 8-bit CPU optimized for control applications,
    • extensive Boolean processing capabilities,
    • 64K Program Memory address space,
    • 64K Data Memory address space,
    • 4K bytes of on-chip Program memory,
    • 128 bytes of on-chip Data RAM,
    • 32 bi-directional and individually addressable I/O lines,
    • two 16 bit timers/ counters- Timer 0 and Timer 1,
    • Full Duplex serial port,
    • 6-source/ 5-vector interrupt structure with two priority levels and
    • On-chip clock oscillator.

Memory can be extended using external EPROM and RAM. 8051 contains an ALU, Timing and Control Unit, Accumulator, B register, PSW (Program Status Word), Stack Pointer, Data Pointer, Timer Registers, Serial Buffer, Program Counter, RAM Address Register, Program Address Register, Instruction Register, Control Registers etc. 8051 is a 40-pin chip operating with 12MHz clock and a single +5V supply. The 8051 has 111 instructions: 49 single byte, 45 two-byte and 17 three-byte.

The comparison operation within the microcontroller is performed by means of instructions fed to it known as microprogram. The microprogram constitutes instructions called microinstructions. Our microprogram has microinstructions for setting the password as 0x21 and comparing it with the user-password. If the user-password is correct, the port- P0 gives 8-bit digital output equivalent to 0x0F. If not, the output will be 0xFF and the user again has the option to enter the password. The output of the microcontroller (8-bit digital output) is fed to a logic circuit, which consists of a four input AND gate and a four input NOR gate and an AND gate. The lower order four bits of port- P0 of the microcontroller are fed to the AND gate so that its output is high only when all the four lower order bits are high. The higher order four bits of port- P0 are connected to the NOR gate so that its output is high only when all the four higher order bits of P0 are low. These two outputs are fed to the AND gate which produces a high output only when both its inputs are high. In other words, the output of the logic circuit is high only when the user-password is correct.

The high output of the logic circuit enables the AND gate in the next section. The asynchronous counter is realized using D-Flip-flops, inverters, four-input NAND gates and XOR gate as shown in the circuit diagram. The asynchronous counter output is passed to the Digital to Analog Converter (DAC) through the AND gate only when the password entered is correct. As the counter counts, an equivalent analog voltage is generated using the DAC.

Microcontroller Based Password Verification System schematic

The Digital to Analog Converter used here is LTC1450CG. This device has 12 input data pins. This DAC has an output buffer amplifier, reference (voltage) and a double buffered parallel digital interface. The digital data is fed to twelve data lines. The analog output voltage is obtained from the Vout pin. Depending upon the logic state of the CLR, WR, CSLSB, CSMSB and the LDAC pins, the input data is loaded and latched into the 12 bit DAC latch present within the DAC. The output buffer is configured such that the gain is 2 by setting the Gain/Gain2 pin to ground. The analog voltage from the DAC (i.e. the output of the whole system) indicates the correct entry of password. Otherwise, the DAC output is null. Thus the microcontroller performs the password verification.

For more detail: Microcontroller Based Password Verification System

The post Microcontroller Based Password Verification System appeared first on PIC Microcontroller.

IO Controller with serial port CLI using PIC16F627A

$
0
0

This code runs on a PIC 16F627A or 628A (and A.F.A.I.K 627/628 parts).  It uses the serial USART on the PIC to communicate with a PC. Through this a simple CLI (Command Line Interface) is implemented that allows commands to be sent to the PIC to control output lines and read and return the status of inputs on the PIC

The serial interface is configured to operate at 9600bps, 8bits, No Parity, 1 stop bit.

IO Controller with serial port CLI

Port A is configured as the output port, not forgetting that RA4 is an ‘input only’.  Port B is used as the input port, again RB1 and RB2 are used by the PIC USART so aren’t available. In addition I have reserved RB0 for a Dallas 1-wire interface. Although the code isn’t implemented here, the RB0 port along with RB1 and RB2 is masked from the input status command so bits RB2,1,0 always return 0.

To summarise;
Outputs are RA0-3, RA5-7
Inputs are RB3-7

The CLI commands and functions are described below:

;
; Code displays the following message after a reset
; ‘PIC Serial IO controller ready’
; A ‘#’ is used as the command prompt.
; A ‘?’ is sent to the terminal when any command is either not
; recognised, or contains invalid or insufficient arguments.
;
; Commands (All commands are lowercase except the Restart command)
;
; v – display firmware version
; i – display value on input port
; o – display value of outputReg variable (see below)
; nx – set output bit x
; fx – clear output bit x
; tx – toggle output bit x
;   where x is in the range 1 to 8 or 0 to operate on all bits simultaneously
; sxxxxxxxx/ – set output to bit pattern specified by xxxxxxxx mask
;   where x must be 0 or 1. MSB is leftmost.
; All 8 bits must be specified and must terminate with ‘/’
;
; c – Continuous monitor and display of the input port
; . – Stop continuous monitor of the input port and return to command prompt
;
; m[io] – Toggle port value display format [ i = input, o = output ]
;   displays port value as hex ‘HH’ or binary ‘bbbbbbbb’ MSB leftmost
;   At startup the format will be hex.
;
; p[io] – Toggles between displaying the port status only, or printing a text string
;   followed by the port status.
;   e.g. with text “Input status : A5”, without “A5”
;   At startup print mode will be port status only, no preceding text.
;
; w[ed] – Enable or Disable the weak pull-up feature on Port B
;   Weak Pull Up is disabled at startup.
;
; R – Do a software restart (note: Uppercase R)
;
;
; Note: All output commands work on the outputReg memory variable.
; This is copied to the output port register on completion of each command.
; The show output port command does not read the port register, it reads
; and displays the value in the outputReg memory variable.

Screen dump of a sample terminal session

  • Source Code (ZIP archive)
  • Hex (right-click Save As) for 16F627A (also tested with 16F628A)

Notes:

  • There are no schematics for this since it’s designed as a building block.  You will need to interface pins RB1 and RB2 to a serial interface. RB1 is RXD input and RB2 is TXD output.  The code configures the PIC to use the internal 4Mhz oscillator so no external crystal is needed.

 

For more detail: IO Controller with serial port CLI using PIC16F627A

The post IO Controller with serial port CLI using PIC16F627A appeared first on PIC Microcontroller.

IR Tracking Turret with PIC and C

$
0
0

This is a good learning project that is fun to build – I got a lot out of making it. I think this has been done quite a bit already, but I did not find a straightforward way of doing this with PICs. When I finally got it working, I thought I’d share it. It might be useful for someone that wants to learn or apply I2C, Interrupts and Callbacks, PWM, or Servo Control.

Basic Functionality

Detects and tracks an infrared light source. Pans or tilts when the light source moves away from the center of the frame, attempting to keep it in the center.

Main Components

  • Pixart IR Camera
  • PIC16F1503 (a 14-pin, 8-bit PIC microcontroller)
  • Voltage Regulator
  • Servos

Assumptions

  • You can solder and desolder through-hole components
  • You have a computer
  • You can read a data sheet

IR Tracking Turret with PIC and CTake-Away Skills

  • 8-bit PIC programming in C using MPLAB X, XC8 and MPLAB X Code Configurator
  • I2C Protocol
  • Using microcontroller timers
  • PWM servo control, and getting maximum resolution in movement
  • Using an adjustable voltage regulator

You might also learn a little about

  • IR Wavelengths
  • Camera field of view
  • Using one power source for servos and microcontroller
  • Calibrating the Pixart camera module
  • Making something with room for expansion

No PCB etching required 🙂 I made this with stripboard and just cut traces and added jumpers where needed. It is also doable on a small breadboard. My first prototype fit the voltage regulator and main board components on one 17×10 breadboard.

This project should cost less than 25 EUR even if you have no spare parts laying around.

There are unused pins on the PIC16F1503 and I’ve included male headers for all pins in the stripboard pcb, so in-circuit programming is possible and there is room for expansion (another servo, more sensors, rocket launchers…).

Step 1: Tools and Materials

Most of this stuff you already have. You can use any sort of proto-board you want, but I recommend the strip kind for this project since I designed the PCBs using them.

Tools

  • Soldering Iron
  • Desoldernig braid
  • Small hacksaw
  • Heatshrink tubing ~5mm
  • Pickit3-compatible programmer

Optional Tools

  • hobby knife
  • debug header for PIC16F1503

Materials

  • Solder
  • Stripboard PCB
  • 10x20cm female-female breadboard wires
  • 6x10cm female-female breadboard wires
  • Assorted jumper wires
  • 4×1.5v batteries and holder (AA recommended)
  • 3V coin battery (CR2430 or CR2450 recommended)

Optional Materials

  • Double sided tape
  • Electrical tape
  • Tic-Tac boxes
  • ESD component capsules

Step 2: Components

You can find a broken WiiMote for cheap,I got one from Game Over in Amsterdam for 1 EUR. Broken WiiMotes are usually easy to find and the camera module is almost always OK – it’s the buttons that wear out.

Pixart Camera Board

  • 1.5×1.3cm pice of stripboard (6×5 holes, with 5 holes along the strip)
  • 6×1 male header
  • 3×2 or two 3×1 male headers
  • Something to pot the camera connections

For the camera module

Front of Camera (bottom view)

7 5 3 1
8 6 4 2

  • Remove it from the WiiMote – desoldering braid works best, but I did manage to remove two intact with a blowtorch 🙂
  • Clip pins 3 and 4 – we don’t need them
  • Nudge pins 5 and 6 a little toward the center and nudge the other as necessary to make them line up with the pins on the 3×2 or two 3×1 headers
  • Solder the camera pins to the header pins
  • Test the continuity of the connections
  • Pot the soldered connections in sugru, silicone, etc. – or just carefully wrap it with a piece of tape 🙂
  • Done!

Voltage Regulator Board

  • 2.4×1.2cm piece of stripboard (9×4, with 9 holes along the strip)
  • LM317
  • 240 ohm resistor (I used two 120 ohm in series)
  • 380 ohm resistor
  • .1 uF capcitor
  • 3300 uF capacitor (you can get this from the WiiMote as well, else anything comparable will do)
  • 4×1 male header

Main Board

  • 4x4cm piece of stripboard (15×15 holes)
  • 2x 7×1 make headers
  • 2x 6×1 male header
  • 4×1 male header
  • PIC16F1503
  • 25MHz oscillator
  • Red LED
  • 1x 220 ohm resistor
  • 2x 2.2K ohm resistor
  • .1 uF capacitor

Notes

Headers: Right-angle or straight will work – I actually wish I had used right-angle headers on the main board to keep things flatter.

Step 3: Design

This was intended to be an inexpensive learning project with room for expansion, simple enough to put on a small breadboard, programmed and assembled without too much difficulty.

Requirements

  • Tracks at least one beacon 1-4 meters away, and pans/tils to keep it in frame
  • Around a 20 EUR build
  • Relatively small and light (all boards, servos and wiring, without batttery ~40g)
  • Runs off 6VDC
  • Reacts quickly to movement
  • Broken into modules
  • Camera module board as small as possible
  • Room for expansion

As a bonus to you, there is also room for improvement 🙂

IR Tracking Turret with PIC and C Schematic

Why Stripboard?

I did not feel like making one from scratch for this – since the circuit is not very complex I thought I would tr to use proto board. I had worked out the circuit to be pretty compact on the breadboard and wanted to move it easily to the PCB, so I chose stripboard. With a few cuts and some jumpers I was able to keep things within 4×4 cm for the main board.

Why the WiiMote?

The camera module in the WiiMote uses an I2C interface and does all the heavy lifting for you. It provides pixel coordinates for up to 4 IR beacons, so you can easily figure out how much to pan/tilt to center the target. It has a high frame rate – something like 50 fps, so it can quickly detect and react to rapid movement. You can also configure it when initializing it to tune it to your use.

There are a lot of very informative sites out there that fully explain every aspect of this module. Finally – most broken WiiMotes have a fully functional camera inside and can be had for a buck or two. Cheap, readily available and does exactly what I needed for this build.

Why 8-Bit PIC?

They are powerful enough for this project, cheap and readily available in most regions. There is good support for both assembler and C. The development tools are all free. Programmers are reasonable. Plus, with the PIC16F1503 you can use code generation tools in MPLABX (Microchip’s programming IDE). Unfortunately this PIC does not have built-in debugging capabilities – you need a header to do that. But with this project you should not need one – it is pretty straightforward, and a good intro project for someone past the blinky stage.

 

For more detail: IR Tracking Turret with PIC and C

The post IR Tracking Turret with PIC and C appeared first on PIC Microcontroller.

Push Button as Input and Led as Output with Pic Microcontroller

$
0
0

This is a simple tutorial/project on how to interface a transistor (2n2222), led and push button with Pic microcontroller. In the project i am going to switch on and off(blink) an led with the help of a push button. Since transistors are used at outputs we can drive heavy loads with the same circuit. Pic16f877 microcontroller is used in the project. Port-B of Pic16f877 is used as output port. Port-B of pic16f877 is an 8-bit port. 8 transistors are connected to the General purpose input/output pins (gpio’s) of this port. Transistors bases are connected directly to the pins of port-b. Led’s are connected to emitter side of transistor in series to a 560 ohm resistor. Collector side of each transistor is supplied an external 5 volt signal.

An external 20 Mhz crystal is used to supply clock to microcontroller. Crystal is attached to microcontroller in parallel to two 33 pf capacitors. Push button is attached to Port-D Pin#7. 1 K resistor is attached in series to a push button, other leg of push button is attached to +5v signal. 

Led with Pic Microcontroller

Led with Pic Microcontroller

Push Button and Led with PIC16f877a microcontroller
Code is written using MPLAB-IDE and High Tech C compiler is used to compile code and generate Intel hex file of the code. First the necessary header file htc.h is included in the code. This header file is necessary to be included in every code that is written in MPLAB-IDE and uses High Tech C compiler to compile the code. If you didn’t include this header file in your code the htc(high tech c compiler) compiler will be unable to recognize the code. This header file tells the htc compiler that this is his code and he has to compile it.

_XTAL_FREQ 20e6 statement is specifying the crystal frequency that is attached to the microcontroller. I am Using 20 Mhz external crystal with the controller so i specified 20e6(Equivalent to 20e6=20,000,000).

Statement #define Input RD7 is defining Port-D Pin#7 as Input. Now we can access Port-D Pin#7 with the name ‘Input’. TRISB=0x00; Statement is declaring Port-B as Output. TRISD=0x80; Statement is declaring Port-D Pin#7 as Input. (0x80=1000 00000

Current Project / Post can also be found using:

  • sample led circuit with microcontroller

The post Push Button as Input and Led as Output with Pic Microcontroller appeared first on PIC Microcontroller.


PicKit2 Clone Designed and Manufactured at Home

$
0
0
PicKit2 is a programmer designed by Microchip to program its pic microcontrollers. PicKit2 supports many 8-bit pic microcontroller series. PicKit2 supports almost all Pic-10/12/16/18/24 and dspic-30/33 flash series microcontroller’s. Pickit 2 is an ICSP (In-circuit serial programmer) programmer. In icsp interface, microcontroller can be programmed while its working in the circuit. An icsp programmer uses 5 pins to program the target microcontroller. Pickit 2 uses an on board pic18f2550 microcontroller that programs the target microcontroller. Pic18f2550 communicates with the computer software using its usb interface and talks with the target microcontroller using its icsp interface. Thanks to microchip that they released the pic18f2550 program software. Now one can reverse the pickit 2 circuit can make pickit 2 programmer at home as a diy project.

Pickit 2 requires the following pic microcontroller pins to program it. 

  • PGC   (Clock input to microcontroller)
  • PGD   (Data Input to microcontroller)
  • Vpp    (Programming Mode voltage)
  • Vdd    (Power Pin Apply 5v to it)
  •  Gnd    (Ground this Pin)

To program a pic microcontroller one have to Identify the upper 5 pins on his pic microcontroller and then make connections with the pickit 2 icsp header. See the datasheet of your pic microcontroller to Identify these pins and then connect the signals from PicKit2 to these pins. Normally all the pic microcontrollers have icsp pins located on the pin numbers given below.

5459479_orig
If you use the circuit given at tiktakx.wordpress.com you will be unable to load the boot loader, if in case it is corrupted. You than have to manually remove the Pic18F2550-ICSP controller from Kit and reprogram it from another Pickit2. Circuit diagram of the clone is given below.
7829161_orig
My final kit is below. I made Pickit2 and program executor on a single board. I program Pic microcontroller on one side, then remove the controller, put it on other side of zif socket, apply power and my program starts executing.

The post PicKit2 Clone Designed and Manufactured at Home appeared first on PIC Microcontroller.

Interfacing SD card with PIC12F1822 (Raw data read)

$
0
0

With the tiny microcontroller PIC12F1822 we can read raw data (sectors) stored in the SD card. The SD card can work in SPI mode which makes our interfacing more better since the PIC12F1822 MCU has a built-in SPI module (MSSP module).
This post shows how to interface the SD card with the PIC12F1822 microcontroller in order to read the raw data stored in it (the SD card).
SD card raw data means that there is no use of system files like FAT16 or FAT32. Serial monitor is used to display the data after reading it and here the UART protocol is used.
the link below shows a small PIC12F1822 MCU UART example:
PIC12F1822 UART example with CCS C compiler
In this project I used the MMC/SD card driver for CCS C compiler which is described in the post at the link below:
MMC/SD Card driver for CCS PIC C compiler
Hardware Required:

  • PIC12F1822 microcontroller
  • SD Card
  • AMS1117 3.3V voltage regulator
  • 3 x 3.3K ohm resistor
  • 3 x 2.2K ohm resistor
  • 10K ohm resistor
  • 5 x 10uF polarized capacitor
  • 100nF ceramic capacitor
  • MAX232 chip
  • Female RS232 connector
  • 5V Power source
  • Breadboard
  • Jumper wires

Interfacing SD card with PIC12F1822 MCU circuit:

pic12f1822-spi-mmc-sd-card-sector-read

for more detail:  Interfacing SD card with PIC12F1822 (Raw data read)

The post Interfacing SD card with PIC12F1822 (Raw data read) appeared first on PIC Microcontroller.

Automatic Railway Gate Control System Using PIC16F877A microcontroller

$
0
0

Generally railway gates are closed or opened menually by gatekeeper to prevent collision between road traffic and train . Time schedule and other information are sent from the main controller station menually in this tutorial we will try to make a railway line which has automatic gate open and closed system .

Hello everybody ,welcome
In this tutorial we will describe how to make automatic railway system using PIC microcontroller . Before that you need to know about working principle of railway system . When road cross railway line then traffic must wait and let the train pass , to prevent the collision . For that train time should be fixed and set inside the microcontroller and that perticular time the gate of train will open and road side traffic should wait and let train pass . The concept behind this project is very simple and is intended for beginner as a learning purpose . In this content we will only show you design concept in simulation based , but you can design your own concept in the real hardware .

Automatic Railway Gate Control System Using PIC16F877A microcontroller (Schematic Diagram)

Automatic Railway Gate Control System Using PIC16F877A microcontroller schematioc diagram

The post Automatic Railway Gate Control System Using PIC16F877A microcontroller appeared first on PIC Microcontroller.

IR Remote control transmitter and receiver using PIC12F1822 microcontroller

$
0
0
5-Channel IR remote control system using PIC microcontroller

This topic shows how to make a simple infrared (IR) remote control system using the microcontroller PIC12F1822. This IR system has two circuits as known: IR transmitter circuit and IR receiver circuit. Both circuit based on the same microcontroller type which is PIC12F1822.

IR Remote control transmitter and receiver using PIC12F1822 microcontroller
This IR system uses NEC communication protocol. To see how the NEC protocol works read the following topic which shows how to decode this communication protocol using PIC12F1822 microcontroller.
Extended NEC Protocol Decoder Using PIC12F1822 Microcontroller

Components List:
Transmitter Circuit:

  • PIC12F1822 Microcontroller
  • IR Transmitter
  • 2N2222 Transistor
  • 5 Push Buttons
  • 10k Resistor
  • 100Ohm Resistor
  • +5V Power Source
  • Protoboard
  • Jumper Wires

Receiver Circuit:

  • PIC12F1822 Microcontroller
  • IR Receiver
  • 5 LEDs
  • 10k Resistor
  • 5 x 470 Ohm Resistors
  • 47uF Capacitor
  • +5V Power Source
  • Protoboard
  • Jumper Wires

NEC Protocol IR transmitter (Encoder) using PIC12F1822:
The following image shows the IR system transmitter circuit schematic diagram.

In the circuit there 5 push buttons and each button sends a different IR signal code. The IR transmitter is the element that sends the IR signals to the IR receiver circuit.
The NPN transistor 2N2222 is used to drive the IR transmitter because the IR transmitter consumes high current and the microcontroller generally can’t provide that amount of current.
PIC12F1822 internal pull-ups are enabled by the software and the internal oscillator is used as usual.
NEC Protocol IR transmitter (Encoder) using PIC12F1822 CCS PIC C code:
This is the full code of microcontroller of the NEC IR transmitter.

IR Remote control transmitter and receiver using PIC12F1822 microcontroller schematics
The NEC protocol carrier frequency is 38KHz and to generate this frequency PIC12F1822 CCP module is used as a PWM module. The floowing CCS C line is used to configure the PWM module:
#use pwm (PWM1, FREQUENCY = 38KHz, DUTY = 25, PWM_OFF)
The internal oscillator is used and set to 8MHz with PLL enabled (8 x 4 = 32MHz). The following line is used for that:
setup_oscillator(OSC_8MHZ | OSC_PLL_ON);
In the circuit there are 5 push buttons connected to RA0, RA1, RA3, RA4 and RA5 which means that pins must be configured as inputs and the PWM pin as output.
Internal pull-ups are enabled for the input pins with the following line:
port_a_pullups(0x3B);
The five buttons transmit the following signals respectively:
0x40BF00FF — 0x40BF807F — 0x40BF40BF — 0x40BF20DF — 0x40BFA05F
1s and 0s are transmitted as:
Transmit 1 : pwm_on();
Transmit 0: pwm_off();
For example the transmission of 9ms burst pulse and 4.5ms space:
// Send 9ms burst
pwm_on();
delay_ms(9);
// Send 4.5ms space
pwm_off();
delay_us(4500);

Read more: IR Remote control transmitter and receiver using PIC12F1822 microcontroller 

The post IR Remote control transmitter and receiver using PIC12F1822 microcontroller appeared first on PIC Microcontroller.

PIC to PIC Communication using RF Module

$
0
0

Hello everyone, Today in this project, we will interface RF Receiver and Transmitter module with PIC Microcontroller and communicate between two different pic microcontrollers wirelessly.

PIC to PIC Communication using RF Module with Pic-microcontroller

In this project we will do following things:-

  1. We will use PIC16F877A for the Transmitter and PIC18F4520 for the Receiver section.
  2. We will interface Keypad and LCD with PIC microcontroller.
  3. On the transmitter side, we will Interface keypad with PIC and transmit the data. On the receiver side, we will receive the data wirelessly and show which key is pressed on the LCD.
  4. We will use encoder and decoder IC to transmit 4 bit data.
  5. Reception Frequency will be 433Mhz using cheap RF TX-RX module available in the market.

Before going into the schematics and codes, let’s understand the workings of RF module with Encoder-Decoder ICs. Also go through below two articles to learn how to interface LCD and Keypad with PIC Microcontroller:

433MHz RF Transmitter and Receiver Module:

433MHz RF Transmitter and Receiver Module

Those are the transmitter and receiver modules we are using in the project. It is the cheapest module available for 433 MHz These modules accepts serial data in one channel.

If we see the specifications of the modules, the transmitter is rated for 3.5-12V operation as input voltage and the transmit distance is 20-200 meters. It does transmit in AM (Audio Modulation) protocol at 433 MHz frequency. We can transfer data at a speed of 4KB/S with 10mW power.

433MHz-RF-Transmitter

In the upper image we can see the pin-out of the Transmitter module. From the left to right the pins are VCC, DATA and GND.  We can also add the antenna and solder it on the point denoted in the above image.

For the Receiver specification, the Receiver has a rating of 5V dc and 4MA Quiescent current as input. The receiving frequency is 433.92 MHz with a -105DB sensitivity.

433MHz-RF-Receiver

In the above image we can see the pin-out of the receiver module. The four pins are from Left to right, VCC, DATA, DATA and GND. Those middle two pins are internally connected. We can use any one or both. But it is a good practice to use both for lowering the noise coupling.

Also, one thing is not mentioned in the datasheet, the variable inductor or POT at the middle of the module is used for frequency calibration. If we couldn’t receive the transmitted data, there are possibilities that the transmitting and receiving frequencies are not matched. This is a RF circuit and we need to tune the transmitter at the perfect transmitted frequency point.  Also, same as the transmitter, this module also has an Antenna port; we can solder wire in coiled form for longer reception.

The transmission range is dependable on the voltage supplied to the Transmitter and the length of the antennas in both side. For this specific project we did not used external antenna and used 5V at the transmitter side. We checked with 5 meters distance and it worked perfectly.

Need of Encoder and Decoders:

This RF Sensor has few drawbacks:-

  1. One way communication.
  2. Only One channel
  3. Very Noise interference.

Due to this drawback we have used encoder and decoder ICs, HT12D and HT12ED stands for decoder which will be used in Receiver side and E stands for Encoder which will be used in Transmitter side. This ICs provide 4 channels. Also due to encoding and decoding the noise level is very low.

HT12D-and-HT12E-pinout

In the above image, left one is HT12D the decoder and right one is HT12E, the encoder one. Both ICs are identical. A0 to A7 is used for special encoding. We can use microcontroller pins to control those pins and set configurations. The same configurations need to be matched on the other side. If both configurations are accurate and matched, we can receive data. These 8 pins can be connected to Gnd or VCC or left open. Whatever configurations we do in the encoder, we need to match the connection on the decoder. In this project we will left open those 8 pins for both encoder and decoder. 9 and 18 pin is VSS and VDD respectively. We can use the VT pin in HT12D as notification purposes. For this project we did not used it. The TE pin is for transmission enable or disable pin.

The important part is the OSC pin where we need to connect resistors is to provide oscillation to the encoder and decoder. The decoder needs higher oscillation than the decoder. Typically the Encoder resistor value will be 1Meg and the Decoder value is 33k. We will use those resistors for our project.

DOUT pin is the RF Transmitter data pin on HT12E and DIN pin in the HT12D is used to connect the RF module data pin.

In HT12E, AD8 to AD11 is four channel input which gets converted and serially transmitted through RF module and the exact reverse thing happens in HT12D, the serial data received and decoded, and we get 4 bit parallel output across the 4 pins D8 to D11.

Components Required:

  1. 2 – Bread board
  2. 1 – LCD 16×2
  3. 1 – Keypad
  4. HT12D and HT12E pair
  5. RX-TX RF Module
  6. 1- 10K preset
  7. 2 – 4.7k resistor
  8. 1- 1M Resistor
  9. 1- 33k resistor
  10. 2- 33pF ceramic capacitors
  11. 1 – 20Mhz crystal
  12. Bergsticks
  13. Few single strand wires.
  14. PIC16F877A MCU
  15. PIC18F4520 MCU
  16. A screw driver for controlling the frequency pot, need to be insulated from human body.

Circuit Diagram:

Circuit Diagram for Transmitter side (PIC16F877A):

Circuit Diagram for Transmitter side using Pic-microcontorller

 

We have used PIC16F877A for Transmitting purpose. The Hex keypad connected across the PORTB and the 4 channels connected across last 4 bits of PORTD.

Pin out as follows-

1.AD11 = RD7

2.AD10 = RD6

3.AD9 = RD5

4.AD8 = RD4

Circuit Diagram for Receiver Side (PIC18F4520):

Circuit Diagram for Receiver Side using Pic-microcontroller

 

In the above image, the Receiver circuit is shown. The LCD is connected across PORTB. We used internal oscillator of PIC18F4520 for this project. The 4 channels are connected the same way as we did before in the transmitter circuit.

This is the Transmitter side

PIC-to-PIC-Communication-Transmitter-side-Circuit-Hardware using Pic-microcontroller

And receiver side in separate breadboard

PIC-to-PIC-Communication-Receiver-side-Circuit-Hardware using Pic-microcontroller

Code Explanation:

There are two parts of the code, one is for the Transmitter and one is for the Receiver. You can download complete code from here.

PIC16F877A code for RF Transmitter:

As always first, we need to set the configuration bits in the pic microcontroller, define some macros, including libraries and crystal frequency. The AD8-AD11 port of the Encoder ic is defined as RF_TX at PORTD. You can check code for all those in the complete code given at the end.

We used two functions, void system_init(void)  and void encode_rf_sender (char data).

The system_init is used for pin initialization and keyboard initializations. The keyboard initialization is called from the keypad library.

The keypad port is also defined in the keypad.h. We made the PORTD as output using TRISD = 0x00, and made the RF_TX port as 0x00 as default state.

void system_init(void){
    TRISD = 0x00;
    RF_TX = 0x00;
    keyboard_initialization();
}
In the encode_rf_sender we have changed the 4 pin state depending on the Button pressed. We have created 16different hex values or PORTD states depending on (4×4) 16 different button pressed.
void encode_rf_sender (char data){    
    if(data=='1')
    RF_TX=0x10;
    if(data=='2')
    RF_TX=0x20;
    if(data=='3')
    ………  …. ..
    …. ….

In the main function we first receive the keyboard button pressed data using switch_press_scan() function and store the data in key variable. After that we have encoded the data using encode_rf_sender() function and changing the PORTD status.

PIC18F4520 code for RF Receiver:

As always, we first set the configuration bits in PIC18f4520. Its little bit different from PIC16F877A, you can check the code in the attached zip file.

We included the LCD header file. Defined the D8-D11 port connection of Decoder IC across PORTD using #define RF_RX PORTD line, connection is same as used in the Encoder section. The LCD port declaration is also done in the lcd.c file.

#include <xc.h>
#include "supporing_cfile\lcd.h"
#define RF_RX PORTD

As stated before we are using internal oscillator for the 18F4520, we have used system_init function where we configured the OSCON register of the 18F4520 to set the internal oscillator for 8 MHz. We also set the TRIS bit for both LCD pins and the Decoder pins. As HT12D provides output at D8-D11 ports, we need to configure the PORTD as input to receive the output.

void system_init (void){
    OSCCON = 0b01111110; // 8Mhz, , intosc
    //OSCTUNE = 0b01001111; // PLL enable, Max prescaler 8x4 = 32Mhz    
    TRISB = 0x00;
    TRISD = 0xFF; // Last 4 bit as input bit.
}

We configured the OSCON register at 8 MHz, also made port B as output and port D as input.

Below function is made using the exact reverse logic used in the previous transmitter section. Here we get the same hex value from the port D and by that hex value we identify which switch was pressed in the transmitter section. We can identify each key press and submit the correspondent character to the LCD.

void rf_analysis (unsigned char recived_byte){    
        if(recived_byte==0x10)
        lcd_data('1');
        if(recived_byte==0x20)
        lcd_data('2');
        if(recived_byte==0x30)
       ……. ….. …
       … ………..

The lcd_data is called from the lcd.c file.

In the main function we first initialize the system and LCD. We took a variable byte, and stored the hex value received from port D. Then by the function rf_analysis we can print the character on LCD.

void main(void) {
    unsigned char byte = 0;
    system_init();
    lcd_init();   
    while(1){
        lcd_com(0x80); 
        lcd_puts("CircuitDigest");
        lcd_com (0xC0);        
        byte = RF_RX;                       
        rf_analysis(byte);
        lcd_com (0xC0);
    }
    return;
}

Before running it, we have tuned the circuit. First we have pressed the ‘D’ button in the keypad. So, the 0xF0 is being continuously transmitted by the RF transmitter. We then tuned the receiver circuit until the LCD shows the character ‘D’. Sometimes the module is tuned properly from the manufacturer, sometimes it is not. If everything is properly connected and not getting the button pressed value in the LCD then there are possibilities that the RF Receiver is not tuned. We have used the Insulated screwdriver for decreasing wrong tuning possibilities due to our body inductance.

This is how you can interface the RF Module to the PIC Microcontroller and communicate between two PIC microcontrollers wirelessly using RF Sensor.

You can download the complete code for Transmitter and Receiver from here, also check the demonstration Videobelow.

Code

PIC code for Transmitter Side:

/*
* File:   main.c
* Author: Sourav Gupta
* By:- circuitdigest.com
* Created on April 13, 2018, 2:26 PM
*/

// PIC16F877A Configuration Bit Settings

// ‘C’ source line config statements

// CONFIG
#pragma config FOSC = HS        // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON       // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF         // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF        // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF        // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)

 

#include <xc.h>
#include <stdio.h>
#include <string.h>
#include “supporing_cfile/Keypad.h”
#define RF_TX PORTD

/*
Hardware related definition
*/
#define _XTAL_FREQ 200000000 //Crystal Frequency, used in delay

/*
Other Specific definition
*/
void system_init(void);
void encode_rf_sender (char data);

void main(void){
system_init();
char Key = ‘n’;
while(1){

Key = switch_press_scan();
encode_rf_sender(Key);

}

}

/*
*  System Init
*/

void system_init(void){
TRISD = 0x00;
RF_TX = 0x00;
keyboard_initialization();
}
void encode_rf_sender (char data){
if(data==’1′)
RF_TX=0x10;
if(data==’2′)
RF_TX=0x20;
if(data==’3′)
RF_TX=0x30;
if(data==’4′)
RF_TX=0x40;
if(data==’5′)
RF_TX=0x50;
if(data==’6′)
RF_TX=0x60;
if(data==’7′)
RF_TX=0x70;
if(data==’8′)
RF_TX=0x80;
if(data==’9′)
RF_TX=0x90;
if(data==’0′)
RF_TX=0x00;
if(data==’*’)
RF_TX=0xa0;
if(data==’#’)
RF_TX=0xb0;
if(data==’A’)
RF_TX=0xc0;
if(data==’B’)
RF_TX=0xd0;
if(data==’C’)
RF_TX=0xe0;
if(data==’D’)
RF_TX=0xf0;
}

 

PIC code for Receiver Side:

 

/*
* File:   main.c
* Author: Sourav Gupta
*CircuitDigest.com
* Created on 17 May 2018, 12:18
*/

 

// PIC18F4520 Configuration Bit Settings

// ‘C’ source line config statements

// CONFIG1H
#pragma config OSC = INTIO7     // Oscillator Selection bits (Internal oscillator block, CLKO function on RA6, port function on RA7)
#pragma config FCMEN = OFF      // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
#pragma config IESO = OFF       // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)

// CONFIG2L
#pragma config PWRT = OFF       // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = SBORDIS  // Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled))
#pragma config BORV = 3         // Brown Out Reset Voltage bits (Minimum setting)

// CONFIG2H
#pragma config WDT = ON         // Watchdog Timer Enable bit (WDT enabled)
#pragma config WDTPS = 32768    // Watchdog Timer Postscale Select bits (1:32768)

// CONFIG3H
#pragma config CCP2MX = PORTC   // CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
#pragma config PBADEN = OFF      // PORTB A/D Enable bit (PORTB<4:0> pins are configured as analog input channels on Reset)
#pragma config LPT1OSC = OFF    // Low-Power Timer1 Oscillator Enable bit (Timer1 configured for higher power operation)
#pragma config MCLRE = ON       // MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)

// CONFIG4L
#pragma config STVREN = ON      // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
#pragma config LVP = OFF        // Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
#pragma config XINST = OFF      // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))

// CONFIG5L
#pragma config CP0 = OFF        // Code Protection bit (Block 0 (000800-001FFFh) not code-protected)
#pragma config CP1 = OFF        // Code Protection bit (Block 1 (002000-003FFFh) not code-protected)
#pragma config CP2 = OFF        // Code Protection bit (Block 2 (004000-005FFFh) not code-protected)
#pragma config CP3 = OFF        // Code Protection bit (Block 3 (006000-007FFFh) not code-protected)

// CONFIG5H
#pragma config CPB = OFF        // Boot Block Code Protection bit (Boot block (000000-0007FFh) not code-protected)
#pragma config CPD = OFF        // Data EEPROM Code Protection bit (Data EEPROM not code-protected)

// CONFIG6L
#pragma config WRT0 = OFF       // Write Protection bit (Block 0 (000800-001FFFh) not write-protected)
#pragma config WRT1 = OFF       // Write Protection bit (Block 1 (002000-003FFFh) not write-protected)
#pragma config WRT2 = OFF       // Write Protection bit (Block 2 (004000-005FFFh) not write-protected)
#pragma config WRT3 = OFF       // Write Protection bit (Block 3 (006000-007FFFh) not write-protected)

// CONFIG6H
#pragma config WRTC = OFF       // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected)
#pragma config WRTB = OFF       // Boot Block Write Protection bit (Boot block (000000-0007FFh) not write-protected)
#pragma config WRTD = OFF       // Data EEPROM Write Protection bit (Data EEPROM not write-protected)

// CONFIG7L
#pragma config EBTR0 = OFF      // Table Read Protection bit (Block 0 (000800-001FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR1 = OFF      // Table Read Protection bit (Block 1 (002000-003FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR2 = OFF      // Table Read Protection bit (Block 2 (004000-005FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR3 = OFF      // Table Read Protection bit (Block 3 (006000-007FFFh) not protected from table reads executed in other blocks)

// CONFIG7H
#pragma config EBTRB = OFF      // Boot Block Table Read Protection bit (Boot block (000000-0007FFh) not protected from table reads executed in other blocks)

// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.

#include <xc.h>
#include “supporing_cfile\lcd.h”

#define RF_RX PORTD

void system_init (void);
void rf_analysis (unsigned char recived_byte);

void main(void) {
unsigned char byte = 0;
system_init();
lcd_init();
while(1){
lcd_com(0x80);
lcd_puts(“CircuitDigest”);
lcd_com (0xC0);
byte = RF_RX;
rf_analysis(byte);
lcd_com (0xC0);
}
return;
}

void system_init (void){
OSCCON = 0b01111110; // 8Mhz, , intosc
//OSCTUNE = 0b01001111; // PLL enable, Max prescaler 8×4 = 32Mhz
TRISB = 0x00;
TRISD = 0xFF; // Last 4 bit as input bit.
}

void rf_analysis (unsigned char recived_byte){
if(recived_byte==0x10)
lcd_data(‘1’);
if(recived_byte==0x20)
lcd_data(‘2’);
if(recived_byte==0x30)
lcd_data(‘3’);
if(recived_byte==0x40)
lcd_data(‘4’);
if(recived_byte==0x50)
lcd_data(‘5’);
if(recived_byte==0x60)
lcd_data(‘6’);
if(recived_byte==0x70)
lcd_data(‘7’);
if(recived_byte==0x80)
lcd_data(‘8’);
if(recived_byte==0x90)
lcd_data(‘9’);
if(recived_byte==0x00)
lcd_data(‘0’);
if(recived_byte==0xa0)
lcd_data(‘*’);
if(recived_byte==0xb0)
lcd_data(‘#’);
if(recived_byte==0xc0)
lcd_data(‘A’);
if(recived_byte==0xd0)
lcd_data(‘B’);
if(recived_byte==0xe0)
lcd_data(‘C’);
if(recived_byte==0xf0)
lcd_data(‘D’);
}

The post PIC to PIC Communication using RF Module appeared first on PIC Microcontroller.

Viewing all 223 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>