chipKIT® Development Platform

Inspired by Arduino™

UBW32 MX795 pin defs

Created Wed, 25 Dec 2013 20:20:11 +0000 by meistro


meistro

Wed, 25 Dec 2013 20:20:11 +0000

I searched through the forum and couldn't find.

I see in the variants in the source, pin definitions for many boards. I can't seem to find where the pin defs are for the UBW32 795 board. I looked through everything. I was hoping to find a file similar to the one I found for my CerebotMX4 so I know what pins are what as they are printed on the board.

Can anyone point me in the right direction? Thanks.

Merry Christmas!!!


majenko

Wed, 25 Dec 2013 21:39:45 +0000

The UBW32 doesn't have a proper definition at the moment it seems. The pin numbers in the board definition relate on a 1:1 basis with the port name/numbers in the chip (pin 0 is A0, 1 is A1, 2, is A2... 16 is B1, 17 is B2, etc).

If you fancy spending a rather stimulating half hour or so working out which is which (it might be easier from the schematics) then creating a proper definition for it would be simple enough.


meistro

Thu, 26 Dec 2013 00:07:35 +0000

I was reading through the doc for adding board support and I'm a little confused because I see the UBW32 in the boards list in MPIDE but can't find the relating variant folder. Is this board identical to another board description? Is the descriptor pointing at another board?

Or is this merely just a case of "feature in progress"?

I loaded a simple blink sketch to blink pin 1 and checked every pin with a led. Nothing was blinking so I tried a few more pins with no luck.

I'll keep sifting through the code. I see it in the boards.text file but I can't figure out where to look next.


majenko

Thu, 26 Dec 2013 00:10:30 +0000

In the boards.txt file:

ubw32_mx795.build.variant=Default_100

So you look in variants/Default_100

In there is the Board_Data.c and Board_Defs.h

If you want to make a proper variant for us you'd change that variant pointer to a fresh directory and copy the existing files from the Default_100 directory into it and modify them there.

Edit: Looking at images of the UBW32 it doesn't have the normal 0 1 2 3 4 pin numbering, but A0 A1 A2 B3 B4 G6 etc pin labels. Those map direct to the internal pin names, so you can work out the current pin number by X*16+Y where X is the letter (A=0, B=1, C=2 etc) and Y is the number. So pin B3 is B(1) * 16 + 3 = 19. Pin F7 is F(5) * 16 + 7 = 87.

If you make a logical mapping in the definition starting at a good point and work around the board putting the pins (and just the ones that are there) in the right order, then set up some #define macros for the pin names pointing to those pin numbers that should work nicely.


meistro

Thu, 26 Dec 2013 01:14:43 +0000

Sweet that sounds easy enough. I'll just map them using the pins as shown on the board.

I did something similar for when I use my Cerebot32MX4. Except I use a pins.h file I made and throw it into the sketch on another tab. I found it easier to use pin names like JA1, JB1, JK3...

If I can do this correctly like you are suggesting then I might just modify my files for the Cerebot as well :D

Thanks!!