Post Reply 
Calculators with Support of the 82240 IR-Printer
06-27-2014, 07:25 AM (This post was last modified: 06-27-2014 07:45 AM by Martin Hepperle.)
Post: #21
RE: Calculators with Support of the 82240 IR-Printer
(06-26-2014 10:08 PM)everettr Wrote:  I was confused about pulses and bursts, and how the IR detector interprets them. It is getting clearer to me now. I will probably go with the TSOP4133 part that Christoph suggested, though I am sure this is very similar to those that you listed.

5 Kb, what a whopper :-) If it fits the flash and meets the timing constraints, no problem. It sounds like you are using interrupts for both the serial and the burst timing. I would like to see how you did that, since I have been wondering if some sort of caching of data would be needed to separate IR operations from serial communications. That is an interesting idea about additional ESC sequences, but how would you persuade a calculator to emit the new sequence?

(06-26-2014 07:58 AM)Martin Hepperle Wrote:  I just finished the first version of the code and can make it available if you are interested. I am just adding some comments so that the code is understandable.
I am definitely interested in seeing your project!
Thank you,

Yes, I used a pin-low interrupt to capture the start of a data frame and then a timer interrupt to capture the half-bits. Before that I had tried the quick&dirty approach (polling with while() loops) but that was unreliable, inelegant and dirty.
The other problem was that I first had the serial communication in the interrupt service routines (resp. in the polling loops) but I quickly learned that serial I/O is too slow so that I lost bits and sync. Therefore I implemented a ring buffer (mailslot) where the interrupt routine places the decoded and error checked byte and the main loop later emits these to the serial line. This works very well (i would even dare to say perfectly) and I noticed that I could make the buffer very small (1-2 bytes), but stuck with a voluptuous 8-16 byte buffer.
My error checking corrects one flipped bit and I think this could be improved, but I am not sure.

Emitting special escape sequences should be asy by sending e.g. an ESCape character (ASCII 27) and then a code which is not used by the printer and does not indicate a graphics sequence. For example "ESC 0" could initiate and terminate a different command mode and this could be filtered out of the IR stream so that the command is not sent to the printer. I have made provision for such a thing in the code, but it is more of a hook and not yet fully developed.
I think most of the better calculators can send individual characters/ASCII codes.
If the calculator can only emit simple thinkgs, one couls us a magic work (number or string) to switch modes, but that should be the last resort.

Code may be posted here when polishing is finished.

Martin
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Calculators with Support of the 82240 IR-Printer - Martin Hepperle - 06-27-2014 07:25 AM



User(s) browsing this thread: 2 Guest(s)