Showing posts with label PIC. Show all posts
Showing posts with label PIC. Show all posts

Python maps mouse movements to an led matrix display controlled by a PIC


Introduction:

This is a small "toy paint" on an LED dot matrix display which is controlled by a mouse connected to a PC... We have seen the MS PAINT in windows. This is a small 'TOY PAINT' for my small 8x10 LED dot matrix display :-) Here, using a PC mouse, I could draw and erase picture on a small 80 pixel display made by LEDs. At first I thought of making a mouse controlled robotic arm but due to lack of few mechanical parts, I just postponed that and now made this toy paint as a part of familiarizing  two python modules named pygame and pyserial. The heart of the display is a PIC16F877A micro controller. Now, from the PC side, every thing is done on python. Now, if I am using an RF module in between the PIC and USB to UART converter, I can do the same process remotely... The same idea could be applied in robotics for smooth control of activities remotely using a computer mouse...

MMC WAV PLAYER USING PIC16F877A






Video of my PIC16F877A based MMC wav player 
 (video updated on 06/09/2011 (improved audio quality)):

Later i tried to access an MMC with FAT16 file system using the same PIC16F877A and then successfully played an 8 bit mono wav file of byterates from 8000 to 48000. Here, it reads the first sector of MMC (boot record) to obtain some important information like no of reserved sectors, start of partition, no of t Per FAT ,maximum Root Directory Entries ,Bytes per Sector etc. Using those information, it is possible to calculate the starting sector address of FAT1, FAT2, root directory, data area etc....But due to the limited RAM in PIC16F877A, it is required to read a complete sector multiple number of times to access the entire 512 bytes....

An attempt to access a memory card (MMC) using a PIC with limited RAM (PIC16F877A)


PIC16F877A BASED  MMC VOICE RECORDER



                                      Video of my PIC16F877A based MMC digital voice recorder:




This is my first digital voice recorder which is made using a mid range PIC with a total RAM of only 256 bytes. Generally people may say that  we cannot access MMC/SD card using a microcontroller with a RAM < 512. I had seen such posts and comments in many electronics forums, sites etc. But now i could comment  it is also possible to access MMC/SD using a uC with limited RAM but may have much limitations compared to uC with enough RAM.
        Here, i used a PIC16F877A to access an MMC.  MMC is interfaced to PIC16F877A via SPI. I didn't used any file system here. It writes the 8 bit digital data from ADC to the MMC using a multiple block write command. A single block consist of 512 bytes , also called as a sector.

 Similarly it reads the 8bit digital data (digital samples)  using a mutliple block read command. After reading each byte, it is sent to the PWM register to generate PWM signal corresponding to the audio recorded.  Then after passing the PWM signal throuh a low pass filter, the analog  signal could be obtained which is then amplified and introduced to a speaker to reproduce the recorded voice.
       The audio quality was beyond my expectation. The reason for the good audio quality is the high bit rate.. Since i didn't used any file system (FAT etc) I could easily use multiple block read and multiple block write commands to read and write MMC and thus it could achieve the maximum bit rate.

TV remote controlled SNAKE GAME in 8*10 LED dotmatrix display!

Video of my TV remote controlled 8*10 LED dotmatrix SNAKE GAME





(Also, I made similar LED dotmatrix CAR RACING game and PONG game , those videos are at bottom of the page)

Philips TV remote decoder using PIC16F84A

INTRODUCTION:


RC-5 protocol:
The protocol uses bi-phase modulation (or so-called Manchester coding) of a 36KHz IR carrier frequency. All bits are of equal length of 1.778ms in this protocol, with half of the bit time filled with a burst of the 36KHz carrier and the other half being idle. A logical zero is represented by a burst in the first half of the bit time. A logical one is represented by a burst in the second half of the bit time.
when a button in remote is pressed, in transmits a 14 bit IR signal modulated as above. Now, the 14 bit signal is represented as below.

Scrolling text in LED dotmatrix display

Introduction:
Multiplexed displays are electronic displays where the entire display is not driven at one time. Instead, sub-units of the display (typically, rows or columns for a dot matrix display or individual characters for a character orientated display, occasionally individual display elements) are multiplexed, that is, driven one at a time, but the electronics and the persistence of vision combine to make the viewer believe the entire display is continuously active.

10x8 LED dot matrix display:
   Below figure illustrates the construction of a 10x8 LED dot matrix display.

































4 bit interfacing of a 16X2 LCD display to PIC16F877A, Atmega16/32, MSP430 & Stellaris launchpad

16x2 LCDs are most commonly used display units in microcontroller based projects. I got much information about LCD, LCD commands, LCD initialization etc from the below link and I hope, it will be very much helpful for beginners.


 


8-BIT UP or DOWN COUNTER USING PIC16F877A

This is an example which shows how to connect a push button to a microcontroller and control some operations. The main pitfall for a beginner in this case is, he/she may not be bothered about the switch bounce effect.

PIC PROGRAMMER

PICPGM is the latest best PIC burning software which supports a large number of PICs and burning hardwares.. Below is those simplest serial port PIC burning hardware(high voltage) circuit diagram. But it is not an efficient one but you can try it and it will work any way.. The

RUNNING LED

 LED RUNNING USING PIC16F877A
       In this case LEDs connected to PORTD will glow one after the other in a chasing manner and the cycle repeats. This is also a test program  for beginners.


C PROGRAM (use High TECH C compiler)
#include <htc.h>
__CONFIG(0x3F3A);   //configuration bits