Also Please check this out the getchar is working but it would receive it wrong! instead of getting 0x61 which is an "a" char, it would receive it like 0x27
Here is the main loop code from the serialio example
char c='';
for(;;)
{
puts("Echoing serial receive (type something):\r\n");
for(int i=0;i<10000;i++);
c = getchar();
for(int i=0;i<10000;i++);
putchar(c);
}
Also Do you have some ADC examples?
I added an ADC example (for PFS173) to the development branch.
It shows how to measure the ADC value of the internal BandGap voltage (VBG = 1.200V) which then can be used to calculate VDD:
VDD (?) => max value of ADC = 255
VBG (1.2V) => adcval
==> VDD = (1.2 * 255 ) / adcval
Then it shows how to measure input of PA.0. (Note: when running in easypdk programmer, PA.0 is pulled up to VDD of the programmer which is 3.3V).
Have fun,
JS
P.S. The serial echo sample is not finished yet. Looks like the interrupt takes way to many cycles. It either needs optimization or the BAUD rate needs to be lowered.
Thanks JS, I think if we add a delay after puts, we would get the RX wrong! maybe there is a bug in the compiler.
Hi,
I added more example programs to the easypdk programmer (in development branch:
https://github.com/free-pdk/easy-pdk-programmer-software/tree/development/Examples )
* COMPtest shows how to use the comparator to estimate VDD (good for battery based projects on ICs without ADC).
* PolySound is a fun project which uses PWM to play a polyphonic sound. It emulates a NES sound chip with 4 voices to play a music theme from Mega Man 2. It requires 182 bytes RAM and 2.1k words CODE (e.g. PFS173).
You only need to connect a speaker to PA.3 and GND
. Of course a low pass filter for the PWM would be much better.
The original project was implemented for a PIC16 by Joel Yliluoma :
https://bisqwit.iki.fi/jutut/kuvat/programming_examples/pic/ To stay as close as possible to the original code, SYSCLK is tuned (overclocked) to 10MHz - which works absolutely fine
Attached is a sound file of the output (low pass filtered)
Have fun,
JS
The depdk converted bin file cannot be written to the target chip using easypdkprog Is there a way to convert the bin file to an ihx file ?
Please forgive me for not understanding English. I translated it using google.
FYI, I ventured out and reviewed all sub $0.10 microcontrollers on LCSC. I hope it's somewhat useful:
https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/
I can now confirm that the Padauk MCUs are the best in this segment. We knew this before, did we?
Well, now back to actual projects on the PFS154...
Cheap MCUs that are widely used in China are OTP produced by Taiwan nyquest. My purchase of NY8A050D is only RMB 0.1 yuan, about 0.014 US dollars.
nyquest website :
http://www.nyquest.com.tw/Attached is the NY8A050D&HR7P153 English Datasheet,Please accept.
The depdk converted bin file cannot be written to the target chip using easypdkprog Is there a way to convert the bin file to an ihx file ?
There is no way to "convert" a PDK file. PDK files contain extra code which the original WRITER device form PADAUK needs to modify during writing.
You can use SDCC (a real C compiler) to create wonderful programs.
Where to get it "easypdkprogtest" program ? File Directory path . Thanks!
The source code is inside of the github project (you need to compile it yourself) :
https://github.com/free-pdk/easy-pdk-programmer-softwareJS
Hi,
I just released version 1.2 of the EasyPDK programmer software:
https://github.com/free-pdk/easy-pdk-programmer-software/releases/tag/1.2The following features are fully implemented now:
FUSES: Setup fuses from SDCC source code
SYSCLOCK IHRC: Tuning (500kHz - 8MHz, overclocking up to 11MHz possible)
SYSCLOCK ILRC: Tuning (3-100kHz)
BANDGAP: BG tuning (1.2V)
There is example code for FUSES and calibrations in "calib-and-fuse-demo.c".
I think it is now feature complete for PMS150C, PFS154 and PFS173. Next steps: adding new IC types.
=> DON'T FORGET TO UPDATE THE PROGRAMMER FIRMWARE <=Have fun,
JS
Big thumbs up JS, Please add the industrial grade parts with ADC as the first Step
What does RO mean in brackets on the right of the list?
Thanks JS ! version 1.2 verygood !
JS please add PMC131 and PMC271 parts support, they are industrial grade and have ADC
I used to be on this topic downloaded a command line utility that can parse the PDK file , and it can show which IC types the PDK file was compiled . But now I can't find that command line utility through this topic. Do you help me find it ?
What does RO mean in brackets on the right of the list?
RO stands for Read-Only - which means writing the IC is not fully implemented / tested yet.
I used to be on this topic downloaded a command line utility that can parse the PDK file , and it can show which IC types the PDK file was compiled . But now I can't find that command line utility through this topic. Do you help me find it ?
The decryption tool is on page 2 of this thread, post #28:
https://www.eevblog.com/forum/blog/eevblog-1144-padauk-programmer-reverse-engineering/msg1946371/#msg1946371This (experimental) tools are also included in the FREEPDK github repository:
https://github.com/free-pdk ==> fppa-pdk-tools
=> depdk.c (decryption tool)
=> dispdk.c (disassembler, can open PDK file directly and outputs which CPU was used and disassembly)
This are experimental tools, used during devlopment only. They do not and will not support all IC types and all flavors of PDK files.
Have fun,
JS
JS please add PMC131 and PMC271 parts support, they are industrial grade and have ADC
Hi, PMS and PMC variants are 100% identical regarding compiler and programmer.
Do you have a specific project you might share, which is intended to run on a PMC part with ADC? By sharing a project the motivation to support a specific IC type would increase a lot
.
Personally I found that PFS173 is by far the best option for almost everything. It has big FLASH, ADC, 256 byte RAM and they are available as SOT23-6, SOP8, SOP14, SOP16, ... as cheap as USD 0.05 (
https://item.taobao.com/item.htm?id=598420620199 ) or USD 0.07 (
https://lcsc.com/product-detail/Others_PADAUK-Tech-PFS173-S08_C337970.html)
Have fun,
JS
Thanks JS, I find the PFS173 to be very useful, I need it to capture some Signals with ADC and send them over uart! The only problem with PFS173 is the working temperature! it's not -40 to 85C, so It can not be used inside industrial gears, Also the SOT23-6 package is very nice to have. then unfortunately we do not have something in the -40 to 85c in the PMC parts
If the PFS173 temperature range was industrial, then we where in heaven
I think these babies can be used in very low cost PLC ADC modules
Thanks JS, I find the PFS173 to be very useful, I need it to capture some Signals with ADC and send them over uart! The only problem with PFS173 is the working temperature! it's not -40 to 85C, so It can not be used inside industrial gears, Also the SOT23-6 package is very nice to have. then unfortunately we do not have something in the -40 to 85c in the PMC parts
You mean "in the PFS parts", I guess. The PMC and PFC parts are -40°C to +85°C.
why PFS173 would not boot properly when connected to an external 5V supply to work as stand alone?
should be reset pulled up to VCC? I have done it and got no luck!
why PFS173 would not boot properly when connected to an external 5V supply to work as stand alone?
should be reset pulled up to VCC? I have done it and got no luck!
You do not have to connect RESET pin to anywhere. The RESET pin is only used in case YOUR program sets up PRSTB bit in CLKMD register.
In case your program is not running after flashing this can have several causes:
- check that you disabled watchdog, or when enabled that you call WDRESET periodically
- check that you disabled LVR or that you set LVR to a level greater or equal to VCC
- make sure your CLKMD setup (e.g. switching from ILRC to IHRC does not disable the old clock source immediately (see note in PFS173 PDF about clock switching).
If you can't work it out yourself, posting your program source code would enable others to have a look.
JS
Dear JS, It's now solved! the problem was the FTDI chip that was making some power into the chip when it was not powerd!
There will be a short talk on the free toolchain for the Padauk µC on 12:00 Sunday the 2nd of February at FOSDEM 2020:
https://fosdem.org/2020/schedule/event/paduak_toolchain/
Nice! Will the talk be recorded? Or will at least the slides be available?
Btw, where do you get the €0.01 from? Haven't seen an update at LCSC for a long time. I am still waiting for the PFS232 to become available.
I have designed a tiny new project with the PFS154. Will assemble and write it up in about two weeks when the parts arrive.
There will be a short talk on the free toolchain for the Padauk µC on 12:00 Sunday the 2nd of February at FOSDEM 2020:
https://fosdem.org/2020/schedule/event/paduak_toolchain/
Nice! Will the talk be recorded? Or will at least the slides be available?
Slides will become available a few hour before the talk. FOSDEM records all talks (
https://video.fosdem.org/), but in the past I've sometimes experienced technical problems (e.g. distortion and the leftmost part of my slides missing in the recording of one of my FOSDEM 2018 talks
https://ftp.fau.de/fosdem/2018/UD2.218A/stm8.mp4).
Btw, where do you get the €0.01 from?
I've seen that price for the PMS15A (at a minimum order of 10) at various places.