Time to pick up where I left off earlier this year. A quick recap of what I have done for the HP45 before the Turret hiatus.
DMA will make the printing process a lot quicker. It will place the 300ms+ function to print away from the processor, and move it to the DMA hardware. This effectively makes it so all I have to do is hit print, and then I can continue with other tasks. To do this, I modified the OctoWS2811 library (https://github.com/PaulStoffregen/OctoWS2811
) to control 2 full ports simultaneously. With 2 ports of 8 bits each I can control: 14 primitive data pins, 1 primitive clock pin, and an address clock pin. The thing missing in this list is the primitive clear. I naively assumed that since it was active low, I could actually just tie it to the primitive clock.
I was wrong on this. The clock is rising edge, but the clear is cleared WHILE low, and there is a 250ns propagation delay. I added a monostable multivibrator. When the clock goes from high to low, it instantly gives a 500ns low pulse on the clear, clearing the output, then goes to 1 again making it inactive. I ordered the new PCB's for a properly finished controller and started on the Turret.
Coming back to this project, I started using the new controller. I soldered it, rewrote the firmware to have the right pin mapping, and then, nothing. It communicated, it even checked whether it was working, it read the temperature, but any attempt to make it spit ink was in vain. All of this was done in the normal printhead mode, expecting that the modifications for DMA would not affect this. I also tried printing with DMA. On the test controller it worked fine, on the new prototype, it did not.
I had to wait a little to get close to a scope, but today I finally got one and did some tests. From left to right you are seeing: The old controller, the test controller, and the new prototype controller.
From the top to the bottom, you are seeing: Random primitive data pin, primitive clock, primitive clear. All of the values are completely within spec. Something else was wrong. Now without photos, the test controller showed that the address clock and reset were triggered perfectly, but on the prototype only the clock triggered. Digging around in the code, I found the culprit. I did not update all values, and in DMA print, the address reset was on the wrong pin. This was an easy fix, and sure thing, now the prototype printed fine in DMA mode.
Why did it not print in normal mode then. I did some more tests, and found that the clock pulse length was 8us. 8! What the old code does is: Set clock to 0, set clear to 1, set al the primitive pins, disable interrupts, set clock to 1, wait roughly 1.8us, set clear to 0, set clock to 0 and enable interrupts. Did I mention that I simply set pin 21 to both clock and clear to make the old code work? In hindsight it is obvious. I already set the clear to 1, and then did plenty of other things before setting clock to 1. This meant that 6us of commands were done before I would actually set the clock, thinking that it was not yet set high. I simply disabled the clear commands in the code, and bang, beautiful 1.8us.
Two important things I discovered. First is that the printhead will simply not fire with pulses of 8us. No nozzles are broken, though I suspect that the life will be a bit shortened. I think that the 8us pulses will keep the nozzles too hot to refill with ink, preventing any ink from being ejected. Second, I never did a full timing test of how long a burst took. I simply did the math. 6us of commands between clear = 1 and clock = 1 tells me that there is a full 400us of extra commands for EACH burst (66*6=396). Adding the 4us or so to actually pulse, I am suddenly surprised that I could even manage 50mm/s. The guesstimated to speed would be 50mm/s to 75mm/s.
I will do timing measurements in the future with a logic analyzer to verify. For now, the head is working again, and I can continue getting all other things to work. I want to add virtual speed, software and hardware triggers, printing text and rewrite Oasis controller to something slightly more universal. That will be for the future.