Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 01, 2024, 01:12:02 01:12


Login with username, password and session length


Pages: [1]
Print
Author Topic: problem using MAX7219  (Read 5816 times)
0 Members and 1 Guest are viewing this topic.
bajrang
Active Member
***
Offline Offline

Posts: 145

Thank You
-Given: 245
-Receive: 79


« on: December 18, 2006, 01:35:22 13:35 »

Dear friends,
I am trying to interface an 8 digit 7-segment display using max7219 with pic 16f84. I am unable to send data to the digits except the first one. please help me find out the bug.

warm regards,
bajrang
Logged
picstudent
Active Member
***
Offline Offline

Posts: 169

Thank You
-Given: 0
-Receive: 3


« Reply #1 on: December 18, 2006, 05:04:39 17:04 »

please analyse the examples on les johnson pic basic book...

best regards...
Logged

... rego ... who are are you really ?
xmobix
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 9
-Receive: 1


« Reply #2 on: December 21, 2006, 03:56:27 03:56 »

may this help you friend:

first you have to setup MAX7219 before send data to digits (7 segment display)

look this example (in picbasic pro 2.47) :

-------------------------------------------

'****************************************************************
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 16/09/2006                                        *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************

'-----CHIP SET-UP-----
include "modedefs.bas"
define OSC 4

'-----VARIABLES-----
ADDRESS var word 'variable address for display
DATAREG var word 'variable data register for display
X var word 'misc variable used in loops
Y var word ' DEZE TOEVOEGEN


'-----PIN SETUPS-----
low portb.0 'data pin for MAX7219 (1)
low portb.1 'clock pin for MAX7219 (13)
low portb.2 'load pin for MAX7219 (12)

'-----MAX7219 SETUP-----
ADDRESS = $0C : DATAREG = $01 : gosub MaxWrite
ADDRESS = $09 : DATAREG = $FF : gosub MaxWrite
ADDRESS = $0A : DATAREG = $04 : gosub MaxWrite
ADDRESS = $0B : DATAREG = $03 : gosub MaxWrite
ADDRESS = $0F : DATAREG = $00 : gosub MaxWrite
gosub Blank

'-----PROGRAM-----
Start:
for Y = 0 to 9999
for X = 0 to 9999
gosub ValueToMax
pause 1000
next X
X = 0
NEXT y
goto Start 'do it all over again
end

'-----SUBROUTINES-----
ValueToMax:
ADDRESS = 1 : DATAREG = X DIG 0
gosub MaxWrite
ADDRESS = 2 : DATAREG = X DIG 1
gosub MaxWrite
ADDRESS = 3 : DATAREG = X DIG 2
gosub MaxWrite
ADDRESS = 4 : DATAREG = X DIG 3
gosub MaxWrite
ADDRESS = 5 : DATAREG = y DIG 0
gosub MaxWrite
ADDRESS = 6 : DATAREG = y DIG 1
gosub MaxWrite
ADDRESS = 7 : DATAREG = y DIG 2
gosub MaxWrite
ADDRESS = 8 : DATAREG = y DIG 3
gosub MaxWrite
return

MaxWrite:
shiftout portb.0,portb.1,1,[ADDRESS,DATAREG] 'Shift out the data to the
MAX7219
'first the address, then data.
pulsout portb.2,1 'load the data into the MAX7219
return

Blank:
for X = 1 to 4 'write $0F (blank) to all digits
ADDRESS = X : DATAREG = $0F : gosub MaxWrite
next X
return

---------------------------------------------------------------------------------


good luck friend  Shocked



Logged
bajrang
Active Member
***
Offline Offline

Posts: 145

Thank You
-Given: 245
-Receive: 79


« Reply #3 on: December 21, 2006, 07:56:56 07:56 »

Thanks a ton friends,
warm regards,
bajrang
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC