Free PDK Documentation
Free PDK is an open sourced and independently created tool-chain for the Padauk 8-Bit Microcontrollers, created as an alternative to the proprietary and closed tools provided by the Taiwanese company itself.
This includes the EasyPDKProg µC programmer hardware, adding support for the Padauk µCs to the SDCC C-Compiler, as well as comprehensive documentation of the instruction set architecture, and code examples.
The main focus is on supporting µCs of two Padauk series:
- M series OTP (OTP = one time programmable)
- F series MTP (MTP = multiple time programmable)
Padauk µCs are extremely inexpensive, priced as low as $0.03/pc in volumes of 100, which is why they generated a lot of interest after being featured by Dave from the EEVblog (first video and a bunch of follow-up videos). Despite the low price, it was found that the Padauk µCs sport an interesting architecture that can be a seen as a significant and meaningful extension of the Microchip PIC architecture. There is an extensive and active discussion on the EEVblog forum for this project and further discussion here on µC.net (German).
This page provides an overview of the different sub-projects created in the free-pdk GitHub organization. It also provides custom pinout diagrams for some of the Padauk µCs.
Easy PDK Programmer
Padauk µCs are programmed via a proprietary high-voltage protocol. The protocol was reverse engineered and a fully open source programmer that already supports almost two dozen Padauk µCs has been created. All sources for the programmer are available at:
SDCC-based Open Source Tool-Chain
Padauk’s own tool-chain is based on a custom programming language called “Mini-C” with a syntax based on the C-language. This language is only supported by their own tool-chain, including IDE (“Padauk Developer Studio”) and programmer (“Writer”). The tool-chain also uses a custom binary format with encryption/obfuscation. Should you be interested in code samples in that custom language, take a look at free-pdk/fppa-code-examples.
The open source tool-chain is based on the Small Device C-Compiler (SDCC) and therefore does support Standard C and common binary output formats (intel hex and bin), including those used by the Easy PDK Programmer.
Please note that right now there is no interchangeability between both tool-chains. Binaries generated by SDCC cannot be written by the official Padauk programmer, but only by the Easy PDK Programmer.
Padauk µCs use different kinds of instruction sets: 13, 14, 15, or 16 bit (more information on these instruction sets can be found below). Support for the 14 and 15 bit Padauk instruction sets has been added to SDCC, a C compiler for small devices. Support for the 13 bit Padauk instruction set is being worked on.
Helpful SDCC resources:
- SDCC Documentation
- Open bugs in the Padauk integration
- Feature Requests related to the Padauk integration
Installing SDCC
The latest binaries and sources of SDCC can be obtained on the SDCC website. If SDCC is available via your operating system’s package manager, please ensure that it is at least SDCC 4.0.0; older versions may not have support or only limited support for the Padauk µC.
µC-specific Information and Pinouts
Note: Other µCs than the µCs listed here may be supported. If you want to learn more about the naming scheme, read more here.
MTP (Flash) Variants
MCU | OSS Status | Arch. | max IO | ROM | RAM | Timers | PWM | CMP | ADC | Special | Padauk Links |
---|---|---|---|---|---|---|---|---|---|---|---|
PFS154 | Supported | PDK14 | 14 |
2 KW |
128 | T16 T2 T3 |
2x 8‑Bit 3x 11‑Bit |
1 | ‑ | LCD |
Product Page
Datasheet |
PFS172 | Supported | PDK14 | 14 |
2 KW |
128 | T16 T2 T3 |
2x 8‑Bit | 1 | 8‑Bit |
Product Page
Datasheet |
|
PFS173 | Supported | PDK15 | 18 |
3 KW |
256 | T16 T2 T3 |
2x 8‑Bit 3x 11‑Bit |
1 | 8‑Bit | LCD |
Product Page
Datasheet |
OTP Variants
MCU | OSS Status | Arch. | max IO | ROM | RAM | Timers | PWM | CMP | ADC | Special | Padauk Links |
---|---|---|---|---|---|---|---|---|---|---|---|
PMS150C | Supported | PDK13 | 6 |
1 KW |
64 | T16 T2 |
1x 8‑Bit | 1 | ‑ | - |
Product Page
Datasheet |
PMS15A | Supported | PDK13 | 6 |
0.5 KW |
64 | T16 T2 |
1x 8‑Bit | 1 | ‑ | - |
Product Page
Datasheet |
PMS152 | Supported | PDK14 | 14 |
1.25 KW |
80 | T16 T2 |
1x 8‑Bit 3x 11‑Bit |
1 | ‑ | - |
Product Page
Datasheet |
PMS154C | Supported | PDK14 | 14 |
2 KW |
128 | T16 T2 T3 |
2x 8‑Bit 3x 11‑Bit |
1 | ‑ | LCD |
Product Page
Datasheet |
PMS171B | Supported | PDK14 | 14 |
1.5 KW |
96 | T16 T2 T3 |
2x 8‑Bit | 1 | 8‑Bit | - |
Product Page
Datasheet |
Evaluation Boards
These are evaluation boards for the online-programmable MTP (as opposed to the OTP parts, which can only be programmed offline and once) Padauk µC. free-pdk/f-eval-boards.
Instruction Sets, Opcodes, and Programming Sequence
The different Padauk µCs use either 13, 14, 15, or 16 bit instruction sets. The following files provide an overview over the different instruction sets.
More information, including information on the programming sequence, can be found at free-pdk/fppa-pdk-documentation
Other Tools
-
Schematic Symbols: A collection of schematic symbols for many of the Padauk µCs.
- gEDA gschem: free-pdk/pdk-gschem-symbols
- KiCad: free-pdk/pdk-kicad-symbols
- Padauk µC Emulator written in VHDL: This project aims to provide a fully functional, timing accurate VHDL model for simulating PADAUK FPPA microcontrollers. free-pdk/fppa-pdk-emulator-vhdl
- A bunch more tools are located at
free-pdk/fppa-pdk-tools.
- Disassembler: dispdk supports 13 bit, 14 bit, 15 bit and 16 bit opcodes
- Emulator: emupdk supports 14 bit opcodes, no peripheral support yet requires mapping of processor ID in emucpu.c
- PDK converter: depdk convert/deobfuscate any PDK file to binary
Projects from the Community
These projects are auto-populated once per day by
searching GitHub for repositories with the padauk
topic.
Projects that additionally have the free-pdk
topic are highlighted as
Uses Free PDK toolchain.
Projects that contain .PRE
files are marked as
Uses proprietary toolchain.
Latest Activity
The latest activity in the free-pdk
GitHub organization is fetched at least once per day and displayed below.
@cpldcpu commented on pull request
free-pdk/free-pdk.github.io#47
Adding page for undocumented features
I thought in general that the index page and tutorial page is getting a bit too long and convoluted, so adding a few additional pages would make sense. Maybe there should be only an index in the tutorial that is pointing to subpages?
@cmfcmf commented on pull request
free-pdk/free-pdk.github.io#47
Adding page for undocumented features
It's great to see this new section! There is _so much_ information in the forum thread, but frankly, most of it is "lost" almost immediately after it is posted, since it is so unorganized and hard to discover. I know it can be a lot of work, but IMHO every extraction of information from the thread to a well structured place like this documentation is well worth it.
> @cmfcmf I hope I added the image in the right place. The way I centered seems to be a bit hacky, but this is the only way I found.
Looks fine to me 👍
> In general, I was wondering whether it would be possible to add a ToC block next to the content column. Does this jeyll theme allow for this?
I assume that you think of something like done here https://reactjs.org/docs/getting-started.html (i.e., toc is always visible if the page is wide enough and scrolls with the page)?
The theme does not directly allow that, but could certainly be customized to have the toc next to the content when the screen is big enough.
---
Would it make sense to also add a new section to the tutorial page that links to the undocumented features page?
@cpldcpu commented on pull request
free-pdk/free-pdk.github.io#47
Adding page for undocumented features
@cmfcmf I hope I added the image in the right place. The way I centered seems to be a bit hacky, but this is the only way I found.
In general, I was wondering whether it would be possible to add a ToC block next to the content column. Does this jeyll theme allow for this?
@cpldcpu commented on pull request
free-pdk/free-pdk.github.io#47
Adding page for undocumented features
This is work in progress. The intention is to add a place to describe undocumented features. I have to admit that the wording may be a bit confusing, because many things are not documented in the Padauk MCUs. This page is for features that were intentionally disguised.
- 7cf43bd add automatic LVR setup to high SYSCLOCK rates
@serisman commented on issue
free-pdk/free-pdk-examples#7
include structure
I'll have to think about this a bit more.
I don't think they should go into pdk/ repo because they are more of a minimal framework than device definitions, and we aren't suggesting that they get included into SDCC.
Also, they need to be refactored so there isn't 'code' in .h files. This probably means a lib/ folder with some changes to the Makefiles in order to compile and link each independent method as their own .a (lib) files. This will allow SDCC to only include methods when they are actually used. Currently there is an issue where SDCC will include the methods within the .h files multiple times (once per .c file that references a .h file).
@serisman commented on issue
free-pdk/pdk-includes#9
Merge easy-pdk includes into this repository / inclusion in SDCC
The original intention was to keep this repo just for the device specific includes that would eventually get incorporated into SDCC (hopefully). It should be programmer agnostic. Including the easy-pdk includes defeats this purpose.
I agree that putting these files into a pdk subfolder might be nice, although that would break the ability for people to use this repo as a git submodule (not sure if anyone is doing that at this point).
- 729fddd change to travis.com for ci builds and status
@cpldcpu commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
Looking forward to it! Also consider doing something with the Padauks themselves. I just found some undocumented peripherals (see EEV forum), so there is definitely more to explore.
@cnlohr commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
Neat. I'm so glad for all the work you guys do. It definitely makes the other more esoteric applications easier. If this works out I'll definitely be posting about it.
@cpldcpu commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
I wasn't too serious about this the cost. The programmer is based on lots of parts from lesser known companies, though.
Regarding the voltages, I can't find the specific discussion right now, but there was a bit of voltage parameter tweaking during the lastest firmware update. It's nothing that can't be done, though. +-0.1V should be acceptable.
@cnlohr commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
I mean it's a $0.25 INA, and it's only on the VDD line. All the other components add to about $0.13.
This is really good information to know that they are picky -- do you have any handle on _how_ picky? Is +/- 0.1v acceptable? Or unacceptable?
@cpldcpu commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
eh.. ok :) You certainly have a specific goal here. Also doesn't look like low cost components with the instrumentation amp.
Some of the Padauks are a bit picky regarding programming voltages, so you may have to tweak a lot if you have no voltage buffer.
@cnlohr commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
I was thinking of something along these lines:
![image](https://user-images.githubusercontent.com/2748168/93256862-ddde5000-f750-11ea-9568-3d6379b1b941.png)
Without precision components, calibration would be needed, but, 1% resistors, and using a decent LDO on the '042 and it's likely to be well within the "good enough" range.
P.S. I really wanted to also monitor power consumption on the Padauk parts.
@cpldcpu commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
It should be possibly to adapt the programmer to use a PWM output instead of the DAC. In that case, the opamps could be used to low-pass filter the signal as well, for example with a sallen-key topology. Calibration would be needed as well, but there is already a voltage feedback to the ADC.
@cnlohr commented on issue
free-pdk/easy-pdk-programmer-software#49
stm32f072 vs stm32f103
I've done a few software-defined switchmode power supplies, two on the STM32F042, and it's really good at it. So, my thought with the 042 would be you just have it control the power supply for the VDD/VPP rails, and nix all the other hardware on the board to support the supply rail control with the opamp. I am actually in the process of making a dingus which has the guts to create the signals for the Padauk parts, but haven't thought about software yet.
@cpldcpu commented on issue
free-pdk/free-pdk.github.io#45
Not all repositories showing up in search results
Ok, I figured out the issue: I had no files in the repository that counted as "code", only EDA files. It seems that Githubs scoffs on lowly hardware projects and your repository will only show up in the search results once you added real code.
I added the firmware now and everything is fine.
Checkout /doc-style for more information on some of the special Markdown formatting features we use.