Industrial Printer SubCircuit
![rolleyes.gif](http://forums.parallax.com/images/smilies/rolleyes.gif)
I want to drive my high current output board that will drive an industrial print head of either a 7-pin or 16-pin configuration.
The configuration I have in mind would consist of this...
I would use a PC to compile the message, breaking each character into "slices" of a data array of 5 X 7 for the 7-pin head and 9 X 16 for the 16-pin head. For example, to print an "L" the array would have in its first slice all 1's for the vertical part of the "L." and the remaining 4 sclices would have all 0's except for the last bit being a 1 for the bottom of the "L."
The PC would download this precompiled message, up to or in excess of 1024 slices·to the Javelin's memory.
The Javelin, through external circuitry would receive a command to begin...
The Javelin would then take the first slice and write it to its outputs. When the outputs are stable the Javelin would issure a Latch command to the driver circuit.
When it is time to begin the print sequence, either the Javelin or another subcircuit would issue a Fire the print head command, based on a predetermined·encoder count.
During the Fire print head event, the Javelin would then write the next slice into the outputs and then issue a latch command, etc... until the full message has been printed.
Timing requirements are:
300 microseconds between Latch commands.
300 microseconds between Fire events.
Comments
import stamp.core.*;
public class PrintHead_test {
· static final int Vsize = 16; //or 8
· static final int Hsize = 10; //or 5
· static final int characters = 1000; //number of characters in slices
· static final int capacity = (Vsize/8)*Hsize;
· static final int storedvalues = characters*capacity;
·
· static byte[noparse]/noparse slices = new byte[noparse][[/noparse]storedvalues]; //bitmaps
·
· static final int readyToPrint· = CPU.pin5;· //input
· static final int dataAvailable = CPU.pin6;· //output
· static final int latch········ = CPU.pin7;· //latch portB to octal latch chip
· static final int dataport····· = CPU.PORTB; //data out
·
· static void readCharacters() {
· }
·
· static void main() {
·
··· //intialize latches and dataport
··· CPU.writePin(dataAvailable,false);
··· CPU.writePin(latch,false);
··· CPU.writePort(dataport,(byte)0);
··· //mainloop
··· while (true) {
····· readCharacters(); //read characters (bitmaps)
····· int i = 0;
····· do {
······· int j = 0;
······· do {
········· if (Vsize > 8) {
··········· CPU.writePort(dataport,slices[noparse][[/noparse]i++]);
··········· CPU.pulseOut(1,latch);
········· }
········· CPU.writePort(dataport,slices[noparse][[/noparse]i++]);
········· while (CPU.readPin(readyToPrint)) ; //wait for readyToPrint input to go low
········· CPU.pulseOut(1,dataAvailable);····· //data available (print command)
······· } while (j < Hsize);
····· } while (i < storedvalues);
··· }
···
· }
·
}
The javelin can easily store the bitmaps for 1000 characters in 16x9 format.
The 300 usec requirement could be an issue. The javelin throughput is about
1000 bytes per second. Then again, the javelin can simultaneously receive data
(eg. the bitmaps) and outputting data. Since your messages from the pc
are also limited to about 1000 bytes per second, I expect 1 msec between
latch pulses.
You specify 300 usec for both latch and print command.
There is no buffer on your driver board?
regards peter
The driver card has only a 74LS374 as a buffer...at this time.
At the end of the day we will ultimately be using a PICMicroprocessor along with onboard RAM and an Ethernet Com port on the driver circuit...
We are now just working on an interim solution.
We will try a Javelin to examine the throughput. Its cheap and easy.
Thanks