Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Olimex PIC32-T795 support
02-10-2012, 06:34 AM,
#1
Question  Olimex PIC32-T795 support
Hi everyone!

I have a new PIC32-T795 board from Olimex, and it's mentioned in the Pinguino wiki, but can't seem to find it being supported in the IDE itself (see other Olimex Pinguino boards there only).

Is there anyone using it? Do I need to do some modifications?
Reply
02-10-2012, 10:17 AM,
#2
RE: Olimex PIC32-T795 support
Hi,
I will try to add support to the PIC32-T795 those days.
We keep in touch.

(02-10-2012, 06:34 AM)imrehg Wrote: Hi everyone!

I have a new PIC32-T795 board from Olimex, and it's mentioned in the Pinguino wiki, but can't seem to find it being supported in the IDE itself (see other Olimex Pinguino boards there only).

Is there anyone using it? Do I need to do some modifications?
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
02-10-2012, 10:19 AM,
#3
RE: Olimex PIC32-T795 support
Thanks a lot! I'm happy to test things, just let me know.
Reply
02-10-2012, 12:42 PM,
#4
RE: Olimex PIC32-T795 support
You can get X.4 rev. 563 with a minimal T795 support.
I don't have such a board myself so you will have some work to do :-)
First you will need to define pins number (from mcu-pins to pinguino-pins) in digitalw.c (look for #ifdef PIC32_PINGUINO_T795 ... #endif). I put some wrong definitions so you will have to delete them and replace with yours.
At this point you should be able to blink a led :-)
Then you should still get errors at compilation if you try some other examples but you should only have to modify some libraries by adding || defined(PIC32_PINGUINO_T795) on lines with #if defined (UBW32_795).

(02-10-2012, 10:19 AM)imrehg Wrote: Thanks a lot! I'm happy to test things, just let me know.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
02-10-2012, 04:50 PM,
#5
RE: Olimex PIC32-T795 support
Sounds great, I was checking X.3 so far, now I have found X.4.

Do I have to modify anything for Pinguino (or rather UBW32) to find the correct HID device? (the board has Duinomite bootloader on it). Asking because the whole upload process is new to me, been Arduino guy so far.

Will try these and report back.

(02-10-2012, 12:42 PM)regis Wrote: You can get X.4 rev. 563 with a minimal T795 support.
I don't have such a board myself so you will have some work to do :-)
First you will need to define pins number (from mcu-pins to pinguino-pins) in digitalw.c (look for #ifdef PIC32_PINGUINO_T795 ... #endif). I put some wrong definitions so you will have to delete them and replace with yours.
At this point you should be able to blink a led :-)
Then you should still get errors at compilation if you try some other examples but you should only have to modify some libraries by adding || defined(PIC32_PINGUINO_T795) on lines with #if defined (UBW32_795).

(02-10-2012, 10:19 AM)imrehg Wrote: Thanks a lot! I'm happy to test things, just let me know.
Reply
03-10-2012, 09:20 AM,
#6
RE: Olimex PIC32-T795 support
Okay, some progress, but not there yet.

(02-10-2012, 12:42 PM)regis Wrote: You can get X.4 rev. 563 with a minimal T795 support.
I don't have such a board myself so you will have some work to do :-)
First you will need to define pins number (from mcu-pins to pinguino-pins) in digitalw.c (look for #ifdef PIC32_PINGUINO_T795 ... #endif). I put some wrong definitions so you will have to delete them and replace with yours.

I did make the changes to digitalw.c, here's the patch for what I've done: https://gist.github.com/3825492

I got the data from the User Manual. I'm not sure about the numbering of pins, the legs themselves are counted 1-45, how are these things in Pinguino? E.g there's a LED1 on board pin #37 (MCU pin#30, RB15), how would one refer to it in a sketch?

(02-10-2012, 12:42 PM)regis Wrote: At this point you should be able to blink a led :-)

After that part I did check out the sketch, tried to update the pin number, and uploading it.

