Any 'C' code for the Maxim 7219 display driver

Status
Not open for further replies.

okk

Newbie level 3
Joined
May 28, 2003
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
NE england
Activity points
19
maxim 7219

Does anyone have any PIC C code for the Maxim 7219 display driver.

Many thanks,


okk
 

16f877 7219

okk said:
Does anyone have any PIC C code for the Maxim 7219 display driver.

Many thanks,


okk

Sorry, no PIC code, but this might help anyway..

Regards
 

7219 maxim c code on pic

// (CCS for 16F877 use MAXX7219)
// from wlasoi@sci.ubu.ac.th
//*******************************

#include<16f877.h>
#fuses xt,nowdt,put,noprotect
#use delay(clock=4000000)

#define da pin_c0
#define cs pin_c1
#define clk pin_c2


void send_16bit(byte address,byte data)
{
byte i;
#bit carry=0x03.0;
carry=0;
output_low(cs);
for(i=0;i<8;i++)
{
if((address & 0b10000000)==0)
output_low(da);
else
output_high(da);
rotate_left(&address,1);

output_high(clk);
delay_us(200);
output_low(clk);
delay_us(200);
}

for(i=0;i<8;i++)
{
if((data & 0b10000000)==0)
output_low(da);
else
output_high(da);

rotate_left(&data,1);
output_high(clk);
delay_us(200);
output_low(clk);
delay_us(200);
}
output_high(cs);
}

void init_7219()
{
send_16bit(0x09,0xff); //decode
delay_us(50);
send_16bit(0x0a,0x0f); //intensity
delay_us(50);
send_16bit(0x0b,0x07); //scan limit
delay_us(50);
send_16bit(0x0c,0x01); //shutdown
delay_us(50);
send_16bit(0x0f,0x00); //display
delay_us(50);
}


main()
{
int i,j;
while(1){
set_tris_c(0x00);

init_7219();

for(i=1;i<=8;i++)
{
send_16bit(i,0x0f);
}

for(i=1;i<=8;i++)
{
for(j=0;j<=9;j++)
{
send_16bit(i,j);
delay_ms(500 );
}


}
}
}
 

maxim 7219 code

Many thanks!

okk
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…