I've only done some basic testing, but as you can see from the photo above it prints the intended test output (from right-to-left: delta, multiply, black space, decimal, zero).
Based on my analysis of the Canon P170-DH calculator, the basic algorithm is this:
- Apply power to the motor.
- As the character index goes inactive: if the start-of-rotation index is active reset the position count, else increment the position count.
- Wait until the solenoid index goes active 14 times (one full rotation of the print wheels).
- When the position count matches the character to be printed, activate the solenoid when the solenoid index goes active. Keep the solenoid active until the next time the solenoid index goes active unless it's the last character to be printed; to end the line keep the solenoid active for ~24ms.
- After the last character has been printed and the solenoid made inactive, keep the motor active until the solenoid index goes active 14 more times (one full rotation).
- Turn off power to the motor.
Note that checking the character and solenoid index signal levels isn't sufficient for proper operation. The state transitions need to occur on the edges of the indexes because of the way the start-of-rotation index overlaps the character index. I do edge detection as part of the software debounce so it's essentially free.
It appears the start-of-rotation region on the sensor disc has a dirty spot on it, as I see that index go inactive sometimes when it should be active. Or else the contact fingers bounce at certain rotational speeds. It doesn't affect the operation of the printer as it's not in an area where I'm sampling that signal.
Here's some of the things I still want to investigate:
- How many numeric columns can this printer print? I know it'll do 12; will it do 15?
- I haven't tested printing in red yet. Do I properly understand that?
- How far does the print wheel need to rotate before I can print another character? For example, it looks like I can print a 3 immediately after printing a 1 without waiting for a full rotation, but can I print a 2? I don't think so.
- Can it print only one symbol before switching to numerics?
- Can it print more than two symbols?