Hacking cartridge HP 84/85

Powder and inkjet printing
Post Reply
MAsic12345
Posts: 116
Joined: Sat Aug 25, 2018 5:26 pm
Location: Poland

Re: Hacking cartridge HP 84/85

Post by MAsic12345 »

Wonko
can you write a code template?I tried and cannot combine
thank you
Attachments
55.png
55.png (29.48 KiB) Viewed 14373 times
User avatar
dragonator
Site Admin
Posts: 605
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator »

The outPin needs to stay. The PORTB stuff replaces the digital writes. Also try the code without the delays first to see the absolute maximum possible speed. I have commented a faster way (but more fragile) to delay. Uncomment this to add a 62ns delay. Pin 8 should now switch as fast as possible.

Did you have a teensy on your way? It has these problems a lot less and runs a faster. (and is 3.3V by default)

Code: Select all

int outPin = 8;                 // digital pin 8

void setup()
{
  pinMode(outPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  PORTB|=1;   // sets the pin on
   //__asm__("nop\n\t"); 
  PORTB&=~1;    // sets the pin off
  //__asm__("nop\n\t"); 
}
MAsic12345
Posts: 116
Joined: Sat Aug 25, 2018 5:26 pm
Location: Poland

Re: Hacking cartridge HP 84/85

Post by MAsic12345 »

did here what happened
port (b) for some reason does not work, perhaps I burned it

found ports from arduino mega
Mega Port Diagram.png
Mega Port Diagram.png (150.72 KiB) Viewed 14360 times
changed to port (a) and that's what happened
33.png
33.png (26.29 KiB) Viewed 14360 times
and the question arose why the second output gives some kind of signal if only one first is connected
viber image.jpg
viber image.jpg (219.33 KiB) Viewed 14360 times
MAsic12345
Posts: 116
Joined: Sat Aug 25, 2018 5:26 pm
Location: Poland

Re: Hacking cartridge HP 84/85

Post by MAsic12345 »

Wonko
Did you have a teensy on your way? It has these problems a lot less and runs a faster. (and is 3.3V by default)
teensy I do not have,
if you say that arduino will not repeat the desired signal then I will order teensy
Wonko
Posts: 111
Joined: Sat Aug 15, 2015 8:13 pm

Re: Hacking cartridge HP 84/85

Post by Wonko »

Arduino Due has the same shape as the Mega and also a faster ARM based CPU and 3.3V.

I forgot to mention interrupts. To keep the serial port working and a few other things, Arduinos use interrupts that - as the name says - interrupts the flow of your program at any point in time. For the duration of time critical bit manipulation, you should probably disable all interrupts. But be careful, don't forget to switch them back on, because they are needed for generating some of the signals and for longer range timers:

https://www.arduino.cc/reference/en/lan ... nterrupts/
MAsic12345
Posts: 116
Joined: Sat Aug 25, 2018 5:26 pm
Location: Poland

Re: Hacking cartridge HP 84/85

Post by MAsic12345 »

Finally i got an Teensy
I can't teach him to give a quick signal,
I used your Wonko code,
ports trick (A) (B) does not work
maybe the Teensy has no ports like the Arduino?
teensy.jpg
teensy.jpg (178.08 KiB) Viewed 14236 times
User avatar
dragonator
Site Admin
Posts: 605
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator »

Teensy direct port manipulation requires different code.

Try it with Digital writes first. Teensy should even then be faster than Arduino with Port manipulation.
MAsic12345
Posts: 116
Joined: Sat Aug 25, 2018 5:26 pm
Location: Poland

Re: Hacking cartridge HP 84/85

Post by MAsic12345 »

dragonator that's what happened
Attachments
11.png
11.png (3.25 KiB) Viewed 14235 times
User avatar
dragonator
Site Admin
Posts: 605
Joined: Fri Aug 14, 2015 4:48 pm
Location: The Nethelands
Contact:

Re: Hacking cartridge HP 84/85

Post by dragonator »

Are there any delays on here? It is slower than what I am used to.

I would need to look in some of my code to find Teensy port manipulation code.
MAsic12345
Posts: 116
Joined: Sat Aug 25, 2018 5:26 pm
Location: Poland

Re: Hacking cartridge HP 84/85

Post by MAsic12345 »

dragonator delayed I did not set
I used the LED code and removed the delay
Post Reply