Hi, I am trying to convert my app from mios8 to mios32. In mios8 I used “PORTCbits.RC0 = 1” to turn a pin on, I can’t seem to find an equivalent in mios32. I would like to use the J19 pins if possible. Also is there anything I will need to do to turn off any preexisting drivers or to configure the pins?
Not sure about J19, but there is a tutorial that shows how to do that for J5.
Thank you ilmenator, I am looking at that now. Seems some pins have mios32 def’s and some don’t, I was hoping there was generic C defs could be used to toggle any pin like with the pic. Can someone put some more light on this?
MIOS32 configures J19 pins for software based SPI, but as long as you don’t use MIOS32_SPI_…(2…) (SPI port 2), the pins can be used for other purposes w/o danger. Toggling pins:
GPIOC->BSRR = GPIO_Pin_13;
[/code]
will set the pin to 1, and:
[code]
GPIOC-\>BRR = GPIO\_Pin\_13;
While I got this working (with your help), I still don’t understand exactly why all the config statements are needed (or how they work). Could you give a statement by statement explanation of how this works?
I know it would help me greatly and I am sure other nubies too.