Hacking cartridge HP 84/85

Powder and inkjet printing
User avatar
dragonator
Site Admin
Posts: 419
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator » Sat Nov 10, 2018 7:15 pm

Your code (the one shown below) Makes all pins below 1 in order. This is fine for a test but not needed in the final setup, where you need to replicate a signal on several pins at the same time. I tried to make a code that only turns on and off one pin at a time. Using 7 turns several pins on and off at once, 7 being 00000111 in binary. It turns on 2, 14 and 7 at the same time. In the code below the number 0-7 is used to shift a 1 in position. 1<<0 is 00000001, 1<<1 is 00000010, and 1<<7 is 1000000.

The delay is placed behind the GPIOD block. You can place as many "nop\n\t" as you want, as shown in my previous post, to get the delay you want.

You won't get any faster than the 12MHz you already had. That is the upper limit. The delays are used to go slower and reach the timing you had in the measurements. How many 1 'nop' is depends on you clockspeed. I use the 'nop' at 96MHz, where 1 clock cycle takes around 10ns. A Teensy 3.6 running at 180MHz it should be around 5ns of delay.

Code: Select all

byte pinTable[] = {2,14,7,8,6,20,21,5};

void setup() 
    {
      for (int i=0; i<8; i++) 
      { 
        pinMode(pinTable[i],OUTPUT); 
      } 
    }

void loop() 
      {
      for (int i=0; i<=7; i++)
       {
         byte b = 1<<i;
         GPIOD_PDOR = b;
          __asm__("nop\n\t");
        
       }
      }

MAsic12345
Posts: 75
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Sun Nov 11, 2018 1:19 pm

Here is the final step
It remains to figure out how to adjust the width of the gap between the seventh bit.
and how to create another synchronous signal of another type on another pin
Attachments
1111.png
1111.png (70.95 KiB) Viewed 2366 times

MAsic12345
Posts: 75
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Sun Nov 11, 2018 7:05 pm

Code: Select all

byte pinTable[] = {7};                    // Вводим вывод на тенси

void setup() 
  { 
    for (int i=0; i<1; i++)               // Ето цыкл переключения бита (0) на (1)
    { 
      pinMode(pinTable[i],OUTPUT); 
    } 
  } 

void loop() 
  { 
    for(int i=0; i<7; i++)                // Задаем количество битов
    { 
      GPIOD_PDOR |= 7;                    //
      __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"
      "nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); 
                                          // "nop\n\t" Ширина бита (0)

      GPIOD_PDOR &= ~7; 
      __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"
      "nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t"); 
                                          // "nop\n\t" Ширина бита (1)
    } 
  }

User avatar
dragonator
Site Admin
Posts: 419
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator » Mon Nov 12, 2018 9:49 pm

I wanted to share this video



While I want to poke Jeroen about this specific printhead as well, I also really like his way of verifying if he understands how the signal works.

TL;DR:

Capture all of the signal of a printed image. Write a script that turns the signal into an image the way you it thinks it is doing it, and look at the image. If it is distorted, you can see from distortions what is wrong. If the image looks right, you now understand the signal.

MAsic12345
Posts: 75
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Tue Nov 13, 2018 5:04 pm

I'd love to experiment with the protocol,
Last edited by MAsic12345 on Tue Nov 13, 2018 5:06 pm, edited 1 time in total.

MAsic12345
Posts: 75
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Tue Nov 13, 2018 5:05 pm

but I have to finish simulating the protocol,
I only managed to create 7 bit 3 megahertz
I still do not know how to write code for the second signal, so that it would work synchronously with,
and don’t know how to make a zero bit,
who can help me with this.

User avatar
dragonator
Site Admin
Posts: 419
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator » Tue Nov 13, 2018 7:54 pm

I do hope I can offer some help, but between work and obligations, I can only do a little. If there are other people who can assist, please do so.

The first thing is that you can set several pins at once with GPIOD. This means that pins that can be set at the same time (such as data pins) you can set at once. You can also set data, then do the clock high, set data to next state, and set clock low. I can see if I can find some time these weeks to write something that can repeat code from memory. Then all you need is something to convert the CSV you have to something you can flash into memory. No promises that it I can do it quickly, but I do have a few ideas on how I could do this.

User avatar
dragonator
Site Admin
Posts: 419
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator » Tue Nov 13, 2018 7:59 pm

Another thing.

With SpriteTM giving a great way to verify if signals are correct. Can you print one or two lines of text on paper and capture all of that on your logic analyzer. All pins on the printhead would be awesome, and an image of what it was you printed. It is important that the entire print job is captured with the analyzer, so do not print too much. This way, it might be possible to do what sprite did and write a script that converts the printer lines to an image. This is something I know I can write, and if it works, I might verify that we understand how the protocol works.

math
Posts: 21
Joined: Tue May 24, 2016 1:08 am

Re: Hacking cartridge HP 84/85

Post by math » Thu Nov 15, 2018 6:22 pm

@dragonator
I love this video! Thak you very much!!! Coincidentally I'm working in this cartridge.

MAsic12345
Posts: 75
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Thu Nov 15, 2018 7:29 pm

math wrote:
Thu Nov 15, 2018 6:22 pm
@dragonator
I love this video! Thak you very much!!! Coincidentally I'm working in this cartridge.
you work with a cartridge HP 84?

Post Reply