schematic Quickpost this image to Myspace, Digg, Facebook, and others! code working: If you press any button in the matrix keyboard it controller will scan the corresponding ascii code that will send serially to the port pin specified . Corresponding ascii code we can see in LED blinkings. #include /* add the headers here */ #define COL P2 #define ROW P1 void msdelay(unsigned int value); void sertx(unsigned char); unsigned char keyboard[4][4]={ '7','8','9','/', '4','5','6','*', '1','2','3','-', 'a','0','=','+' }; void main() { unsigned char colloc,rowloc; TMOD=0x20; TH1=-24; SCON=0x50; TR1=1; COL=0xff; while(1) { do { ROW=0x00; colloc=COL; colloc&=0x0f; } while(colloc!=0x0f); do { do { msdelay(20); colloc=COL; colloc&=0x0f; }while(colloc==0x0f); msdelay(20); colloc=COL; colloc&=0x0f; } while(colloc==0x0f); while(1) { ROW=0xfe; colloc=COL; colloc...
Popular posts from this blog
8051 Development Setup:MIDE-51 Installation
1. Installing MIDE-51 MIDE-51 is freeware Integrated Development Environment (IDE) for MCS-51 microcontroller. The full package already comes with: Assembler : ASEM-51 by W.W.Heinz (v1.3)C compiler : SDCC: Small Device C Compiler (v2.5.4)Simulator : TS Controls 8051 Emulator v1.0 evaluation (Owner : http://www.tscontrols.com was gone)Simulator : JSIM-51 Simulator by Jens Altmann (v4.05) Just downloads midepack0258.exe and executes this file, everything will setup completely. Feature on MIDE-51: Syntax highlighter on ASEM-51 reserved word & addition register on selected device (devices listed on ASEM51/MCU folder) Syntax highlighter on SDCC reserved word & MCS-51 standard register Support multi document workspace Support standard editor feature and shortcut key such as Cut , Copy, Paste, Find, Replace and Windows tile & cascade Editor font style and size selectable Save recent file(s) opened in list Shortcut to ASEM-51 html manual Shortcut to SDCC html & PDF manual ...
Nokia dot Matrix LCD Interfacing with 89c51( 8051 core)
The Nokia 3310 LCD is based on a PCD8544 48x84 pixels matrix LCD controller Pin Diagram given above .. Schematic: ---------------------------- AT89C51 PROGRAM CODE ;Program for Nokia 3310 LCD PCD8544 48x84 pixel SCK BIT P1.7 SDIN BIT P1.6 D_C BIT P1.5 SCE BIT P1.4 RES BIT P1.3 ORG 0000H AJMP MAIN ORG 0030H MAIN: MOV SP,#60H MOV P1,#00H CLR C CALL RESET CALL LCD_INIT HERE: CALL CLEAR_RAM MOV DPTR,#MESSAGE CALL LCD_STRING CALL DELAYS CALL CLEAR_RAM MOV DPTR,#IMAGE CALL DISPLAY CALL DELAYS AJMP HERE DELAYS: ;1s DELAY MOV R5,#10 D1: CALL DELAY DJNZ R5,D1 RET DELAY: ;100ms DELAY SETB PSW.4 MOV R7,#200 HDH: MOV R6,#100 HD: NOP NOP NOP DJNZ R6,HD DJNZ R7,HDH CLR PSW.4 RET RESET: ; RESET SETB SCE SETB RES CLR RES CALL DELAY SETB RES RET LCD_INIT: ;INITALIZE LCD MOV DPTR,#LCDCODE1 CALL LCD_IN CALL CLEAR_RAM MOV R1,#00H ;Y MOV R2,#00H ;X CALL CURSOR RET LCD_IN: MOV A,#00H MOV R6,#00H LOOP3: INC R6 MOVC A,@A+DPTR CJNE A,#2FH,NEXT3 RET NEXT3: CALL LCD_COM MOV A,R6 AJMP LOOP3 DISPLAY: ;DISPLAY IMA...
Comments
Post a Comment