MCUmall EPROM BIOS Chip Burner Forum
MCUmall EPROM BIOS Chip Burner Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 MCUmall Forums
 Novice Place
 Troubles Occurred when Debugging SN74HC165

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an Image File
Check here to include your profile signature.
    

T O P I C    R E V I E W
fanda Posted - 07/06/2017 : 23:24:02
Hello~all
I would like to ask some questions about debugging SN74HC165.
The program is so easy and there are many examples in the internet. I have debuged it two days after board-making. I don’t know why it still cannot read data out and always keep 0xFF. The wave which I detect it by oscilloscope is normal. When program is ready to install into the inside register of HX165 as well as shifting out,but why the data can’t be read out?
The SN74HC165 PDF: www.kynix.com/uploadfiles/pdf8798/SN74HC165D.pdf
My program is as following:
void HC_74165Init(void){
        GPIO_InitTypeDef GPIO_InitStructure;
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD, ENABLE);
                                                      //HC165 CLK   //HC165 SH
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_11; 
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;        
    GPIO_Init(GPIOD, &GPIO_InitStructure);        
        
        
        
                                                //HC-SO
    GPIO_InitStructure.GPIO_Pin =GPIO_Pin_8; 
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode =GPIO_Mode_IPD; ; //GPIO_Mode_IPU;        
    GPIO_Init(GPIOA, &GPIO_InitStructure);                
}

u8 Read_HC165(void)
{
        u8 i;
        u8 Byte=0;
        u8 Data=0;
        SHLD_165=0;//The external port data into internal registers
        delay_nus(100);
        SHLD_165=1; //ready to shift
        delay_nus(100);
        CLK_165=1;
        for(i=0;i<8;i++)
        {
                        
                
                Byte<<=1;        
                Data=GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_8);
                        printf("%X ",Data);
                Byte|=Data;
                CLK_165=0;
                delay_nus(5000);
                CLK_165=1;
                
        }
        
        return Byte;
        
}



Image Insert:

89452 bytes

Image Insert:

7585 bytes

Image Insert:

8337 bytes
2   L A T E S T    R E P L I E S    (Newest First)
anniel Posted - 07/15/2017 : 19:59:47
quote:
Originally posted by supervizeur

quote:
Originally posted by fanda

Hello~all
I would like to ask some questions about debugging SN74HC165.
The program is so easy and there are many examples in the internet. I have debuged it two days after board-making. I don’t know why it still cannot read data out and always keep 0xFF. The wave which I detect it by oscilloscope is normal. When program is ready to install into the inside register of HX165 as well as shifting out,but why the data can’t be read out?
The SN74HC165 PDF: www.kynix.com/uploadfiles/pdf8798/SN74HC165D.pdf
My program is as following:
void HC_74165Init(void){
        GPIO_InitTypeDef GPIO_InitStructure;
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD, ENABLE);
                                                      //HC165 CLK   //HC165 SH
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_11; 
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;        
    GPIO_Init(GPIOD, &GPIO_InitStructure);        
        
        
        
                                                //HC-SO
    GPIO_InitStructure.GPIO_Pin =GPIO_Pin_8; 
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode =GPIO_Mode_IPD; ; //GPIO_Mode_IPU;        
    GPIO_Init(GPIOA, &GPIO_InitStructure);                
}

u8 Read_HC165(void)
{
        u8 i;
        u8 Byte=0;
        u8 Data=0;
        SHLD_165=0;//The external port data into internal registers
        delay_nus(100);
        SHLD_165=1; //ready to shift
        delay_nus(100);
        CLK_165=1;
        for(i=0;i<8;i++)
        {
                        
                
                Byte<<=1;        
                Data=GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_8);
                        printf("%X ",Data);
                Byte|=Data;
                CLK_165=0;
                delay_nus(5000);
                CLK_165=1;
                
        }
        
        return Byte;
        
}



Image Insert:

89452 bytes

Image Insert:

7585 bytes

Image Insert:

8337 bytes



You should ask help on the Kynix forum.



+1 and good luck!
supervizeur Posted - 07/09/2017 : 08:22:17
quote:
Originally posted by fanda

Hello~all
I would like to ask some questions about debugging SN74HC165.
The program is so easy and there are many examples in the internet. I have debuged it two days after board-making. I don’t know why it still cannot read data out and always keep 0xFF. The wave which I detect it by oscilloscope is normal. When program is ready to install into the inside register of HX165 as well as shifting out,but why the data can’t be read out?
The SN74HC165 PDF: www.kynix.com/uploadfiles/pdf8798/SN74HC165D.pdf
My program is as following:
void HC_74165Init(void){
        GPIO_InitTypeDef GPIO_InitStructure;
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD, ENABLE);
                                                      //HC165 CLK   //HC165 SH
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_11; 
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;        
    GPIO_Init(GPIOD, &GPIO_InitStructure);        
        
        
        
                                                //HC-SO
    GPIO_InitStructure.GPIO_Pin =GPIO_Pin_8; 
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode =GPIO_Mode_IPD; ; //GPIO_Mode_IPU;        
    GPIO_Init(GPIOA, &GPIO_InitStructure);                
}

u8 Read_HC165(void)
{
        u8 i;
        u8 Byte=0;
        u8 Data=0;
        SHLD_165=0;//The external port data into internal registers
        delay_nus(100);
        SHLD_165=1; //ready to shift
        delay_nus(100);
        CLK_165=1;
        for(i=0;i<8;i++)
        {
                        
                
                Byte<<=1;        
                Data=GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_8);
                        printf("%X ",Data);
                Byte|=Data;
                CLK_165=0;
                delay_nus(5000);
                CLK_165=1;
                
        }
        
        return Byte;
        
}



Image Insert:

89452 bytes

Image Insert:

7585 bytes

Image Insert:

8337 bytes



You should ask help on the Kynix forum.

MCUmall EPROM BIOS Chip Burner Forum © Copyright 2003 - 2009 Mcumall Electronics Inc. Go To Top Of Page
Generated in 0.09 sec. Snitz Forums 2000