Ok I think I am missing something fundamental. I am seeing the same behaviour on my F4 discovery so I don't think it is so much my homebrew board as much as my missing comething important in how GPIO is configured.
This software (since I had been using the F4 discovery) uses the four LED GPIOs to show me various states. It's nice because I can see it by eye, but also can hook my scope/logic analyzer up to the GPIOD12-15 pins to timings measure exactly as well.
My new board is a 64 pin F405 so it only has exposed ports A,B, and C. So basically I am trying to use alternate GPIO pins that are available to me.
In the past on my L1xx based projects, I've generally just set a pad to:
Code: Select all
palSetPadMode( XXXX, YY, PAL_MODE_OUTPUT_PUSHPULL );
and used it to toggle as an output.
Trying the same in my F4 project, say switching from using LED3 (GPIOD13) to say GPIOB13 I don't get the output toggling.
I've even tried setting the pin defaults to exactly the same as LED3 in board.h, that is I added the following to the appropriate bitmasks:
Code: Select all
PIN_OTYPE_PUSHPULL(GPIOB_PIN13)
PIN_OSPEED_100M(GPIOB_PIN13)
PIN_PUPDR_FLOATING(GPIOB_PIN13)
PIN_ODR_LOW(GPIOB_PIN13)
PIN_AFIO_AF(GPIOB_PIN13, 0)
I assume this makes the call to setPadMode( GPIOB, 12, PAL_MODE_OUTPUT_PUSHPULL ); redundant, but I left it in main all the same. Either way, GPIOB13 doesn't toggle, it simply sits at 0v.
Even more odd to me, if I switch again to using GPIOB2 instead, it does in fact toggle, but not with the same timing as the LED GPIOD13. Again, I've set the GPIOB2 pin up exactly the same way in board.h as GPIOD13.
What might I be doing wrong/misunderstanding?
thanks,
Dave