cancel
Showing results for 
Search instead for 
Did you mean: 

problem on PC0 of stm32f4discovery

xtian
Associate II
Posted on February 13, 2013 at 09:40

Hi guys,

last week i am still able to use my pc0 as input, now he is rebelling it is configured as input but it has an output of 2.25v I dont understand why
9 REPLIES 9
Posted on February 13, 2013 at 16:05

last week i am still able to use my pc0 as input, now he is rebelling it is configured as input but it has an output of 2.25v I dont understand why

 

From the information provided it's hard for me to understand too. Did you change some code, or burn it out? Isn't PC0 connected to the USB Power On, with an external 10K pull up?
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on February 14, 2013 at 01:28

nope... I think this is a bug and PC0 is not an good idea to use as an input as you will play a tug of war or voltage and might damage the mcu (based from my experience with pic when i played tug of war with the parallel port.) thanks so much clive..

anyweyz instead i tried pc8 now heres another trivia

my code is

Data = 255 - (GPIOC ->IDR>>1 & 0x00FF) ;

so in my portc.1-portc.8 heres my input ->00111111

I expect my data to be 3 but what comes out is 131 so there's an excess 128

when i try portc.1-portc.8 heres my input ->00111110

I expect my data to be 131 but what comes out is 3 so there's a missing 128

when i try portc.1-portc.8 heres my input ->11111111

I expect my data to be 0 but what comes out is 128 so there's an excess 128

my portc.8 is being inverted in nature.. is there something wrong with what i did?

Posted on February 14, 2013 at 01:45

Perhaps you have it wired up, or configured wrong. Can't help you there.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on February 14, 2013 at 01:58

Hi Clive... thanks for the heads up.

its is configured the same as others... pulldown res of 3k 1% tol

xtian
Associate II
Posted on February 14, 2013 at 02:16

but this code is correct ryt?

 DIOData = 255 - (GPIOC ->IDR>>1 & 0x00FF) ;

if I want to capture ascii data from port c1 - c8

Posted on February 14, 2013 at 02:49

Doesn't look unreasonable, I might do this

DIOData = ((~GPIOC->IDR >> 1) & 0x00FF) ; // PB[1..8]

You could do a printf(''%04X\n'', GPIOC->IDR);  to confirm the data bits presenting.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on February 14, 2013 at 06:48

woooh. whats ~ for? invert?

Posted on February 14, 2013 at 13:18

What's

http://www.eskimo.com/~scs/cclass/int/sx4ab.html

?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
xtian
Associate II
Posted on February 15, 2013 at 07:08

Thank you very much clive!