+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Newbie level 2
    Points: 72, Level: 1

    Join Date
    Nov 2012
    Posts
    2
    Helped
    1 / 1
    Points
    72
    Level
    1

    LED Dot Matrix Board - Sure Electronic

    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 by infini8zx; 8th December 2012 at 18:05.

    •   Alt8th December 2012, 12:21

      advertising

        
       

  2. #2
    Newbie level 2
    Points: 72, Level: 1

    Join Date
    Nov 2012
    Posts
    2
    Helped
    1 / 1
    Points
    72
    Level
    1

    Re: LED Dot Matrix Board - Sure Electronic

    i got it working!! o.O


    1 members found this post helpful.

--[[ ]]--