Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use USB pins as digital IO on pic32MX250 ?
14-04-2014, 01:06 PM,
#1
Use USB pins as digital IO on pic32MX250 ?
Hi all,

is it possible, with pinguino32 (or even pinguino P8) to use the two usb pins (provided a modded PCB to route these pins) as classical digital I/O when in user programm (no USB function).
Actually i need two pins more than the one available on the PIC32MX250, and the USB pins would be really useful for that) (usb function only used to upload the code once)

Joël
Reply
14-04-2014, 07:25 PM, (This post was last modified: 14-04-2014, 07:31 PM by regis.)
#2
RE: Use USB pins as digital IO on pic32MX250 ?
Hi Joël,
As far as I remember if USB module is disabled then D+/D- can be used only as Digital Input.

Edit : I took a look at the PIC32MX1XX/2XX family datasheet and it seems RB10/RB11 (D+/D-) are GPIO. It sounds like a good news for your project ;-)
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
15-04-2014, 08:49 AM, (This post was last modified: 23-04-2014, 03:05 AM by Pinguino.)
#3
RE: Use USB pins as digital IO on pic32MX250 ?
Yep, sounds good. will do some trials as soon as (or close) i receive the board.
Thanks

Joël
Reply
20-04-2014, 09:44 PM, (This post was last modified: 23-04-2014, 03:05 AM by Pinguino.)
#4
RE: Use USB pins as digital IO on pic32MX250 ?
Hi Régis,

Just get an idea: do you think it is possible, by modifying the io.c file (and another one? serial.c maybe?) to remap the serial links to the pins used for usb? It looks like from the datasheet that U2RX, U2TX can be mapped to RB11 and RB10 (which are the usb pins)
This way i will keep the "function pin diagram" of the board as clean as possible, pinguino pins (D0 to D14) for interfacing with sensors/actuator and the usb pins for communication (via serial link)

What do you think of this idea?
Do you think that the bootloader will still be useable if i do that (i mean get the ability to programm easily the chip by "plugging" it onto a normal, non modified pinguino board?)
Reply
21-04-2014, 08:40 PM,
#5
RE: Use USB pins as digital IO on pic32MX250 ?
UART1 is the default standard for the Pinguino 32MX250 so it seems not a big problem to change UART2 pins location but I forgot something essential (Blush) : RB10 and RB11 are not directly accessible (not on pin header). It's maybe not a big problem for you if the board is not yet assembled but it will be certainly one for other users.
Why don't you #define your own flag in your .pde, check if this flag is set in io.c and then change UART2 pins location to RB10/11 ? It will be your own private io.c file but it won't be too difficult to maintain.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
21-04-2014, 10:10 PM, (This post was last modified: 23-04-2014, 03:06 AM by Pinguino.)
#6
RE: Use USB pins as digital IO on pic32MX250 ?
Yep sounds a good idea to have something easy to maintain!! But for sure the best would be to find a way to have USB.CDC work with VB codes!!
Thanks
Joël
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)