Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC Programming with stm32f4

Not open for further replies.

Montassar Ghanmy

Junior Member level 2
Feb 17, 2015
Reaction score
Trophy points
Activity points
Hi there , I'll be asking quiet an odd question but is it possible to program a PIC Microcontroller using an ST link or stm32f4 discovery board in general ??
If this has been asked before or was a blog post about this anyway please let me know.
Many thankx !!

wow, that's a really interesting question...

is it possible?
yes it is!

did somebody did it?
sadly I doubt so. (and your google fu should be enough)

how can you do it?
at first look only for a specific PIC chip, almost every pic is programmed with slight differences so it's hard to start to aim a general PIC programmer
then look for that specific PIC the Programming Specifications pdf (like this one for a simple pic16f877a
ah! also take a look at the ICSP guide but the Prog.spec doc is more important...

with this you need to:

probably make a level translator (bidirectional for RB7) if your PIC is 5V and your ST link is 3.3v
make a switchable Vpp controller (so you can change the RST/VPP pin from 0v to 5v to 13v [or the specific voltages for your pic]
bitbang on RB7 and RB6 the commands to identify, initiate and the basic erase write verify(read)
all of this with some custom software on the PC side...

it's a lot of pain, but you can do it with enough time...

in other words, doable, but probably not already done...
Aha, I see . Well explained thank you. Indeed I think it will be a big head ache if to be done from zero.

It *might* be a little easier if you select the appropriate PIC. Having said that, I have no experience in this and I'm working on little information.
However, the ST-Link is supposed to work with JTAG interfaces and some of the PIC devices can be programmed through their JTAG (note: I seem to recall that some have a JTAG interface but they cannot use that for programming).
Therefore at a hardware level you *might* be able to do this. JTAG *should* be standard between devices (but this is probably not guaranteed) and you may be in luck at the software level if you have a suitable software to drive the hardware.
By far the best way is to get something like a PicKit3 programmer and debugger and use the ICSP interface. These devices are not that expensive but at something like $40 they could be out of reach of students. On the other hand you buy one and can then use it for nearly every past and future MCU form Microchip.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to