Hi everyone,
Many years ago (maybe 5), I bought an XL4015 converter with voltage and current LED displays on the top PCB, with a working RxD and TxD serial interface circuit through which I could read the currently measured and displayed voltage and current values. There was a 20-pin MCU soldered in there (probably an STM8S003F3P6). I've been trying to buy these converters with a voltmeter and ammeter two years ago (link:
https://pl.aliexpress.com/item/1005007284538281.html?spm=a2g0o.productlist.main.29.3a4bbOPObOPO5f&algo_pvid=e6bb761c-811d-4ac0-a950-7f4896adfc72&algo_exp_id=e6bb761c-811d-4ac0-a950-7f4896adfc72-28&pdp_ext_f=%7B%22order%22%3A%2215%22%2C%22spu_best_type%22%3A%22price%22%2C%22eval%22%3A%221%22%2C%22fromPage%22%3A%22search%22%7D&pdp_npi=6%40dis%21PLN%2122.15%2122.99%21%21%2138.73%2140.19%21%40211b6c1717838632501684229e9ed6%2112000040068875832%21sea%21PL%210%21ABX%211%210%21n_tag%3A-29910%3Bd%3Ac4a09ebd%3Bm03_new_user%3A-29895&curPageLogUid=488jqG0LOLQK&utparam-url=scene%3Asearch%7Cquery_from%3A%7Cx_object_id%3A1005007284538281%7C_p_origin_prod%3A), but unfortunately, in the currently HW-035 V3.0.0 version, the MCU was replaced with one in an SOIC16 package (unmarked), and despite two pins being connected to the serial pin connector, there's no transmission. Most Chinese vendors do have a description of this serial pin (GND RxD TxD), but it display (Not Connected) in parentheses.
Since I need a computer to read the voltage and current values to calculate power and charge, I spent a long time searching for an MCU that could replace the one is currently use. The requirements are VDD pin 1, GND pin 16, ADC pin 9, ADC pin 12, and GPIO for remaining 12 pins. I found a PADAUK PFS122-S16A, which basically meets my requirements. I assembled the easypdkprog programmer (I've read all 61 pages of posts, and thank you for your titanic work to the contributors on this forum, especially Dave with the video in post #0, spth, js_12345678_55AA, tim_, serisman, jacola, who addressed the PFS132 issue in 2023, which is of particular interest to me right now).
I programmed the PFS122-S16A without any problems, but it underestimates the voltage measurement, displaying 5.22V-5.37V instead of constans 6.00V, while the one desoldered from the PCB displays the correct and accurate value of 6.00V. I believe this is because the PFS122-S16A can only use VCC as a reference voltage for the ADC. I know I could change the divider on the ADC input, but I decided to use the PFS132-S16A, whose pinout also fits this application and offers a wider range of ADC reference voltage options. And here's the reason for my initial activity on this forum – namely, does anyone know if the PSF132-S16A can be programmed using easypdkprog? If so, what are the contents of the FPDKICDATA structure for the PFS132-S16A? And especially what should be the value of id12bit, otpid (0x2db0 is ok?), type (by the way, what is the difference between FPDK_IC_FLASH_1 and FPDK_IC_FLASH_2?), vdd_cmd_read, vpp_cmd_read, vdd_read_hv, vpp_read_hv, vdd_cmd_write, vpp_cmd_write, vdd_write_hv, vpp_write_hv, vdd_cmd_erase, vpp_cmd_erase, vdd_erase_hv, vpp_erase_hv, write_block_size, write_block_clock_groups, write_block_clock_per_group, erase_clocks?
Based on PFS132.inc, I prepared the sdcc/include/pdk/device/PFS132.h file for compiling sdcc with a modified file sdcc/include/pdk/device.h:
...
#include "device/pfs173.h"
#elif defined(PFS132) // add WS
#include "device/pfs132.h" // add WS
#elif defined(PMS131)
...
I modified the FPDKICDATA structure by copying the structure for PFS172, changing: name[32] to "PFS132", id12bit 0x2db0, id12bit 0x764. When I connect the PFS132-S16A to easypdkprog and run the command:
C:\Free_pdk\easypdkprog\EASYPDKPROG_WIN_1.3>easypdkprog -v probe
Searching programmer... found: COM4
FREE-PDK EASY PROG - Hardware: 1.2 Firmware: 1.3 Protocol: 1.3
Probing IC... found.
TYPE: FLASH RSP: 0x3B6 VPP=4.50 VDD=2.00
Unsupported IC
When I changed the ID12bit to 0x76C and reduced the vpp_cmd_read voltage from 5.5V to 5.0V, I got the following after running the command:
C:\Free_pdk\easypdkprog\EASYPDKPROG_WIN_1.3>easypdkprog -v probe
Searching programmer... found: COM4
FREE-PDK EASY PROG - Hardware: 1.2 Firmware: 1.3 Protocol: 1.3
Probing IC... found.
TYPE: FLASH RSP:0x3B6 VPP=4.50 VDD=2.00
IC is supported: PFS132 ICID:0x76C
Then the read command also doesn't display an error:
C:\Free_pdk\easyPDKprog\EASYPDKPROG_WIN_1.3>easyPDKprog -v -n PFS132 -b read HW035_V300_WS132.bin
Searching programmer... found: COM4
FREE-PDK EASY PROG - Hardware:1.2 Firmware:1.3 Protocol:1.3
Reading IC (2048 words)...done.
But the read content of the FLASH memory of the not-yet-programmed PFS132-S16A doesn't look correct - I think that, apart from the last 16 words, the rest should contain the words 0x3FFF, but they don't.
Errors are generated by invoking the following commands:
C:\Free_pdk\easypdkprog\EASYPDKPROG_WIN_1.3>easypdkprog -v -n PFS132 erase
Searching programmer... found: COM4
FREE-PDK EASY PROG - Hardware:1.2 Firmware:1.3 Protocol:1.3
Erasing IC... FPDK_ERROR: command ack failed / wrong icid
and
C:\Free_pdk\easypdkprog\EASYPDKPROG_WIN_1.3>easypdkprog -v -n PFS132 -f 0x017d --runvdd=3.30 write HW035_V300_3.hex
Searching programmer... found: COM4
FREE-PDK EASY PROG - Hardware:1.2 Firmware:1.3 Protocol: 1.3
Erasing IC... FPDK_ERROR: command ack failed / wrong icid
And when I connect the PFS122-S16A to easypdkprog and run the command:
C:\Free_pdk\easypdkprog\EASYPDKPROG_WIN_1.3>easypdkprog -v probe
Searching programmer... found: COM4
FREE-PDK EASY PROG - Hardware: 1.2 Firmware: 1.3 Protocol: 1.3
Probing IC... found.
TYPE: FLASH RSP: 0xE53 VPP=4.50 VDD=2.00
IC is supported: PFS172 ICID: 0xCA6
BTW, what does RSP: 0x3b6 or RSP: 0xE53 mean?
I'm counting on your help.
Regards,
Waldek