Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Elevator Dot Matrix counter using PIC16F877A

Status
Not open for further replies.

m_hany

Newbie level 1
Joined
Apr 28, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
EGYPT
Activity points
1,288
HI,
I need to make a circuit using PIC16F877A and 5x8 dot matrix display to make an elevator counter which display the number of floor using gray code as input signal.
i want to count 16 floor from G to floor 15.
the power to the circuit is 24 VDC .
CAN ANY BODY HELP WITH THE CIRCUIT CODE IN C LANGUGE OR THE SCHEMATIC CIRCUIT ON PROTUES as it is the first time for me to use dot matrix with pic microcontrollers.
thanks in advance
 

Hi I have some code that I used long time back to test a 5x7 dot matrix display. At that time I was trying to make a car number gear display used in rally cars. It is very basic. It used a 4017 decade counter to switch columns and rows are connected to the PIC. if you use the 16F877, you will have more than enough pins to multiplex it.


// MODIFIED for 16F628
#include <pic.h>
#include <pic16f6x.h>
#include "delay.h"
#include "delay.c"

#define XTAL_FREQ 4MHZ
__CONFIG(0x3F30); // no crystal required


#define PORTBIT(adr, bit) ((unsigned)(&adr)*8+(bit))


static bit r0 @ PORTBIT(PORTB, 0); // row0
static bit r1 @ PORTBIT(PORTB, 1); // row1
static bit r2 @ PORTBIT(PORTB, 2); // row2
static bit r3 @ PORTBIT(PORTB, 3); // row3
static bit r4 @ PORTBIT(PORTB, 4); // row4
static bit r5 @ PORTBIT(PORTB, 5); // row5
static bit r6 @ PORTBIT(PORTB, 6); // row6
static bit clk @ PORTBIT(PORTB, 7); // 4017 clock

static bit rst @ PORTBIT(PORTA, 0); // stwitch position 1
static bit pos2 @ PORTBIT(PORTA, 1); // stwitch position 2
static bit pos3 @ PORTBIT(PORTA, 2); // stwitch position 3
static bit pos4 @ PORTBIT(PORTA, 3); // stwitch position 4
static bit pos5 @ PORTBIT(PORTA, 4); // stwitch position 5

void clock();
void reset();

//main function
void main(void)
{

TRISB = 0b00000000; // all outputs
TRISA = 0b00000001; // 1st output rest inputs
PORTB = 0b11111111; // all off
CMCON = 0b00000111; // disable comparators

while(1)
{
PORTB= 0x3E;
clock();
PORTB= 0x11;
clock();
PORTB= 0x11;
clock();
PORTB= 0x11;
clock();
PORTB= 0x3E;
reset();





}


}


void clock()
{
clk=0;
clk=1;
DelayMs(10);
clk=0;
}

void reset()
{
rst=0;
rst=1;
DelayMs(10);
rst=0;
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top