Because some people have trouble compiling on/for Windows, I added automatic builds (using travis-ci) to the freepdk github repository.
Every commit will now build the software for all 3 platforms (Linux/Mac/Windows) and check for errors.
Tags will automatically create ZIP files with the compiled binaries for all 3 platforms, available under "releases".
I created a temporary tag "1.1-development" from development branch. Here you can find the 1.1-development (work in progress) binaries for all 3 platforms:
https://github.com/free-pdk/easy-pdk-programmer-software/releases
Have fun,
JS
Quoteopen source hardware programmer: https://github.com/free-pdk/easy-pdk-programmer-hardware
I have checked it, it has only the hardware files, where is the software files for the STM32 MCU and also the PC side software
I just tried to get this board made and it's in a 4x1 panel format, but only one of the boards is populated. Kinda annoying, can this be updated to just be a single non-panelised PCB?
Looks like no original PCB file available?
I don't want to edit the gerber files so I'll just get the panel made as is for testing.
I just tried to get this board made and it's in a 4x1 panel format, but only one of the boards is populated. Kinda annoying, can this be updated to just be a single non-panelised PCB?
Looks like no original PCB file available?
Yep, JLC rejected my PCB, Can I get a single PCB gerber files or the original PCB file please? (KiCAD/Eagle/Altium?) Thanks.
Yep, JLC rejected my PCB, Can I get a single PCB gerber files or the original PCB file please? (KiCAD/Eagle/Altium?) Thanks.
This is very odd. Several users used the exact same gerber.zip file to order from JLCPCB before and it was accepted.
What was the exact reason for the rejection?
Sorry to tell you that the size of your panel is too small to be made with v-cut, it needs to 7 *7 cm at least to get through the v-cut machine, could you please kindly check? And you can add edge rail to the the boards as the attachment ,then it can be produced by V-cut ,thank you !
In the mean time I will create a non panelaized Gerber and put it to the github project page.
Edit: https://github.com/free-pdk/easy-pdk-programmer-hardware/tree/master/pcb also contains a single board gerber now: "Gerber_EASYPDKPROG_PCB12_NoSilk.zip"
It's because the gerber looks like a panel with V score, and they said:QuoteSorry to tell you that the size of your panel is too small to be made with v-cut, it needs to 7 *7 cm at least to get through the v-cut machine, could you please kindly check? And you can add edge rail to the the boards as the attachment ,then it can be produced by V-cut ,thank you !
Dave you can check out my Altium project!
JS, I have compiled the ARM program and flashed the easyPaduk, but unfortunately it says the firmware is a mismatch! (I have flashed the programmer with the new Bin file)
also can you please update the make file for the PC side software to generate the .exe file for windows too( I mean inside ubuntu)
Thanks JS, I managed to flash the Dev branch to the ARM and now it's working, But still only probing is working any Idea what might goes wrong?
Hi,
To understand the register mappings on different PDK CPU types better I created a list (based on include files from original IDE).
https://github.com/free-pdk/fppa-pdk-documentation/blob/master/PDK_register_mapping_scroll_right.csv
Attached is a colorful version as PNG from it.
Based on this info (most registers jump around for different types and only a few number remains static) I think the best idea would be to create one include file per supported processor like:
pdk/pmc150c.h
pdk/pfs154.h
pdk/pfs173.h
...
Hi,
To understand the register mappings on different PDK CPU types better I created a list (based on include files from original IDE).
https://github.com/free-pdk/fppa-pdk-documentation/blob/master/PDK_register_mapping_scroll_right.csv
Attached is a colorful version as PNG from it.
Based on this info (most registers jump around for different types and only a few number remains static) I think the best idea would be to create one include file per supported processor like:
pdk/pmc150c.h
pdk/pfs154.h
pdk/pfs173.h
...
I fully agree with this approach. I wonder, has anybody already been looking into this? Right now, I am cleaning up some of my old examples. So far I have defined everything in line.
#ifndef __PMS150C_H__
#define __PMS150C_H__
#include "pdkcommon.h"
//set calibration macros
#define EASY_PDK_CALIBRATE_IHRC EASY_PDK_CALIBRATE_IHRC_H8
#define EASY_PDK_CALIBRATE_ILRC EASY_PDK_CALIBRATE_IHRC_L8
//IO register definitions
//__sfr __at(0x00) _flag;
//0x01
//__sfr __at(0x02) _sp;
__sfr __at(0x03) _clkmd;
__sfr __at(0x04) _inten;
__sfr __at(0x05) _intrq;
__sfr __at(0x06) _t16m;
//0x07
//0x08
__sfr __at(0x09) _tm2b;
__sfr __at(0x0a) _eoscr;
__sfr __at(0x0b) _ihrcr;
__sfr __at(0x0c) _integs;
__sfr __at(0x0d) _padier;
//0x0e
//0x0f
__sfr __at(0x10) _pa;
__sfr __at(0x11) _pac;
__sfr __at(0x12) _paph;
//0x13
//0x14
//0x15
//0x16
__sfr __at(0x17) _tm2s;
//0x18
__sfr __at(0x19) _bgtr;
__sfr __at(0x1a) _gpcc;
__sfr __at(0x1b) _misc;
__sfr __at(0x1c) _tm2c;
__sfr __at(0x1d) _tm2ct;
__sfr __at(0x1e) _gpcs;
__sfr __at(0x1f) _ilrcr;
//T16C register
__sfr16 _t16c;
//clkmd definitions
#define CLKMD_ENABLE_PA5RST 0x01
#define CLKMD_ENABLE_WATCHDOG 0x02
#define CLKMD_ENABLE_ILRC 0x04
#define CLKMD_ENABLE_IHRC 0x10
#define CLKMD_IHRC_DIV2 0x20
#define CLKMD_IHRC_DIV4 0x00
#define CLKMD_IHRC_DIV8 0x28
#define CLKMD_IHRC_DIV16 0x08
#define CLKMD_IHRC_DIV32 0x68
#define CLKMD_IHRC_DIV64 0x88
#define CLKMD_ILRC 0xe0
#define CLKMD_ILRC_DIV4 0xc0
//interrupt enable definitions
#define INTEN_PA0 0x01
#define INTEN_T16 0x04
#define INTEN_COMP 0x10
#define INTEN_TM2 0x40
//interrupt request definitions
#define INTRQ_PA0 0x01
#define INTRQ_T16 0x04
#define INTRQ_COMP 0x10
#define INTRQ_TM2 0x40
//tm16 definitions
#define T16_INTSRC_8BIT 0x00
#define T16_INTSRC_9BIT 0x01
#define T16_INTSRC_10BIT 0x02
#define T16_INTSRC_11BIT 0x03
#define T16_INTSRC_12BIT 0x04
#define T16_INTSRC_13BIT 0x05
#define T16_INTSRC_14BIT 0x06
#define T16_INTSRC_15BIT 0x07
#define T16_CLK_DIV1 0x00
#define T16_CLK_DIV4 0x08
#define T16_CLK_DIV16 0x10
#define T16_CLK_DIV64 0x18
#define T16_CLK_DISABLE 0x00
#define T16_CLK_SYSCLK 0x20
#define T16_CLK_PA4_FALL 0x60
#define T16_CLK_IHRC 0x80
#define T16_CLK_ILRC 0xC0
#define T16_CLK_PA0_FALL 0xE0
//eosc definitions
#define EOSC_LVD_BANDGAP_SHUTDOWN 0x01
//integs definitions
#define INTEGS_PA0_BOTH 0x00
#define INTEGS_PA0_RISING 0x01
#define INTEGS_PA0_FALLING 0x02
#define INTEGS_T16_RISING 0x00
#define INTEGS_T16_FALLING 0x04
#define INTEGS_COMP_BOTH 0x00
#define INTEGS_COMP_RISING 0x40
#define INTEGS_COMP_FALLING 0x80
//padie definitions
#define PADIE_PA0_WAKEUP_ENABLE 0x01
#define PADIE_PA3_WAKEUP_ENABLE 0x08
#define PADIE_PA4_WAKEUP_ENABLE 0x10
#define PADIE_PA5_WAKEUP_ENABLE 0x20
#define PADIE_PA6_WAKEUP_ENABLE 0x40
#define PADIE_PA7_WAKEUP_ENABLE 0x80
//misc definitions
#define MISC_WATCHDOG_8K_ILRC 0x00
#define MISC_WATCHDOG_16K_ILRC 0x01
#define MISC_WATCHDOG_64K_ILRC 0x02
#define MISC_WATCHDOG_256K_ILRC 0x03
#define MISC_LVR_DISABLE 0x04
#define MISC_FAST_WAKEUP_ENABLE 0x20
//tm2c definitions
#define TM2C_CLK_DISABLE 0x00
#define TM2C_CLK_SYSCLK 0x10
#define TM2C_CLK_IHRC 0x20
#define TM2C_CLK_EOSC 0x30
#define TM2C_CLK_ILRC 0x40
#define TM2C_CLK_COMPOUT 0x50
#define TM2C_CLK_PA0_RISE 0x80
#define TM2C_CLK_PA0_FALL 0x90
#define TM2C_CLK_PB0_RISE 0xA0
#define TM2C_CLK_PB0_FALL 0xB0
#define TM2C_CLK_PA4_RISE 0xC0
#define TM2C_CLK_PA4_FALL 0xD0
#define TM2C_OUT_DISABLE 0x00
#define TM2C_OUT_PB2 0x04
#define TM2C_OUT_PA3 0x08
#define TM2C_OUT_PB4 0x0C
#define TM2C_MODE_PERIOD 0x00
#define TM2C_MODE_PWM 0x02
#define TM2C_INVERT_OUT 0x01
//tm2s definitions
#define TM2S_PWM_RES_8BIT 0x00
#define TM2S_PWM_RES_6BIT 0x80
#define TM2S_PRESCALE_NONE 0x00
#define TM2S_PRESCALE_DIV4 0x20
#define TM2S_PRESCALE_DIV16 0x40
#define TM2S_PRESCALE_DIV64 0x60
//gpcc definitions
#define GPCC_COMP_PLUS_VINT 0x00
#define GPCC_COMP_PLUS_PA4 0x01
#define GPCC_COMP_MINUS_PA3 0x00
#define GPCC_COMP_MINUS_PA4 0x02
#define GPCC_COMP_MINUS_BANDGAP_1V2 0x04
#define GPCC_COMP_MINUS_VINT_R 0x06
#define GPCC_COMP_MINUS_PA6 0x08
#define GPCC_COMP_MINUS_PA7 0x0A
//gpcs definitions
#define GPCS_COMP_CASE1 0x00
#define GPCS_COMP_CASE2 0x10
#define GPCS_COMP_CASE3 0x20
#define GPCS_COMP_CASE4 0x30
#define GPCS_COMP_WAKEUP_ENABLE 0x40
#define GPCS_COMP_OUTPUT_PA0 0x80
//__PMS150C_H__
#ifndef __PDKCOMMON_H__
#define __PDKCOMMON_H__
//macros so we can use defines in assembler strings
#define _STRINGIFY(x)
#define _ASMV(x) "_"_STRINGIFY(x)
#define _ASMD(x) _STRINGIFY(x)
//definitions for built in opcodess
#define __engint() __asm__("engint\n")
#define __disgint() __asm__("disgint\n")
#define __stopsys() __asm__("stopsys\n")
#define __stopexe() __asm__("stopexe\nnop\n")
#define __set0(x,y) __asm__("set0 "_ASMV(x)", #"_ASMD(y)"\n")
#define __set1(x,y) __asm__("set1 "_ASMV(x)", #"_ASMD(y)"\n")
//macros for clock setup
#define EASY_PDK_INIT_SYSCLOCK_8MHZ() {_clkmd=CLKMD_ENABLE_ILRC|CLKMD_ENABLE_IHRC|CLKMD_IHRC_DIV2;}
#define EASY_PDK_INIT_SYSCLOCK_4MHZ() {_clkmd=CLKMD_ENABLE_ILRC|CLKMD_ENABLE_IHRC|CLKMD_IHRC_DIV4;}
#define EASY_PDK_INIT_SYSCLOCK_2MHZ() {_clkmd=CLKMD_ENABLE_ILRC|CLKMD_ENABLE_IHRC|CLKMD_IHRC_DIV8;}
#define EASY_PDK_INIT_SYSCLOCK_1MHZ() {_clkmd=CLKMD_ENABLE_ILRC|CLKMD_ENABLE_IHRC|CLKMD_IHRC_DIV16;}
#define EASY_PDK_INIT_SYSCLOCK_512kHz() {_clkmd=CLKMD_ENABLE_ILRC|CLKMD_ENABLE_IHRC|CLKMD_IHRC_DIV32;}
//place holder for EASYPDK serial inserted from easypdkprog
#define EASY_PDK_SERIAL(sname) static const uint8_t sname[8] = {'F','P','S','E','R','I','A','L'}
//place holder for EASYPDK calibrations executed / replaced by easypdkprog
#define EASY_PDK_CALIBRATE_IHRC_H8(frequency,millivolt) \
__asm__( \
"and a, #'H' \n"\
"and a, #'8' \n"\
"and a, #("#frequency") \n"\
"and a, #("#frequency">>8) \n"\
"and a, #("#frequency">>16) \n"\
"and a, #("#frequency">>24) \n"\
"and a, #("#millivolt") \n"\
"and a, #("#millivolt">>8) \n"\
)
#define EASY_PDK_CALIBRATE_ILRC_L8(frequency,millivolt) \
__asm__( \
"and a, #'L' \n"\
"and a, #'8' \n"\
"and a, #("#frequency") \n"\
"and a, #("#frequency">>8) \n"\
"and a, #("#frequency">>16) \n"\
"and a, #("#frequency">>24) \n"\
"and a, #("#millivolt") \n"\
"and a, #("#millivolt">>8) \n"\
)
#define EASY_PDK_CALIBRATE_IHRC_H9(frequency,millivolt) \
__asm__( \
"and a, #'H' \n"\
"and a, #'9' \n"\
"and a, #("#frequency") \n"\
"and a, #("#frequency">>8) \n"\
"and a, #("#frequency">>16) \n"\
"and a, #("#frequency">>24) \n"\
"and a, #("#millivolt") \n"\
"and a, #("#millivolt">>8) \n"\
"and a, #0 \n"\
)
#define EASY_PDK_CALIBRATE_ILRC_L9(frequency,millivolt) \
__asm__( \
"and a, #'L' \n"\
"and a, #'9' \n"\
"and a, #("#frequency") \n"\
"and a, #("#frequency">>8) \n"\
"and a, #("#frequency">>16) \n"\
"and a, #("#frequency">>24) \n"\
"and a, #("#millivolt") \n"\
"and a, #("#millivolt">>8) \n"\
"and a, #0 \n"\
)
//__PDKCOMMON_H__
#include <stdint.h>
#include "pms150c.h"
unsigned char _sdcc_external_startup(void)
{
EASY_PDK_INIT_SYSCLOCK_8MHZ(); //use 8MHz to save power
EASY_PDK_CALIBRATE_IHRC(8000000,3300); //tune SYSCLK to 8.0MHz @ 3.300V
return 0; //perform normal initialization
}
void main(void)
{
for(;;)
{
//YOUR CODE HERE
}
}
But I managed to install MSYS2 on my machine and finally it could compile the code, But there is something very weird! the code just does not run also I could compile the easypdkprogtest program too, but It can not run either!
Thanks JS, Now the program would run from the MSYS2 shell, The voltages are a bit high
They are 5.17v and 5.18v with my voltmeter, are they in expected range?how should I calculate the offset and change.
:20000000022F8201782F8301012F9101101E101C0630FF2F820B830B82110C3083110C30C7
:020020007A0064
:00000001FF
I spent some time tinkering with a toolchain setup for SDCC and easypdkprog. You can find my work in progress here:
https://github.com/cpldcpu/SimPad/tree/master/Toolchain
Notable findings:
Includes
- I wrote a small python script that automatically generates include files from the CSV that JS posted a while ago. This should greatly reduce the work of creating include files for all MCUS. you can find it at
https://github.com/cpldcpu/SimPad/tree/master/Toolchain/util
- The goal is currently to have one master "io.h" file that automatically includes the architecture specific files.
- The architecture specific includes contain information about i/o register locations. The descriptions of the individual bits seem to be universial for all devices and have therefore been moved into a common file.
- I also introduced F_CPU to allow for a proper delay function.
Makefile
- Unversial makefile added, based on STM8-bare-min. Everything is automated now.
SDCC
- I was pleasantly surprised to learn that SDCC can infer SET0/SET1 now. Therefore it is not necessary to introduce specific macros for set0/set1
- Since SDCC implements a very unusual way of defining SFRs, intellisense/vscode is not able to identify the register definitions. This is somewhat unfortunate. There is an open ticked about this at the vscode github since last year, but apparently it is not a priority. Is there any workaround? Doing it like AVR-GCC ("__sfr(register)") would allow using defines, which is more compatible to intellisense.
- It does not seem to be possible to use local labels in inline assembler? This is inconvenient because it does not allow inlining of functions with assembler code when they use labels...
- It appears the -p options is not yet supported for the PDK architecture? This would be very useful, because it would allow distinguishing different processors from the makefile. May use a define as a workaround for now...
Easypdkprog
does not write the last byte of the ihx for some reason. This is only noticable when linking several files. Already submitted an issue.
I will add more examples soon. Also planning to integrates JS autocalibration code.
Let me know what you think. There are still many things to be clarified regarding naming etc.