Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Olimex PIC32-T795 support
19-10-2012, 05:33 AM,
#21
RE: Olimex PIC32-T795 support
(16-10-2012, 03:38 PM)schumi Wrote: In the attachement are a new version of the XRef-sheet. Please check the sheet out. The columns of digitalw and pinguino functions are empty.

Thanks, I was writing it up as well, just got caught up in other stuff at work. Will do the rest of the filling up and post it here. Cheers!
Reply
31-03-2013, 08:20 PM,
#22
RE: Olimex PIC32-T795 support
Sorry for hijacking old thread, but I did not see that PIC32-T795 started to work for imrehg. Or did it?

1. for me (may be my specific board) I have to connect RD0, RD8 and Button circuit together to get into some bootloader mode (LED1 and LED2 alternating). Then by holding BUTton and clicking Reset I can get into bootloader. By simply cutting RD8 and putting jumper over RD0 does not help - pressing buttons does not bring me into bootloader.

2. Normally board gets ID 15ba:0033 when in Duinomite. When in bootloader mode I get 15ba:0032. Modifying boards.py with:

OLIMEX_ID = 0x15BA
OLIMEX_PIC32_ID = 0x0032

class PIC32_Pinguino_T795:
vendor=OLIMEX_ID
product=OLIMEX_PIC32_ID

does not help, cause pinguino.py in "OnUpload" does not take vendor and product into account. By running with params manually "ubw32 -v 0x15ba -p 0x0032 -w hex.hex -r -n" it seems to be uploading.
Btw, "512000 free bytes" returned by ubw32 seems to be ok, I have PINGUINO-MICRO as well, it shows same amount of free amount either erased or programmed with some code.

3. Simple program as this one:
void setup() {
//run once:
TRISBbits.TRISB15 = OUTPUT;
TRISBbits.TRISB12 = 0;
}

void loop() {
//run repeatedly:
LATBbits.LATB15 = 0;
LATBbits.LATB12 = 1;
delay(500);
LATBbits.LATB15 = 1;
LATBbits.LATB12 = 0;
delay(500);
}
does not blink or light any leds. ubw32 util seems to not get any errors, but impression is that code just does not get into the board. Board is not in Duinomite mode after programming - there is no USB device created, like it would be in that mode.

This all using Ubuntu on pc and x.4 Pinguino.
May be some ideas what I'm doing wrong?
Reply
01-04-2013, 09:59 AM, (This post was last modified: 01-04-2013, 09:59 AM by pingotg.)
#23
RE: Olimex PIC32-T795 support
If it has the DM bootloader I think you'll need to replace it with a Pinguino bootloader and to do that will need a PICkit(2 or 3) or the like.

John
Reply
01-04-2013, 10:21 AM,
#24
RE: Olimex PIC32-T795 support
Ok, I see. Should I take one for UBW32 board from /extra/bootloaders (UBW32 is -512L, T795 - -512H)? I seem not to be able to find specific Pinguino bootloader for T795.

Thanks!
Reggie
Reply
01-04-2013, 06:23 PM,
#25
RE: Olimex PIC32-T795 support
Could not find Pinguino bootloader for PIC32-T795H, so took UBW32 sources, changed to match buttons and leds and compiled with XC32. So far can upload compilation from Pinguino IDE, needs some time for testing I believe.
Reggie

.hex   HIDBoot_ubw32_PIC32-T795H.hex (Size: 46.02 KB / Downloads: 9)
Reply
01-04-2013, 07:30 PM,
#26
RE: Olimex PIC32-T795 support
Made changes to digitalw.c based on imrehg's patch (fixed some issues). Also some preliminary pin mapping (.ods file).
Now we can blink a led Smile
#define LED1 36
#define LED2 19

void setup() {
//run once:
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}

void loop() {
//run repeatedly:
u8 i;
for (i=5;i;i--) {
toggle(LED1);
delay(100);
}
for (i=5;i;i--) {
toggle(LED2);
delay(100);
}
}

Reggie


Attached Files
.c   digitalw.c (Size: 12.4 KB / Downloads: 6)
.zip   Pinguino_T795_pins_2.ods.zip (Size: 17.91 KB / Downloads: 8)
Reply
02-04-2013, 09:03 PM,
#27
RE: Olimex PIC32-T795 support
Some more changes - fixed missing T795 definitions in .c files as per Regis (see attached).
On spi.c. I need SPI for my project. Board have SPI3 out in header convenient, so I put this one as default. Did not know on interrupts though.
Following part is missing for both SPI3 and SPI4, for now to successfully compile my project I put SPI1 values in there since seems SPI interrupt is not used anywhere:
#define INTFAULT INT_SPI4_FAULT
#define INTTXDONE INT_SPI4_TRANSFER_DONE
#define INTRXDONE INT_SPI4_RECEIVE_DONE
For now can compile project with SPI. Did not try analog or pwm so far.

Reggie


Attached Files
.zip   chg.zip (Size: 17.95 KB / Downloads: 6)
Reply
30-04-2013, 11:34 AM,
#28
RE: Olimex PIC32-T795 support
Analog seems to be working fine, though I used just AN2.
I2C - PIC32MX795F512H have 4 modules, with numbers 1,3-5. To successfully compile and use module 1 (on header), we need changes as in i2c.c file, which eliminates non-existing module 2.
PWM - had to add pins to switch case, if using pin definitions from here.


Attached Files
.c   i2c.c (Size: 24.08 KB / Downloads: 3)
.c   pwm.c (Size: 12.36 KB / Downloads: 2)
Reply
01-05-2013, 09:04 AM,
#29
RE: Olimex PIC32-T795 support
Hi,
Thank you for your help.
I will try to commit your files today.
Do you want a SVN account so that next time you can do it yourself Wink ?

(30-04-2013, 11:34 AM)ringo125 Wrote: Analog seems to be working fine, though I used just AN2.
I2C - PIC32MX795F512H have 4 modules, with numbers 1,3-5. To successfully compile and use module 1 (on header), we need changes as in i2c.c file, which eliminates non-existing module 2.
PWM - had to add pins to switch case, if using pin definitions from here.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
02-05-2013, 11:13 AM,
#30
RE: Olimex PIC32-T795 support
Hello Regis,
Oops, sorry, I was wrong on ADC, messed up with my pinguino-micro board. As discovered yestreday that we need changes in file, cause pins on other boards do not match T795. Hope I did it right this time.
As for account - I would better leave comitting to you, if it is ok, I'm not that experienced in svn.

Reggie


Attached Files
.c   analog.c (Size: 8.03 KB / Downloads: 7)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)