troubles programming PIC32 MX250F128B (VDM-1 terminal)

279 views
Skip to first unread message

Giovi Alex

unread,
Nov 1, 2021, 4:26:19 PM11/1/21
to Altair-Duino

Hello guys,

For my first Altair-Duino I recently bought a VDM-1 terminal from Chris Davis, and must to be said it worked flawless.

Since I also built a "nano" altair-duino, I decided to build a "nano" vdm-1 terminal with the video and keyboard section only (the SDcard is connected directly to the Arduino and I don't need another com port, anyway).

I was trying to program the microcontroller with a Pickit 3.5 clone programmer and the MpLab IPE software, but I can't get the rid of it.  I tried to use the VDM-1 board to program the new Pic32 controller but I have some troubles making mplab to detect the chip, so I decided to use a breadboard with the following connections:
PIC32 Pin 1 -> Pin 1 on PICkit3.
Pins 13 (VDD), 23 (VBUS3V3) and 28 (AVDD)  -> Pin 2 (VDD) on PICkit3.
Pins 8 (VSS), 19 (VSS) and 27 (AVSS) -> Pin 3 on PICkit3.
Pin 4 (PGED1) -> Pin 4 on PICkit3
Pin 5 (PGEC1) -> Pin 5 (PGC) on PICkit3.

0.1uf capacitor between Vdd and GND (Vss)

10uF tantalum cap between Pin 20 (CAP) and Pin 19 (VSS)

10k pull up resistor between (MCLR) and Vcc.

In the MPLAB settings I set to power the Pic32 (I tried with 3.25 and 3.375 Volts, same result).

These are the error messages I got from the MPLAB IPE with read, erase, verify, program options.

Any idea/hint/suggestion?

*****************************************************
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.56.09
Firmware type..............PIC32MX
Programmer to target power is enabled - VDD = 3,375000 volts.
Target device PIC32MX250F128B found.
Device ID Revision = A1
-------------------------
Erasing...
Failed to erase the device
Selected device and target: memory mismatch.
--------------------------
Reading...
The following memory area(s) will be read:
program memory: start address = 0x1d000000, end address = 0x1d01ffff
boot config memory
configuration memory
Failed to read device
Selected device and target: memory mismatch.
---------------------------------
Blank Checking...
Blank check complete, device is not blank.
---------------------------------
programming (using both .hex files found in the Hansel's repository on github):

Loading code from c:\VDM-1 Terminal\VDM1-bootload.hex...
2021-11-01 17:08:02 -0300 - Hex file loaded successfully.
2021-11-01 17:08:08 -0300 - Programming...
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x1d007000, end address = 0x1d014fff
configuration memory
Failed to program device
Selected device and target: memory mismatch.
-----------
Loading code from c:\VDM-1 Terminal\VDM1-programmer.hex...
2021-11-01 17:08:33 -0300 - Hex file loaded successfully.
2021-11-01 17:08:40 -0300 - Programming...
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x1d000000, end address = 0x1d01f7ff
boot config memory
configuration memory
Failed to program device
Selected device and target: memory mismatch.

Giovi Alex

unread,
Nov 1, 2021, 4:36:06 PM11/1/21
to Altair-Duino
More: I'm not sure about the program memory range, set by default to "1d000000-1d01ffff"... I can leave the programmer to make the choice or manually bypass it and set ON or OFF the options "Configuration Memory", "Boot Flash" and "Program Memory" (plus the memory range).

And what is the correct hex file to be used, VDM1- bootload.hex or VDM1-programmer.hex?

Chris Davis

unread,
Nov 1, 2021, 5:07:05 PM11/1/21
to Altair-Duino
FWIW, the kit you bought from me was intended to be used as a VT100 emulator, not the VDM-1.  The code David wrote for the VDM-1 is meant to be used in the original project by Geoff Graham (https://geoffg.net/terminal.html).  Geoff's original design used a PS2 keyboard, while mine has been modified to use a USB keyboard.

Giovi Alex

unread,
Nov 1, 2021, 6:43:03 PM11/1/21
to Altair-Duino
Gosh, I totally went wrong on that LOL

For some reason I assumed your I/O board was an improved version of the board designed by Geoff Graham (with the addiction of the SD card, the audio etc.) that uses the David Hansel's code. Just now I realized that's a different board...   not sure how I confused that but I have to say I don't know almost nothing about the Altair & C.

So right now I realized I have two different problems, since basically I built a PCB starting from your PCB layout and cut off what it don't need (serial, power, audio and SD card):

1) I haven't the right firmware for the VT-100t (maybe I can solve it  stepping back to the VTM-1 project, removing the USB port and hard-wire the PS/2 port... I suppose the rest of the Pic32 layout should be the same in both boards...? I must to check that.)

2) I still don't know how to get the rid of the error programming the Pic32.

da...@hansels.net

unread,
Nov 1, 2021, 7:12:33 PM11/1/21
to Altair-Duino
On Monday, November 1, 2021 at 4:36:06 PM UTC-4 strava...@gmail.com wrote:
More: I'm not sure about the program memory range, set by default to "1d000000-1d01ffff"... I can leave the programmer to make the choice or manually bypass it and set ON or OFF the options "Configuration Memory", "Boot Flash" and "Program Memory" (plus the memory range).

And what is the correct hex file to be used, VDM1- bootload.hex or VDM1-programmer.hex?

As described here, the "bootload" image is for uploading via the bootloader that is already installed
when you get one of Geoff's pre-programmed devices. The "programmer" image is the one to use
when using the PicKit programmer.

Unfortunately I can't help you with the error message. I don't remember seeing that message before
and it's been years since I worked with the PIC32 and its environment.

David

Giovi Alex

unread,
Nov 1, 2021, 8:40:24 PM11/1/21
to Altair-Duino
Ok, David, thank you, I missed that part.
I will try to investigate why I'm getting this error.

Giovi Alex

unread,
Nov 2, 2021, 2:01:56 PM11/2/21
to Altair-Duino
Ok I got the rid of the problem. There are a lot of different instructions with slightly different pinouts and/or components on the web; and I also found that's a little tricky because the length of the connections on the breadboard are critical, if you use long wires you will get strange errors.

However this is the setup that worked flawless using a PicKit 3.5 Chinese clone from Aliexpress and a breadboard.
I used the MPLAB X IPE v5.50 software, that comes with the freeware Microchip MPLAB-X IDE suite (https://www.microchip.com/en-us/development-tools-tools-and-software/mplab-x-ide)

  • Pin 1 is MCLR, and connects to Pin 1 on PICkit3.
  • Pins 13 (VDD), 23 (VBUS3V3) and 28 (AVDD) all connect to the Power Rail of the breadboard, and to Pin 2 (VDD) of the PICkit3.
  • Pins 8 (VSS), 19 (VSS) and 27 (AVSS) all connect to Ground, and to Pin 3 of the PICkit3.
  • Pin 4 (PGED1) connects to Pin 4 (PGD) of the PICkit3.
  • Pin 5 (PGEC1) connects to Pin 5 (PGC) of the PICkit3.
  • Pin 6 of the PICkit3 remains unconnected.
  • add a 0.1uf capacitor between the Power and Ground rails on the breadboard.
  • Also between Pin 20 (CAP) and Pin 19 (VSS) add a 0.01uf capacitor (I checked, it doesn't work without this cap).
  • Add a 10k pull up resistor from Pin 1 (MCLR) to Power rail (VDD). 
Remember to go to the Power section and select the "Power target circuit from programmer" and set the Voltage Level to 3.25 v.

Troubleshooting:
- error message: "Target device was not found (could not detect target voltage VDD), check (again) the above setting in the Power section.

- error messages: "Failed to read device", "Selected device and target: memory mismatch.", "Blank check complete, device is not blank.", "Protected code" etc. - try to change the length of the connections, etc. The Pic32 is picky, indeed.

--Giovi
Reply all
Reply to author
Forward
0 new messages