Page 1 of 2

Modify Hex file to add a logo to the thermal printer receipt

PostPosted: Sun Nov 01, 2020 9:51 am
by AlexAler
I have an old digital weighing device that prints the weight using a thermal printer. My goal is to add my logo to the printer's receipt.
There are two boards inside. One is for deriving the display and the loadcell, while another one is for driving the thermal printer (each board has one dsPIC33). Since I do not have the source code of the second board, and only I downloaded the Hex file with PICkit, is there any way to add my logo by modifying the Hex file?

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Mon Nov 02, 2020 5:01 am
by AussieSusan
Does the exisiting code output a logo? If so you *might* be able to see where it is in the hex file (making a lot of assumptions) and then edit your own logo (suitably converted into hex) as long as it is exactly the same size.
You might also be able to find a disassembler that can convert the hex file back to assembler and that might allow you to create an equivalent C file, but there are lots of traps along that route (although it can be done with patience).

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Wed Nov 04, 2020 5:46 am
by AlexAler
Sorrily, the current hex file does not contain a logo, so I believe I have to write a printer driver from scratch to add my logo. I am not familiar with driving a parallel thermal printer, but I must try.

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Wed Nov 04, 2020 10:00 am
by ric
I agree with Susan, this will be a lot of work if the existing code does not already do it.
The first step would be to find the documentation for the thermal printer. Most of them use the ESC/POS protocol.

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Fri Nov 06, 2020 9:07 am
by AussieSusan
If the hex file does not contain the logo then it must be somewhere else and you will need to find where.
If it is in another file that is loaded, then you maybe able to edit that in some way.
If the logo is in the printer itself, then the instruction manual might tell you how to access and edit it.
Susan

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Fri Nov 06, 2020 10:16 am
by ric
I don't think there is any logo. It's a new feature he wants to add.

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Sun Nov 08, 2020 6:04 am
by AlexAler
Thank you for your replies. I was lucky, and get the source code of the printer from the company. Since, it is a non-standard micro-printer, still, I am struggling to add my logo. I convert my logo to hex format, but the output is something else.

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Sun Nov 08, 2020 6:28 am
by ric
If you have it, and we don't, there's not much we can tell you about what to do with it.

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Sun Nov 08, 2020 9:18 am
by AlexAler
Since I signed a copyright form, I cannot share my received source code. Just a quick question, I found that each character is defined in 8*16 format, for example, ":" is defined as follow:

Code: Select all
Par=[0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00];


The above can be checked by https://javl.github.io/image2cpp/

My question is how I can break my logo into 4*4 blocks, where each block contains 8*16 bits?

Re: Modify Hex file to add a logo to the thermal printer rec

PostPosted: Sun Nov 08, 2020 10:32 am
by AlexAler
When I am trying to make my logo in a smaller size, it gets blurred. Is there any way to make my logo with better quality? My logo is a bit complex I think and contains shapes and words. Thanks for your help.