Had to recompile ubw32 (for my 64-bit Ubunutu), and had to do a command line upload, supplying the vendor/product id to it, something like: "ubw32 -v 15ba -p 0032 -r -w Blink.hex"

The upload did something, but there was no blinking (regardless of what pin number I tried in the program, as I was trying a few around 37). Also, every time when I uploaded, it started from something like "512000 free bytes", which looks to me that the previous code wasn't actually on it? Or at that point ubw32 already erases things?

Since Blink didn't work, I wanted to try the serial communication (Serial/print numbers.pde), uploaded but nothing happened.

Now, since that last time, when I tried the things that I've tried before, even if the HID device shows up, ubw32 cannot find the device anymore (not permission problem, lsusb gives the same vid/pid, the Olimex Duinomite serial interface works when it's in serial mode). Thus now I cannot upload any sketches at the moment. Any suggestions why it would be like this?

(02-10-2012, 12:42 PM)regis Wrote: Then you should still get errors at compilation if you try some other examples but you should only have to modify some libraries by adding || defined(PIC32_PINGUINO_T795) on lines with #if defined (UBW32_795).

(02-10-2012, 10:19 AM)imrehg Wrote: Thanks a lot! I'm happy to test things, just let me know.
Reply
03-10-2012, 10:16 AM,
#7
RE: Olimex PIC32-T795 support
As far as I know, there should be no problem to use UBW32 and Duinomite bootloader except, as you noticed, VENDOR and PRODUCT ID. Take a look at your board definition in wxgui/boards.py and try to change vendor and product values.

You never know, do you have a pickit3 to reprogram your board if you need it ?

If pins are already numbered from 1 to 45 on the silkscreen then it becomes de facto the Pinguino pins numbers. You just have to find what are the MCU pins connected to these 45 pins.
Take care, Pinguino pins start at 0.

So, if LED1 is on pin #37 = MCU pin#30 = RB15, then you should have this in digitalw.c :
portmask[37]=pB
pinmask[37]=_15

You could also define LED1 in const.h :
Quote:#elif defined(PIC32_PINGUINO_T795)
#define LED1 37
...
#endif

Try this first in the IDE :
Quote:void setup()
{
TRISBbits.TRISB15 = OUTPUT;
}

void loop()
{
LATBbits.LATB15 = 0;
delay(50);
LATBbits.LATB15 = 1;
delay(50);
}

and then :

Quote:void setup()
{
pinMode(37, OUTPUT); // 37 or LED1
}

void loop()
{
toggle(37);
delay(50);
}
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
03-10-2012, 10:28 AM,
#8
RE: Olimex PIC32-T795 support
By the way, do you want a svn account to commit your changes ?
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
03-10-2012, 10:34 AM,
#9
RE: Olimex PIC32-T795 support
Okay, I get the the deal about the pin numbers mostly. The one outstanding thing is: if the pins start from 1, do I have to pad the very first element of the array with something (for "PIN0")? What would be that something that doesn't correspond to any register?

I have checked the sketch and makes sense (really cool that the registers can be accessed like this as well). I have to fix the ubw32 upload (still doesn't work on my current machine) then will check it.

I don't have a pickit3, will have to look into what's going on with the board and whether it can be "fixed" without it. (quote marks because it's maybe my understanding that needs fixing)

Sure, I'm happy to commit my changes when they are done. I'm more of a git guy, so would have to figure out how to do that in SVN.
Reply
03-10-2012, 11:09 AM,
#10
RE: Olimex PIC32-T795 support
(03-10-2012, 10:34 AM)imrehg Wrote: ... if the pins start from 1, do I have to pad the very first element of the array with something (for "PIN0")? What would be that something that doesn't correspond to any register?

You might add some explanations and put :
portmask[0]=255; // something different from pA ... pG
pinmask[0]=0
There will be no error at compilation, it will simply do nothing.

If you have a better idea ...
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)