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.

how to interface 89c450 with 8255 embedded c program

Status
Not open for further replies.

manoj bhagwat

Newbie level 3
Joined
Aug 9, 2013
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
21
how to write embedded c code for 8255 interfacing with led & lcd ?
 

sir we are working on project & we require extra ports for interfacing

so we are using 8255 so plz help how to interface 8255 with 89c50 using embedded c program
& also embedded c program for interfacing led ,lcd & 4x5 keyboard on it

as we are using 89c50 its all port are used for stepper motor so 8255 is used so plz sir help us as early as possible
 

hello,

With A 8255 PIO you need 8 bits (Data bus) and 2 or 3 bits for control (RD,WR,Reset) so 10 to 11 pins used on your MCU.
You can use MCP 23017 16 I/O driven in I2C mode ( 2 pins of MCU)
With 2 IC MCP23017 you can drive 32 I/O by using 2 pins only (SDA,SCL) of your MCU.
you can implement I2C software if no I2C hardware available

or MCP23S17 in SPI mode.
 
Last edited:
8255circuit.jpg
hello,

With A 8255 PIO you need 8 bits (Data bus) and 2 or 3 bits for control (RD,WR,Reset) so 10 to 11 pins used on your MCU.
You can use MCP 23017 16 I/O driven in I2C mode ( 2 pins of MCU)
With 2 IC MCP23017 you can drive 32 I/O by using 2 pins only (SDA,SCL) of your MCU.
you can implement I2C software if no I2C hardware available

or MCP23S17 in SPI mode.

I think the controller they have been using(89c450) is not having SPI or I2C...
It's better to use 8255 for I/O ports...

- - - Updated - - -

hello,

sir we are working on project & we require extra ports for interfacing

so we are using 8255 so plz help how to interface 8255 with 89c50 using embedded c program
& also embedded c program for interfacing led ,lcd & 4x5 keyboard on it

as we are using 89c50 its all port are used for stepper motor so 8255 is used so plz sir help us as early as possible.

Understand the following code and make your requirements...
Code:
#include< regx51.h >


 char xdata PORTA _at_ 0x4000; //by making PORTA with address 4000Hex we are selecting Port A of the 8255
                                 // and the CS low (select the 8255)
 char xdata PORTB _at_ 0x4001;  //by making PORTA with address 4001Hex we are selecting Port B of the 8255
                                 // and the CS low (select the 8255)


void commandsend(unsigned char i);
void datasend(unsigned char i);
void delay();


void main(void)
{
unsigned int i=0;
unsigned char title[] = " MANCHESTER";
unsigned char title2[] = " UNITED";
//In the main section the commands and functions remain the same as before (without the 8255),
//The only difference are the functions routines coding which are need to interface with the 8255

commandsend(0x38);   //INITIALIZE LCD IN 2x16 MATRIX
commandsend(0x0e); //;DISPLAY ON, CURSOR ON
commandsend(0x01); //CLEAR LCD
commandsend(0x80); //SETS LINE AND POSITION: 80H + POSITION  
   for (i = 0; i < 11; i++)  //////DISPLAYING ON LCD///////
   {
  datasend(title[i]);  
   }

    commandsend(0xC0); //SETS the second line  

for (i = 0; i < 7; i++)  //////DISPLAYING ON LCD///////
   {
  datasend(title2[i]);  
   }  
   
  while(1);
}

//Command send fucntion
void commandsend(unsigned char i)
{
   //(Important to check the cirucit diagram and compare it to this program to know the setting of the hex values)

   //the Variable 'i' is there to get parameter from the function and pass it to PORTA (transmitt it trough the 8225 Port A)
PORTA = i;//put data into 4000h

   //4hex (0100B) = Enable: 1    RW:0     RS:0  so make E high, Write to lcd, Command Type (transmit it trough the 8225 Port B)
   PORTB  = 0x04; //put 4h into 4001h
delay();
   
   //0hex (0000B) = Enable: 0    RW:0     RS:0  so make E Low, Write to lcd, Command Type (transmit it trough the 8225 Port B)
   PORTB  = 0x00; //put 0h into 4001h
delay();
}

//Data send fucntion
void datasend (unsigned char i)
{
   //(Important to check the cirucit diagram and compare it to this program to know the setting of the hex values)

   //the Variable 'i' is there to get parameter from the function and pass it to PORTA (transmitt it trough the 8225)
PORTA = i; //put data into 4000h
   //4hex (0101B) = Enable: 1    RW:0     RS:1  so make E high, Write to lcd, Data Type (transmit it trough the 8225 Port B)
   PORTB  = 0x05; //put 5h into 4001h
delay();
   //1hex (0001B) = Enable: 0    RW:0     RS:1  so make E Low, Write to lcd, Data Type (transmit it trough the 8225 Port B)
   PORTB  = 0x01; //put 1h into 4001h
delay();  
}
void delay()
{
unsigned int i =0;
  for (i = 0; i < 100; i++);//delay
}
 
sir i need help

which decoder ic is been used to interface multiple 8255 with 89c450

- - - Updated - - -

sir
want your help
i want an embedded c program in which two 8255 are used on 1st 8255 switch is been interfaced & on 2nd 8255 led is interfaced so by switch led is been made on & off so help me in gving embedded c code as early as possible,,
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top