|
|
View previous topic :: View next topic |
Author |
Message |
ww Guest
|
ccs pic16f77a as1100 led driver |
Posted: Sat May 07, 2005 5:29 am |
|
|
i can not interface between pic and as1100 .......... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat May 07, 2005 12:16 pm |
|
|
If you look on the product website, it says that as1100 is compatible with
MAX7219. So then use Google to find a driver.
Search for: MAX7219 int char
This will find C language drivers. Most of them are for the 8051.
To search for a CCS driver, use this: MAX7219 "#use delay" int char
When you do that, and follow the links, you eventually get to this
webpage, which has CCS drivers that can be downloaded, down at
the bottom of the page.
http://www.fernando-heitor.de/pic/projekte/max7219/programm.htm
The comments are in German, so you could translate them, but at
least you have a driver. |
|
|
djpark
Joined: 02 Mar 2004 Posts: 49
|
|
Posted: Sun May 08, 2005 8:05 pm |
|
|
You can use this site to translate it.
http://world.altavista.com/babelfish/tr
For your convenience, the translated text is here.
Quote: | Sample program for the MAX7219
In this sample program the pins of the MAX7219 are attached as follows:
Pin RB1 = pin DATA of the MAX7219
Pin RB2 = pin LOAD of the MAX7219
Pin RB3 = pin CLK of the MAX7219
I use here a PIC16F873, in addition, a sample program for the PIC16F84a is here present.
I would like to explain here the two important routines, which are relevant for the control of the MAX7219.
The routine AUSGABE() gives the uebermittelteten data to the indicated digit, e.g.. AUGABE(1,0x02); at the digit the number of 2 represents 1.
The routine AUSGABE_INIT() initialize the functions of the MAX7219.
Routine AUSGABE():
Code: | void AUSGABE(char address,char worth)
{
char x;
//before the data will transfer, first the pin LOAD set on LOW.
//the data begin MSB with the bit D15, thus
output_low(LOAD);
//the data bits D15-D12 are transferred
//these there are important, to 0 are not conveyed
for (x=0;x<4;x++)
{
output_low(DATA);
output_high(CLK);
output_low(CLK);
}
//the data bits D11-D8 contain the register address of the MAX7219
for (x=4;x>0;x)
{
if (bit_test(adresse, x-1)) output_high(DATA);
else output_low(DATA);
output_high(CLK);
output_low(CLK);
}
//the data bits D7-D0 are the data to the MAX7219
for (x=8;x>0;x)
{
if (, x-1 bit_test(wert)) output_high(DATA);
else output_low(DATA);
output_high(CLK);
output_low(CLK);
}
//in the end the pin LOAD is set on HIGH, thus is those
//data communication to end
output_high(LOAD);
} |
Routine AUSGABE_INIT():
Code: | void ausgabe_init()
{
ausgabe(0x0b, 0x04); //the number of digits is indicated here (5 digits)
ausgabe(0x0c, 0x01); //displays are set on normal operation (no shutdown)
ausgabe(0x09,0xff); //displays are set on normal operation (no display test)
ausgabe(0x0a, 0x00); //the brightness of the digits is stopped here
}
|
Download of the example of the PIC16F873
Download of the example of the PIC16F84a
|
-- dj |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|