In today’s example we are continuing with yesterday’s theme of providing an example that is very close to an end solution. Today’s example showcases a thermal printer. A thermal printer device produces a black printed image by selectively heating coated thermochromic paper when the paper passes above the printer head. This type of printer is often used for in low power printing and mobile retail and point of sale (POS) operations.
In this example we use a thermal printer with a print head (PTMBL1B00A) that supports 384 horizontal dots arranged in 6 groups of 64. This example has been implemented on our CY8CKIT-001 and the CY8CKIT-038, but can be easily ported to the CY8CKIT-042 Pioneer board.
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Project Images
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- Control Register
- AND Gate
The main.c firmware is included in the example project. Please review the commented sections for more details.
In this example the PSoC 4A device uses an SPI interface to transfer the values line by line to the shift register and enables the strobe signals to print them on the paper. The printed data is moved into a shift register that is latched into a latch register. This data is then transferred to the paper by enabling the corresponding strobe signal. A stepper motor is used to rotate the paper while printing occurs.
The print and motor control logic seen in the schematic design controls the signals to the strobe lines and stepper motor driver inputs. A PWM is provided in order to ensure the smooth operation of the stepper motor. A Thermistor is also present in the printer which is used for monitoring the print-head temperature. The comparator is used to switch off the printer if the print-head is overheating.
In this example the user can use the schematic view of the Creator design to understand the connections to the external components. The thermal printer datasheet is provided on the component website. In this example we built up a simple test board to attached the thermal printer and the stepper motor. For a stepper motor example please see example #045. The following is a setup of the hardware. We used a breadboard to wire up the connections from the development kit to our thermal printer board.
Test Your Project:
Setup your hardware by connecting the stepper motor and the thermal printer to a test board. Once this is complete program the PSoC 4 development kit to evaluate the example.
I hope this example can help you in your design.