Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Olimex PIC32-T795 support
03-10-2012, 11:25 AM, (This post was last modified: 03-10-2012, 11:26 AM by pingotg.)
#11
RE: Olimex PIC32-T795 support
Sounds like you're going the right sort of direction.

For debug I found CDC.printf more useful than serial. I just connect using a terminal emulator such as "screen" via the same USB cable used for downloading the hex.

I have a PIC32-Pinguino OTG and its board has legend (silkscreen) with D0 (and lots of others) so that was chosen as PIN 0 and is thus the first entry in each of those arrays in digitalw.c (from which you can also see it is port D bit 2 i.e. RD2).

Just choose settings that make sense.

There's a really good Xref PDF for my kind of board in the wiki which you might find useful to see what another board did, if you get stuck.

John
Reply
03-10-2012, 12:15 PM,
#12
RE: Olimex PIC32-T795 support
(03-10-2012, 11:09 AM)regis Wrote:
(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 ...

This sounds good to me. Will change the definitions like that.

In the meantime I tried the sketches (both the one directly accessing the registers, and the one with the pins), could use mphidflash on Windows to upload the sketch with no positive result. No blink, no correct voltage measured on the pins.

One thing I noticed, that after flashing the hex of that sketch, the board doesn't show up as a serial port anymore. Is that an expected result? If I re-flash the Olimex bootloader, then it shows up again, but another sketch upload and it's gone.

Also, in a strange way, I can use Windows +mphidflash to upload the sketch, while I have two Linux machines (Ubuntu, Archlinux) that cannot upload it anymore.... Not sure what to make of it.
Reply
03-10-2012, 07:07 PM, (This post was last modified: 03-10-2012, 07:11 PM by pingotg.)
#13
RE: Olimex PIC32-T795 support
Does lsusb still show it as the same VID & PID as before?

You may have to reflash the bootloader and try various downloads to the board to make sure.

BTW, you should be able to blink a LED without using any Pinguino (Arduino-like) code i.e. just output straight to the ports rather than using the functions in digitalw.c. When that works you'll be able to compare with doing it the Pinguino / digitalw.c way.

John
Reply
04-10-2012, 03:26 AM,
#14
RE: Olimex PIC32-T795 support
(03-10-2012, 07:07 PM)pingotg Wrote: Does lsusb still show it as the same VID & PID as before?

You may have to reflash the bootloader and try various downloads to the board to make sure.

The bootloader mode VIDTongueID is the same all the time 15ba:0032, while the USB-Serial mode VIDTongueID is changing with bootloader firmware version (seen some Microchip Inc VID show up, a couple of Olimex number combinations over the different firmwares)

Quote:BTW, you should be able to blink a LED without using any Pinguino (Arduino-like) code i.e. just output straight to the ports rather than using the functions in digitalw.c. When that works you'll be able to compare with doing it the Pinguino / digitalw.c way.

John

Yeah, I think that's the sketch earlier in the forum, right? (still trying to understand the lot of built in variables). I tried and couldn't make that work just yet, will check it again. Smile
Reply
04-10-2012, 07:30 AM, (This post was last modified: 16-10-2012, 03:40 PM by schumi.)
#15
RE: Olimex PIC32-T795 support
I would make a XRef-sheet, in the attachement there is a early incomplete version.

Doesn't go the pinguino bootloader on the board, when you close jumper RD8?

Edit 2012-10-16:
Attachement removed
Reply
04-10-2012, 11:46 AM,
#16
RE: Olimex PIC32-T795 support
(04-10-2012, 07:30 AM)schumi Wrote: I would make a XRef-sheet, in the attachement there is a early incomplete version.

Okay, working on it. I checked out the example you uploaded, and it's not totally clear what field is what, and seems there's some redundant information there. Could you elaborate a little?

For example, for the PIC32-T795 board pin 8, I know it is IC pin#51, alternate function is "MOSI", the register is RD3, though how to parse the info that that pin is "SCL3/SDO3/U1TX/OC4/RD3"? How the digitalw.c fields look like? What is main and alternate function? I guess this much would help to get started on it.

(04-10-2012, 07:30 AM)schumi Wrote: Doesn't go the pinguino bootloader on the board, when you close jumper RD8?

Ah, I see! Maybe this is the part I was looking for... I can see the jumper position outlined on the bottom of the board, though it is merely 3 surface mount pads, I wonder how to "jumper" them? Preferebly without soldering anything to it, if possible.
Reply
04-10-2012, 12:17 PM, (This post was last modified: 04-10-2012, 12:20 PM by pingotg.)
#17
RE: Olimex PIC32-T795 support
I only know that board from its specs but maybe it helps to know that on the other boards the procedure is: reset while holding the user button pressed takes the board into bootloader mode (you need to release Reset before you release the User button). With the user button not pressed the board just jumps from the bootloader into the user app (that's the one you better have downloaded in the other mode LOL).

In bootloader mode the bootloader flashes the 2 LEDs alternately.

I see the T795 does have enough buttons and LEDs so maybe it functions that way.

Now, in bootloader mode the board has a particular USB VID & PID. Otherwise it has no USB unless you use CDC.printf (etc) in which case the Pinguino lib linked into your user app then creates a USB endpoint and thus has a VID/PID pair (which are not the same as the other pair).

John
Reply
04-10-2012, 01:47 PM,
#18
RE: Olimex PIC32-T795 support
(04-10-2012, 11:46 AM)imrehg Wrote: For example, for the PIC32-T795 board pin 8, I know it is IC pin#51, alternate function is "MOSI", the register is RD3, though how to parse the info that that pin is "SCL3/SDO3/U1TX/OC4/RD3"? How the digitalw.c fields look like? What is main and alternate function? I guess this much would help to get started on it.
Yeah, in the manual of olimex are wrong numbers, on the schematic plan its right.

I take XRef of PIC32 Pinguino OTG as template
Reply
04-10-2012, 05:20 PM,
#19
RE: Olimex PIC32-T795 support
(04-10-2012, 01:47 PM)schumi Wrote:
(04-10-2012, 11:46 AM)imrehg Wrote: For example, for the PIC32-T795 board pin 8, I know it is IC pin#51, alternate function is "MOSI", the register is RD3, though how to parse the info that that pin is "SCL3/SDO3/U1TX/OC4/RD3"? How the digitalw.c fields look like? What is main and alternate function? I guess this much would help to get started on it.
Yeah, in the manual of olimex are wrong numbers, on the schematic plan its right.

I take XRef of PIC32 Pinguino OTG as template

I went through the pin numbers both in the manual and the schematics a few times, it seems to me they have exactly the same mapping, so both should be good.

Will do an Xref doc based on the OTG one, and post it here to check it out.
Reply
16-10-2012, 03:38 PM, (This post was last modified: 17-10-2012, 07:52 AM by schumi.)
#20
RE: Olimex PIC32-T795 support
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.


Attached Files
.pdf   XRef PIC32-T795 without idepins.pdf (Size: 166.53 KB / Downloads: 14)
.xls   XRef PIC32-T795.xls (Size: 56.5 KB / Downloads: 18)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)