• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Guide me!Thanks

Status
Not open for further replies.

dvn_duc

New Member
I must make a circuit,it includes :microprocessor 89C51 to control some matrix leds to flow a string into.And it uses 8255A-5 to I/O to matrix leds,SRAM6264,EPROM2764,Latch:SN74LS573,decoder:SN74LS138,sweep column:SN74LS164..I can design this circuit but I can't write a good program use ASM for it.Whom can help me?Thanks
 

crust

Member
Precisely what type of problem are you having? Are you certain the hardware you assembled is working correctly? Did you try the "can i make the led blink in software test?" Please provide a bit more detail about what the problem is. Or are you saying you dont know how to use ASM?
 

kinjalgp

Active Member
Why are you using 2764 EPROM when you already have 4k ROM inside 89C51? Are you falling short of code space? If that is the problem then go for higher capacity FLASH ROM versions of 8051 like AT89C51RD2 or P89C51RD2. Both these have 64kB internal Flash. This will reduce your PCB complexity to a great extent.
 

dvn_duc

New Member
I don't know how to use ASM

I've just known ASM so I can't write some programs to control my circuit.Every body can help me how use ASM to do that.Thanks
And I have a problem in sharing address memories for SRAM6265,EPROM 2764 and 8255.Example,if I share address memory for ram,because its capacity is 8k,0000h-2fffh,then I must share this area to 2 sub-areas to store program variable 0000-1ffffh,1000-2ffffh,isn't it very small when it uses to do another work...What I have a Faulse.Help me
 

kinjalgp

Active Member
Re: I don't know how to use ASM

dvn_duc said:
I've just known ASM so I can't write some programs to control my circuit.Every body can help me how use ASM to do that.Thanks
And I have a problem in sharing address memories for SRAM6265,EPROM 2764 and 8255.Example,if I share address memory for ram,because its capacity is 8k,0000h-2fffh,then I must share this area to 2 sub-areas to store program variable 0000-1ffffh,1000-2ffffh,isn't it very small when it uses to do another work...What I have a Faulse.Help me
If you are falling short of RAM, use larger capacity ones like 62256 (32kB). And I don't understand what do you mean by sharing over here?
I guess you are confused with the same addresses of ROM and RAm. Thats because 8051 is based on Harvard architecture which identifies ROM and RAM separately even if they are on same bus. The PSEN\ and RD\ signal seperates ROM from RAM. Thus both these deveices can have same addresses i.e from 0000h to FFFFh. Data from RAM can be accessed using MOVX instruction while data from ROM can be accessed using MOVC instruction.
 

dvn_duc

New Member
Thanks

Thank for your help.And I want to ask you that,I design completely my circuit,I want to demo EPROM to float a string on the matrix LEDs.You can guide me how to do this.Which can I use softwave to do this?Or use softwave to virtual
 

kinjalgp

Active Member
Can you please clarify your last sentence? I am not able to understand what you are trying to say.
 

kumar_3k

New Member
some sourcecode sample for LCD with 89C51

first make sure ur microcontroller circuit is working...test with some simple running light program!
here is some example code to test the LCD display....i conform that this code is working.best of luck! may be u can develop ur project with this code....
-----------------------example1-------------------
;Check busy flag before sending data, command to LCD
;P1=data pin
;P2.0 connected to RS pin
;P2.1 connected to R/W pin
;P2.2 connected to E pin
ORG
MOV A,#38H ;init. LCD 2 lines,5x7 matrix
ACALL COMMAND ;issue command
MOV A,#0EH ;LCD on, cursor on
ACALL COMMAND ;issue command
MOV A,#01H ;clear LCD command
ACALL COMMAND ;issue command
MOV A,#06H ;shift cursor right
ACALL COMMAND ;issue command
MOV A,#86H ;cursor: line 1, pos. 6
ACALL COMMAND ;command subroutine
MOV A,#'N' ;display letter N
ACALL DATA_DISPLAY
MOV A,#'O' ;display letter O
ACALL DATA_DISPLAY
HERE: SJMP HERE ;STAY HERE
COMMAND: ACALL READY ;is LCD ready?
MOV P1,A ;issue command code
CLR P2.0 ;RS=0 for command
CLR P2.1 ;R/W=0 to write to LCD
SETB P2.2 ;E=1 for H-to-L pulse
CLR P2.2 ;E=0 ,latch in
RET
DATA_DISPLAY:
ACALL READY ;is LCD ready?
MOV P1,A ;issue data
SETB P2.0 ;RS=1 for data
CLR P2.1 ;R/W=0 to write to LCD
SETB P2.2 ;E=1 for H-to-L pulse
CLR P2.2 ;E=0, latch in
RET

READY:
SETB P1.7 ;make P1.7 input port
CLR P2.0 ;RS=0 access command reg
SETB P2.1 ;R/W=1 read command reg
;read command reg and check busy flag
BACK:CLR P2.2 ;E=1 for H-to-L pulse
SETB P2.2 ;E=0 H-to-L pulse
JB P1.7,BACK ;stay until busy flag=0
RET
END
---------------------example2-------------------------
by, [email protected]
 

kinjalgp

Active Member
Now there is a lot of difference between a matrix LCD display and matrix LED display. So you cannot just develop your LED code with this example. There is no multiplexing code used which is required in LED unless you are driving your matrix with dedicated driver ICs.
 

kumar_3k

New Member
LCD is easier

oh yes, he mentioned LED matrix here, anyway using LCD display will be more eaier.......
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top