I was looking for a way to drive a 7 segment LED display with an attiny13A. As you probably know, the attiny only has 5 usable pins.
So, I went digging in the junk box for a solution.
I found a National MM5481N that seems to be unused.
But the datasheet (
http://pdf1.alldatasheet.com/datasheet-pdf/view/144761/NSC/MM5481N.html) for it is almost useless for connecting and programming so I was left to guessing wiring and programming. It seems to implement a form of SPI interface.
I am wiring it as attached in the schematic.
Code:
#define F_CPU 128000
#include <util/delay.h>
#include <avr/io.h>
void shreg(int x){
int z;
for(z = /*8192*/16384;z>1;z/=2){
PORTB = _BV(PB3);//(_BV(PB3) * !!(x&z)); //Debugging - should write all outputs to high
_delay_ms(1); //Wait
PORTB |= _BV(PB4); //SCK high
_delay_ms(1); //wait
PORTB &= _BV(PB4); //SCK low
_delay_ms(1);
PORTB = 0;
_delay_ms(1);
}
}
int main(){
DDRB = _BV(PB1) | _BV(PB3) | _BV(PB4);
PORTB = 0;
while(1)
shreg(0xffff);
}
I have tried different combinations of code.
Also I have tried tying the dataenable to 5v and ground.
All attempts have no outputs on any output pins on the LED driver.
Cannot be 100% sure the chip works but I think it does.