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

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

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

Postby AlexAler » Sun Nov 01, 2020 9:51 am

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?
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

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

Postby AussieSusan » Mon Nov 02, 2020 5:01 am

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).
AussieSusan
Verified identity
 
Posts: 173
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist

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

Postby AlexAler » Wed Nov 04, 2020 5:46 am

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.
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

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

Postby ric » Wed Nov 04, 2020 10:00 am

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.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

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

Postby AussieSusan » Fri Nov 06, 2020 9:07 am

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
AussieSusan
Verified identity
 
Posts: 173
Joined: Mon Jun 16, 2014 4:45 am
PIC experience: Experienced Hobbyist

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

Postby ric » Fri Nov 06, 2020 10:16 am

I don't think there is any logo. It's a new feature he wants to add.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

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

Postby AlexAler » Sun Nov 08, 2020 6:04 am

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.
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

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

Postby ric » Sun Nov 08, 2020 6:28 am

If you have it, and we don't, there's not much we can tell you about what to do with it.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

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

Postby AlexAler » Sun Nov 08, 2020 9:18 am

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?
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

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

Postby AlexAler » Sun Nov 08, 2020 10:32 am

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.
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

Next

Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 13 guests

cron