Continued from part 1.
The printer from the calculator is a neat toy, but we want a real USB printer. So, using my new STM32F103 CubeMX USB printer class for communication with the host computer and some tricky INT based software from me, I built a real working* printer. The asterix near working has meaning- there is a problem with printing one text combination and I don’t know how to change the color of the print and how to print first (rightmost) symbols.
All software is module based. One module is USB stack, one module is USB printer device class, one module is interface with real printer hardware. There is one trick with USB device software- the USB INT level must be lower than INT used for printer mechanics. Yes, the printer is interrupt driven and completely asynchronous from the main body loop.
My software and compiled binary is for a slightly bigger chip – STM32F103RET6 (512kB ROM, 64kB RAM), but it is usable with regular blue pill PCB (If China people put at least the same size chip as in real blue pill. I had some weird problems with alieexpres blue pill boards, so I build my “white pill” boards).
Warning, do not rebuild STM CubeMX project in source code. The Cube program will overwrite my printer class.
STM32F103RET6 USB printer device source code and binary – printing on Citizen CX-123II calculator printer.
It was fun, but I lost interest continuing this Citizen printer. It can print only numbers and there is no real documentation.