Schematic as per data sheet, As I said before I've tried numerous variations on timing. E.g. after each 16 bit word, after each digits set of data, separately and together, vaious durations, makes no difference.need schematic , timing details.
I've solved the problem!
Seems I didn't understand how to send the cascade data well enough.
.
.
.
YaaHoo!
Am I right in thinking you got confused by bit about no-op codes in the datasheet? I just read through it and it took me a minute to realise it refers to addressing a chip in isolation
I meant a single chip within the cascade, Mr Super7SEGManWell I didn't get confused by the references to No-Op, this is how it suggests multiple Max7221/7219 should be addressed and that is exactly what their written example shows (N0-Op Register). This is how I programmed it.
It isn't referring to single chips at this point, you can't cascade to a single chip.
Yes it was a bit confusing using the method suggested which is data to one chip in the cascade only, and this method is what casued the flicker.I meant a single chip within the cascade, Mr Super7SEGMan
I agree about datasheets. You have to read them with care. A bit like reading man pages.
//------ digit Posiiton 1--| |--------digit 2------|
unsigned int Time_frame[]={0x0600,0x0500,0x0400,0x0300,0x0800,0x0700,0x0200,0x0100,0X0800,0x0700,
//--d2|----- GAP ---------//------- D3----------------| |------------- D4----------|
0x0600,0x0500,0x0400,0x0300,0x0200,0x0100,0x0800,0x0700,0x0600,0x0500,0x0400,0x0300,0x0200,0x0100}; //
// SMOOTH FONT
unsigned char SM_font[]={0x3E,0x41,0x41,0x3E, 0x40,0x7F,0x42,0x00, 0x6E,0x49,0x49,0x72,
// ZERO ONE TWO
0x3E,0x49,0x49,0x22, 0x7E,0x08,0x08,0x0F, 0x30,0x49,0x49,0x2F,
// THREE FOUR FIVE
0x30,0x49,0x49,0x3E, 0x7F,0x01,0x01,0x03, 0x36,0x49,0x49,0x36,
// SIX SEVEN EIGHT
0x3E,0x49,0x49,0x26, 0x00,0x7C,0x10,0x7C, 0x00,0x7C,0x08,0x7C,
// NINE 'H'10 'M'11
0x78,0x14,0x78,0x00, 0x62,0x14,0x08,0x7F, 0x00,0x00,0x00,0x00,
// 'A'12 'K'13 ' blank' 14
0x09,0x09,0x09,0x7F, 0x30,0x48,0x48,0x30, 0x70,0x08,0x08,0x70,
// 'F' 15 'o'16 'n' 17
0x02,0x42,0x7F,0x02, 0x41,0x41,0x41,0x3E, 0x00,0x68,0x14,0x7C,
// 't' 18 'C'19 'R' 20
0x48,0x30,0x30,0x48, 0x41,0x41,0x41,0x41, 0x00,0x68,0x14,0x41};
// 'x' 21 ''22 ''23
void Load_dots(unsigned int position,unsigned char value, unsigned int *frame)
{
unsigned int dotp;
int x;
int Blank=0;
value=value*4;
if(position==1)dotp=0;
if(position==2)dotp=7;
if(position==3)dotp=14;
if(position==4)dotp=19;
if((position==4)&&(value==0x00)) Blank=1;
if(C_Font==1) // Square font
{
for ( x = 0; x < 4 ; x++)
{
frame[dotp+x]=frame[dotp+x]&(0xFF00);
if(!Blank)
{
frame[dotp+x]=frame[dotp+x]|(SQ_font[value+x]);
}
}
}else{ // Smooth font
for ( x = 0; x < 4 ; x++)
{
frame[dotp+x]=frame[dotp+x]&(0xFF00);
if(!Blank)
{
frame[dotp+x]=frame[dotp+x]|(SM_font[value+x]);
}
}
}
}
void Send_dots(unsigned int *frame)
{
int x;
for ( x = 0; x <= 7; x++)
{
MAX_dot_bb(frame[x],0); // send to MAXIM display chip...
MAX_dot_bb(frame[x+8],0); //
MAX_dot_bb(frame[x+16],1);
}
}
void MAX_dot_bb(unsigned int test,int chip_load)
{
#define MAX_data LATBbits.LATB1
#define MAX_clock LATBbits.LATB2
unsigned int x ;
MAX_load = 0; // load MAX7219
for ( x = 0; x <= 15 ; x++)
{
if (test & 0x8000) {
MAX_data = 1;
}else{
MAX_data = 0;
}
Nop();
MAX_clock = 1; // Clock high
Nop();
MAX_clock = 0; // low
test = test << 1;
}
if(chip_load)
{
MAX_load = 1; // load MAX7219
MAX_data = 0; // drop data line
}
}
C is not that far removed from Basic
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?