2014-09-04 05:58 AM
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-high2014-09-04 11:18 PM
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 Prasad2014-09-05 05:19 AM
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, Huck2014-09-08 02:17 AM
2014-09-15 04:28 AM
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, Huck2014-09-25 08:18 AM
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.