[SOLVED] LED Dot Matrix Board - Sure Electronic

Status
Not open for further replies.

infini8zx

Newbie level 2
Joined
Nov 4, 2012
Messages
2
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,301
Hi all.

I am working on LED dot matrix produce by Sure Electronic which the board uses Holtek chip (HT1632). Does anyone know on how to develop program for this chip? Currently I am using PIC16F877A. I am not very familiar with PIC. I search for information on the net and most of them recommend SPI module.
Here is the code so far. I just want to light up any of the LED on the board. But it seems not working. I dont know whether the clock aint connect properly or due to program itself.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
unsigned char i;
char test[30] = "Hello world! World of hello." ;
void main() {
//  SPI_init();               // standard configuration
 
 
CMCON = 0x07;   // Disable comparators
ADCON1 = 0x0F;  // Disable Analog functions
 
                            //  instead of SPI_init, you can use SPI_init_Advanced as shown below
                            // SPI_init_Advanced(Master_OSC_div64, Data_SAMPLE_MIDDLE , CLK_Idle_HIGH , HIGH_2_LOW);
  TRISC &= 0xFD;
//  max7219_init1();          // initialize  max7219
//while (1){
Spi_Init_Advanced(MASTER_OSC_DIV64, DATA_SAMPLE_MIDDLE, CLK_IDLE_HIGH, HIGH_2_LOW);
  PORTC &= 0xFD;
  PORTC.f1 = 1;
  PORTC.f1 = 0;
  SPI_write(0b00000100);
//  Delay_ms(2);
  SPI_write(0b00000000);      //sys dis
//  Delay_ms(2);
  SPI_write(0b00000100);
//  Delay_ms(2);
  SPI_write(0b00100000);      //com option
//  Delay_ms(2);
  SPI_write(0b00000100);
//  Delay_ms(2);
  SPI_write(0b00011100);      //master mode
//  Delay_ms(2);
  SPI_write(0b00000100);
//  Delay_ms(2);
  SPI_write(0b00000001);      //sys on
//  Delay_ms(2);
  SPI_write(0b00000100);
//  Delay_ms(2);
  SPI_write(0b00000011);      //led on
//  Delay_ms(2);
  PORTC.f1 = 1;
  Delay_ms(2);
  PORTC.f1 = 0;
  SPI_write(0x02);
//  Delay_ms(2);
  SPI_write(0x80);
//  Delay_ms(2);
  SPI_write(0xFF);
  Delay_ms(1000);
  PORTC.f1 = 1;
}~!




Any hint or help will be much be appreciated. Thanks in advance.
 
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…