After so many months, I realized I got a message on LCSC from apparently somebody from here asking if I had ever finished my programmer. That remind me of it, and I began yesterday working again on the firmware of the thing.
I have finally got around integrating the software-controlled SMPS and software-emulated USB on the ATtiny84, and most important, get them both working at the same time - to be honest I wasn't really sure if I'd manage to pull this off
But well, it looks like this tiny AVR is more than capable, and I've finally got Python to talk via libusb to the firmware, and from there command the PFS154 to enter read mode.
from usb1 import *
from libusb1 import *
import struct
CMD_START = 1
PDK_READ = 6
ctx = USBContext()
dev = ctx.getByVendorIDAndProductID(0x16C0, 0x05DC)
handle = dev.open()
with handle.claimInterface(0):
print(handle.getProduct())
devId, = struct.unpack("h", handle.controlRead(LIBUSB_REQUEST_TYPE_VENDOR, CMD_START, PDK_READ, 0, 2))
print('Device ID: %03X' % devId)
handle.close()
Instead of loading the whole code to the AVR as the Easy PDK programmer does, which is just not feasible given the mere 512 bytes of RAM, I have several commands which just stream data on demand from/to the microcontroller in program.
The firmware so far is only able to enter a certain mode (ie setup VPP, setup VDD, send command and read and verify response), but it's not yet able to read/write/erase. However, given that the hard part is already done, it should be pretty easy.
The PCB and schematic are available at EasyEDA and are mostly final:
https://easyeda.com/socram8888/padauk-programmerThe firmware is still being heavily worked on and it's available on my GitHub:
https://github.com/socram8888/PdkProgrammer