Shop OBEX P1 Docs P2 Docs Learn Events
Printing on an IR printer — Parallax Forums

Printing on an IR printer

inakiinaki Posts: 262
edited 2005-12-07 16:52 in General Discussion
I am trying to use an IR printer to print from a SX28.
The printer is a 82240, the one used with HP calculators. It is nice to use as a printing device on embedded systems because it is small, wireless and battery operated.

The printer uses 32768Hz modulating frequency. Data·is encoded as·bursts of 427us.
I think I have the righ carrier, about exactly 32768hz, the right pulses width, about 427us, the right led, about 980nm and the right software that encodes the data (I think it is right!).

However, despite my efforts I am unable to print anything on the printer.

I get the modulating 32768hz signal from a precission oscillator that gives a·square wave·between 0 and 4,8V.
The modulating signal goes to a NAND gate(74LS00) as one input. The other gate input is a digital signal that I generate from a SX28 OUTPUT pin,·which is set LOW or HIGH according to the·pulse I want to send. I calculate the duration of the SX signal using PAUSEUS. When both signals are HIGH at the gate input·the level at the OUTPUT is LOW.·At this output pin·is attached an IR led that goes through a resistor to +5V. That is to say, when the gate output is LOW the IR led is ON. Obviously the led is ON only when the modulating signal is HIGH and the SX pin is also HIGH.

The communication is unidirectional, that is to say, there is no emitting diode on the printer side. So all the timing control lies on the SX side, which is good becasue I don't need to read signals back. For starters I have tried to print a single 'A' character, probably the simplest thing that can be printed on this printer.

A problem I can see with this approach·is that·the SX signal·is out of sync with respect to the modulating signal so I can get cut cycles at the begining or at the end of a burst which might affect the transmision.··Other than this I cannot see the problem with my scheme. Anyone sees any problem with it ?

Note: an interface to the 82240 appeared on Circuit Cellar Feb.1995 but I don't have this issue so I could not compare with other implementations.








Post Edited By Moderator (Chris Savage (Parallax)) : 12/4/2005 10:24:20 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-04 22:24
    This post is being moved from the Projects forum to the SX Forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • lcarrlcarr Posts: 2
    edited 2005-12-05 19:44
    Circuit Cellar #55 states the following: the carrier frequency is 33.33 Khz. Probably this may be wrong as the documentation on this article was obtained by hacking. It states also that even an error of 20% in frequency may work.
  • Jim FouchJim Fouch Posts: 395
    edited 2005-12-05 23:21
    inaki,

    I was able to get an IR remote control to work on an SX28 using Sony's 38kH carrier. I did the carrier in Code on the SX. here's what I used.

    This is not all the code, just the parts that due with sending the carrier signal. Hope this helps. Note that I was running at 50Mhz to be able to get the timimg @ 38kHz.
    
    
     
    ' -------------------------------------------------------------------------
    ' IO Pins
    ' -------------------------------------------------------------------------
    IR_Pin          VAR RA.0 ' O
    ZoomOut_Button  VAR RA.1 ' 1
    Status_LED      Var RA.2 ' 0
    Ser_In          VAR RA.0 ' Serial In @ 2400 Baud
    
     
    ' -------------------------------------------------------------------------
    ' Constants
    ' -------------------------------------------------------------------------
    StartDurationHigh CON 2600    'uSec
    _0Duration        CON 800     'uSec
    _1Duration        CON 1300   'uSec
    BitPause          CON 500     'usec
    TenSeconds        CON 10000   'msec
    OneSecond         CON 1000   'mSec
    
     
    StartCommand:
      For J=1 to 104
        SendCarrier
      Next
      Low IR_Pin
      Pauseus BitPause
    Return
    
     
    _0:
      For J=1 to 23
        SendCarrier
      Next
      Low IR_Pin
      Pauseus BitPause
    Return
     
    _1:
      For J=1 to 50
        SendCarrier
      Next
      Low IR_Pin
      Pauseus BitPause
    Return
     
    SendCarrier:
        \ SETB IR_Pin ' High IR_Pin
        \ MOV __PARAM4, #123
        \ DJNZ __PARAM4,@$ 
        \ CLRB IR_PIN   'Low IR_Pin
        \ MOV __PARAM4, #123
        \ DJNZ __PARAM4,@$ 
    Return
     
    PressPlay:
     For I=1 to 5
       StartCommand  
       _0
       _1
       _0
       _1
       _1
       _0
       _0
       _1
       _1
       _1
       _0
       _0
      Pause 24
     Next
    Goto Main1
    
    
    
  • inakiinaki Posts: 262
    edited 2005-12-07 12:34
    Thanks Jim, your approach has two advantages over mine: you don't need an external oscillator and you get always whole cycles, however it takes too much processor time.

    Eventually I have managed to put my design to work. The problem was the encoding of the signal, not the hardware. It happens that the signal is preceded by a burst that is badly specified on the documentation. I have had to open the printer and measure the actual signals received from an actual HP calculator. This way I discovered that my start signal was wrong. Now it works !
  • Jim FouchJim Fouch Posts: 395
    edited 2005-12-07 16:52
    In my project the SX was not doing anything else but processing the IR signals.

    I had to hook a scope to a circuit and see what the Sony IR remote was sending to get my timings to work well. I also had to zoom at far enough to see that the Sony repeats the sequence 5 times.
Sign In or Register to comment.