Getting Started with the SAA1064 i2c bus 4-Digit 7-Segment LED driver chip

westaust55

Moderator
Noting that there have in the past been a number of posts recommending the SAA1064 LED driver chip and also a number of instances where newcomers have required assistance, the attached "Getting Started..." tutorial is provided to help those new to the SAA1064 chip get under way with some circuits and code that is working.

As indicated in the tutorial, the SAA1064 has a relatively inconsequential Status Register what on has a single bit to indicate if the SAA 1064 has been accessed since it was last reset/powered-up. The example program with the tutorial includes code to read this Status Register which will hopefully help to indicate whether the i2c comms is working in the event that nothing is initially displayed on the LED displays as the reading of the Status Register should return either 0 or 128 but not 255.
 

Attachments

westaust55

Moderator
Just had a though . . .
A better code snippet to verify and indicate when the i2c comms is working by/when reading the Status register would be:
Code:
; Purely to demo the status bit we will check the power reset bit - normally not required but can help test i2c comms
	HI2CIN  (SAA_Status)    ; Fetch the Status byte to check if the SA1064 has just been rest/powered-up
	IF SAA_Status = $80 THEN
	    SERTXD ("SAA1064 has just been reset or powered-up",CR,LF)
	ELSEIF SAA_Status = $0 THEN
	    SERTXD ("SAA1064 has not been reset or powered-up",CR,LF)
	ELSE
	    SERTXD ("Si2c comms with SAA1064 has not been established",CR,LF)
	ENDIF
It should also be noted that the SAA1064 can also be utilised to drive up to 32 LEDs as a bar graph, part of a cube or for other purposes.
The outputs are sinking (ie when active the output is taken to ground and when not active the outputs are high impedance) while will influence the arrangement of any LED array.
 
Last edited:
Top