6403 views|6 replies

76

Posts

0

Resources
The OP

I would like to ask how to make all 8 LEDs bright when driven by MAX7219? [Copy link]

About the display of max7219 I am an electronics enthusiast. Recently I have a MAX7219 chip. I want to program it with 89C2051 to see how it works. But it doesn't work. I think there is no problem, but the 8 LEDs I want to display are all lit up as soon as they are powered on, and never go out. What's going on? Is it a software problem or a hardware problem? I can't figure it out. Can any expert give me some advice? I'd be very grateful!!! Below is our display program: ;max7219 assembly test program;********************************************************** L0AD7219 BIT P1.0 ;MAX7219 chip select line pin CLK7219 BIT P1.1 ;MAX7219 clock line pin DIN7219 BIT P1.2 ;MAX7219 data line pin POWLED BIT P1.7 ;monitoring light;************************************************************** DIG0 EQU 01H ;data register address DIG1 EQU 02H DIG2 EQU 03H DIG3 EQU 04H DIG4 EQU 05H DIG5 EQU 06H DIG6 EQU 07H DIG7 EQU 08H DECMODE EQU 09H ;control register address INTENTY EQU 0AH SCANLIM EQU 0BH SHUTDOW EQU 0CH DISTEST EQU 0FH ORG 0000H AJMP MAIN ORG 0040H MAIN: MOV SP,#30H CLR POWLED LCALL INI7219 LCALL DELAY1S CPL POWLED LLLL: LCALL SHOW7219 LJMP LLLL RET ;////////////////////////////////////////////////////// SHOW7219: MOV A,#DIG0 MOV B,#00H LCALL WRITE7219 MOV A,#DIG1 MOV B,#01H LCALL WRITE7219 MOV A,#DIG2 MOV B,#02H LCALL WRITE7219 MOV A,#DIG3 MOV B,#03H LCALL WRITE7219 MOV A,#DIG4 MOV B,#04H LCALL WRITE7219 MOV A,#DIG5 MOV B,#05H LCALL WRITE7219 MOV A,#DIG6 MOV B,#06H LCALL WRITE7219 MOV A,#DIG7 MOV B,#07H LCALL WRITE7219 RET ;///////////////////////////////////////////////////// INI7219: MOV A,#SHUTDOW ;Shutdown mode MOV B,#00H LCALL WRITE7219 MOV A,#DECMODE ;Decoding mode MOV B,#0FFH LCALL WRITE7219 MOV A,#INTENTY ;Brightness 15/32 mode MOV B,#07H LCALL WRITE7219 MOV A,#SCANLIM ;Display 8-bit LED MOV B,#07H LCALL WRITE7219 MOV A,#DISTEST ;Normal display MOV B,#00H LCALL WRITE7219 MOV A,#SHUTDOW ;Power-on mode MOV B,#01H LCALL WRITE7219 RET ;////////////////////////////////////////////////////////// WRITE7219: NOP CLR L0AD7219 LCALL SEND7219 ;Send the address of the control register first MOV A,B ;B is the command word to be transmitted or the data to be displayed LCALL SEND7219 NOP SETB L0AD7219 RET ;///////////////////////////////////////////////////////////// SEND7219: MOV R1,#08H LOOPS: NOP CLR CLK7219 RLC A ;Shift left and send MSB MOV DIN7219,C NOP SETB CLK7219 DJNZ R1,LOOPS RET ;///////////////////////////////////////////////////////// DELAY1S: MOV R7,#0AH ;Delay 1 second subroutine (12M crystal oscillator) LOOP6: MOV R5,#64H ;100ms loop LOOP7: MOV R6,#64H LOOP8: NOP ;1US NOP NOP NOP NOP NOP NOP NOP DJNZ R6,LOOP8 ;10US DJNZ R5,LOOP7 DJNZ R7,LOOP6 RET END

This post is from Embedded System

Latest reply

After a rough look, there is nothing wrong with your process. Of course, you need to confirm whether some specific assembly instructions are correct. 1. Since you did not post your schematic diagram, it is impossible to determine whether your hardware is good. If there is a problem with the hardware, the software cannot solve it. 2. You use SPI to send cmd and data. Then please confirm whether the timing of this Spi is correct. You can write a loop with an interval of 100ms to send a fixed data, such as 0x77, and then use an oscilloscope to measure these three lines. Is the waveform timing correct (pay attention to whether the clk speed of SPI meets the requirements of MAX7219, whether the width of the level above the data meets the requirements, and whether the interval time between CS and the first clk meets the requirements.) 3. Check whether the timing of 1s in your software above is correct. Maybe the timing is only a few ms, so if you keep refreshing the data, you may see FF. You don’t have to display so many numbers from 0 to 8 in a loop. Only display one data at a time to see if it is correct. The above are some suggestions. You can start with the simple ones, which will make it easier to clarify the problem.  Details Published on 2009-10-1 09:19

74

Posts

0

Resources
2
I made this thing many years ago, and it seems that it needs to be scanned, not lit at the same time.
This post is from Embedded System

71

Posts

0

Resources
3
What’s going on?
This post is from Embedded System

75

Posts

0

Resources
4
What’s going on?
This post is from Embedded System

73

Posts

0

Resources
5
??????????????????????????????
This post is from Embedded System

59

Posts

0

Resources
6
Should the carry bit be cleared every time? I haven't learned much assembly language, so it's a bit difficult to understand. Haha...
This post is from Embedded System

85

Posts

0

Resources
7
After a rough look, there is nothing wrong with your process. Of course, you need to confirm whether some specific assembly instructions are correct. 1. Since you did not post your schematic diagram, it is impossible to determine whether your hardware is good. If there is a problem with the hardware, the software cannot solve it. 2. You use SPI to send cmd and data. Then please confirm whether the timing of this Spi is correct. You can write a loop with an interval of 100ms to send a fixed data, such as 0x77, and then use an oscilloscope to measure these three lines. Is the waveform timing correct (pay attention to whether the clk speed of SPI meets the requirements of MAX7219, whether the width of the level above the data meets the requirements, and whether the interval time between CS and the first clk meets the requirements.) 3. Check whether the timing of 1s in your software above is correct. Maybe the timing is only a few ms, so if you keep refreshing the data, you may see FF. You don’t have to display so many numbers from 0 to 8 in a loop. Only display one data at a time to see if it is correct. The above are some suggestions. You can start with the simple ones, which will make it easier to clarify the problem.
This post is from Embedded System

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list