cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO pin not driven high

huck
Associate II
Posted on September 04, 2014 at 14:58

Hello,

Ich have a question. I am connecting the output pin (PC7) of STM8S003K3 to input pin (PC7) of STM8S207S. When I set the pin to high, I do not see the input pin PC7 (as interrupt input) of STM8S207S goes to high.

The following is my pin configuration:

PC7 on STM8S003K3:

PC_ODR = 0x00; 

PC_CR1 = 0xFE;  //pc7 as push pull

PC_CR2 = 0x00;  //pc7 speed up to 10MHz

PC_DDR = 0x9E; //pc7 as output

PC7 on STM8S207SB:

PC_ODR = 0x00; 

PC_CR1 = 0xEE;  //PC7 is pull up

PC_DDR = 0x6E;  //PC7 is input

If I measured the PC7 pin of STM8S003K3 directly without it connected to the PC7 of

STM8S207S, it works. I see this pin goes high and low. The register output also shows that it is doing what I want.

Anybody can help me on this?

Sincerely yours,

HL

#gpio-not-going-high
5 REPLIES 5
balmukund66
Associate II
Posted on September 05, 2014 at 08:18

Hello ,

Please try below:

ForPC7 as  o/p Pin config:

PC_CR1 = 0x80; //pc7 as push pull

PC_CR2 = 0x80; //pc7 speed up to 10MHz

PC_DDR = 0x80; //pc7 as output

ForPC7 as i/p Pin config:

PC_CR1 = 0x80;

PC_CR2 = 0x00;

PC_DDR = 0x00;

Thanks & Regards

Balmukund Prasad

huck
Associate II
Posted on September 05, 2014 at 14:19

Hello Prasad,

thanks for your assistant. I have tried setting the PC_CR2 to 0x80. This is the only change you suggested right?

It did not work.

If you have other suggestions, let me know.

Thanks,

Huck

balmukund66
Associate II
Posted on September 08, 2014 at 11:17

Hello ,

ForPC7 as output Pin config ( STM8S003K3):

PC_CR1 = 0x80; //pc7 as push pull

PC_CR2 = 0x80; //pc7 speed up to 10MHz

PC_DDR = 0x80; //pc7 as output

ForPC7 as input  Pin config   (STM8S207S):

PC_CR1 = 0x80;

PC_CR2 = 0x00;

PC_DDR = 0x00;

Thanks & Regards,

Balmukund Prasad

huck
Associate II
Posted on September 15, 2014 at 13:28

Hello Prasad,

I have a new piece of information on my pin not going high problem. The output pin PC7 from STM8S003K3 is going into input PC7 of STM8S207S. On the input side, the input pin is configured as interrupt detect if this signal. If I disable this interrupt, then it works as I expected, that is, if I set PC7 output to high, I see PC7 input high.

How does the interrupt configuration of this pin affect this signal?

Yours sincerely,

Huck

huck
Associate II
Posted on September 25, 2014 at 17:18

Problem solved. The pin was not completely 'released' by SPI. We set the master to clock out 1 more byte before the spi is disable. After this, the problem is solved. The pin is free to use as GPIO pin again.