Shop OBEX P1 Docs P2 Docs Learn Events
Contigious writing using 1632C — Parallax Forums

Contigious writing using 1632C

SriSri Posts: 4
edited 2010-08-09 03:34 in BASIC Stamp
Hi,
i am using 1632C. i am using 24X16 Led Matrix Display. i sent all the data in successive address writing. i can view the data that i am sending. when i keep the data in continous loop, i found that data is getting shifted. it is not periodical. it is Random. i kept 500ms delay for writing of data. there is no flickering. everything is fine. But only the thing is data is shifting in group of locations. the locations group is also random. the data which i am displaying is sent to hyper terminal. i found the data is correct. Can u please give me the suggestion. i am at the completion of the project.

rgds
srikanth.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-08-04 15:57
    Attaching your code would be a good start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SriSri Posts: 4
    edited 2010-08-05 10:45
    void HT632Init(void)
    {
    
    
        ChipEnable(CS1);    //Enable Chip/ IC 1 for configuration purpose
        
        ControlComndIssue();
    
        ComandData(0x001);  // master sysdis
        ComandData(0x048);      //Nmos for 1632c
        ComandData(0x142); // PWM settings
        ComandData(0x030);    // master mode
        ComandData(0x003); //system Enable   
        ComandData(0x007);  // LED on
        ComandData(0x011); //blink led off
        
        
        ChipDisable(CS1);  // Disable IC for write protect
        
        DelaymS(1);    
        DelaymS(1);    
        
    }
    



    void ControlComndIssue(void)
    {
            WRLOW;
        DelaymS(1);
        DATAHIGH;  //1 Data High issue as a First bit of command
        DelaymS(1);   
    
        WRHIGH;    //Make WR pin High
        DelaymS(1);   
          
           WRLOW;   //Make WR pin Low
        DelaymS(1);
        DATALOW;  //Make Data Pin Low 
        DelaymS(1);   
    
        WRHIGH;//Make WR pin High
        DelaymS(1);   
    
        WRLOW; //Make WR pin Low
        DelaymS(1);
        DATALOW;  //Make Data pin low 
        
        DelaymS(1);   
    
        WRHIGH; //Make WR pin high
        DelaymS(1);   
    }
    




    void ControlDataIssue(void)            //This function is called before the data is placed.
     {
          WRLOW;
        DelaymS(1);
        DATAHIGH;  //1 Data High issue as a First bit of command
        DelaymS(1);   
    
        WRHIGH;
        DelaymS(1);   
          
           WRLOW;
        DelaymS(1);
        DATALOW;  //0 
        DelaymS(1);   
    
        WRHIGH;
        DelaymS(1);   
    
        WRLOW;
        DelaymS(1);
        DATAHIGH; //1
        DelaymS(1);   
    
        WRHIGH;
        DelaymS(1); 
     }
    



    void ComandData(unsigned int CmdData)
    {
        int BitCount;              
        for(BitCount=9; BitCount>0; BitCount--)    
        {
            WRLOW;    
            DelaymS(1);   
        
            if(CmdData & 0x100)
                DATAHIGH;
            else
                DATALOW;              
            DelaymS(1);   
            WRHIGH;
            DelaymS(1);   
            CmdData <<= 1;       
        }                     
    }
    



    void HT1632AddresSend(unsigned char ADD)
    {          
    //    char AddressDataBit;
        unsigned char Addrs = ADD;
    
        for(AddressDataBit=7; AddressDataBit>0; AddressDataBit--)    
        {  
            WRLOW;
              DelaymS(1);
    
            //Send Address Bit by Bit , MSB first
    
            if(Addrs & 0x40)
                DATAHIGH;
            else
                DATALOW;
            
            DelaymS(1);
            WRHIGH;    
            DelaymS(1);                  
            Addrs <<= 1;  
        }    
    
        
    }
    
    void HT1632DataWrite(unsigned char data)
    {          
        char AddressDataBit;
        unsigned char DataNibble = data;            
        for(AddressDataBit=4; AddressDataBit>0; AddressDataBit--)    
        {
            WRLOW;
            DelaymS(1);        
            // Send Data Bit by Bit to IC, LSB first
            if(DataNibble & 0x01)
                    DATAHIGH;
            else
                    DATALOW;
            
            DelaymS(1);
            WRHIGH;
            DelaymS(1);
            DataNibble >>= 1;     
        }        
    }
    



    void main(void)
    {
    HT632Init();
    ControlDataIssue();
    HT1632AddresSend(0);
        for (Addr=0x00;Addr<=0X5f;Addr++)     //the size of the digit 5f
        {    
        
            HT1632DataWrite(Data);
        }
    }
    
    
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2010-08-05 11:31
    Since you provided C code and you are in a Basic Stamp forum, there's one issue there. What microcomtroller are you using? If you do a search on the Paralax forums (in particular the SX forum) for the key word HT1632 or HT1632C you will see some of my code and others. One issue I saw was that Sure Electronics sells a couple of displays that used the obsolete HT1632 chip and have now gone to the current HT1632C chip. There are some differences in the coding that you can not get HT1632 code to work on a HT1632C chip. I think it's the master or reset command that's one difference. If you do the search on the forum for HT1632C you will see a post from me that describes the differences.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2010-08-05 12:17
    http://forums.parallax.com/showthread.php?p=867334

    Take a look at this and it will provide the coding changes between the HT1632 and the HT1632C
  • SriSri Posts: 4
    edited 2010-08-09 03:21
    i gone through the changes before starting the project. the display is working fine. but the only problem is the data is shifting at random intervals (ex: 2mins, 1 min/ start of the display). it is not sequential or periodical. i am writing the data in successive addressing mode. the procedure i am following after the initialization is. i am issuing command, initial address (0) and subsequent data.
    i am using the controller Luminary make LM3S3748
  • SriSri Posts: 4
    edited 2010-08-09 03:34
    I gone through the changes before starting the project. the display is working fine. but the only problem is the data is shifting at random intervals (ex: 2mins, 1 min/ start of the display). it is not sequential or periodical. i am writing the data in successive addressing mode. the procedure i am following after the initialization is. i am issuing command, initial address (0) and subsequent data.
    i am using the controller Luminary make LM3S3748
Sign In or Register to comment.