Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 10 months ago.
Using USB pins for Digital I/O?
I need a couple more I/O pins on my mbed LPC1768 project. I am not using the USB interface and wondered if I could use the USB pins (mbed pins 31 and 32) for DigitalIn and DigitalOut.
I realise there are some passives connected to these pins, but this does not matter in my application.
According to the LPC1768 user manual, these pins can be configured as Port I/O (p31 = Port 0.29 and p32 = Port 0.30). However, declaring DigitalIn or DigitalOut with PinName p31 or p32 doesn't work - the compiler outputs an "Identifier p31/p32 is undefined" error.
Nas anybody succeeded in doing this? If so, how?
2 Answers
10 years, 10 months ago.
I check the pins,It is ok and you can use p0.29 and p0.30 as GPI/O I dont know which way of coding you use but I use CMSIS. Using these configuration made these pin I/O:
PINSEL_CFG_Type PinCfg; PinCfg.Funcnum = 0; PinCfg.OpenDrain = 0; PinCfg.Pinmode = 0; PinCfg.Portnum = 0; PinCfg.Pinnum = 29; PINSEL_ConfigPin(&PinCfg); PinCfg.Pinnum = 30; PINSEL_ConfigPin(&PinCfg);
of course for using these code you should have included "lpc17xx_pinsel.h" to your main program
Dear Paul, Have you managed to use de USB pins for Digital I/O?
posted by FYLA LASER 05 Sep 2018