Hacking cartridge HP 84/85

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

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Wed Oct 24, 2018 9:27 am

Wonko
can you write a code template?I tried and cannot combine
thank you
Attachments
55.png
55.png (29.48 KiB) Viewed 2337 times

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

Re: Hacking cartridge HP 84/85

Post by dragonator » Wed Oct 24, 2018 12:48 pm

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: 86
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Fri Oct 26, 2018 8:46 am

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 2324 times
changed to port (a) and that's what happened
33.png
33.png (26.29 KiB) Viewed 2324 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 2324 times

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

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Sat Oct 27, 2018 6:50 am

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: 92
Joined: Sat Aug 15, 2015 8:13 pm

Re: Hacking cartridge HP 84/85

Post by Wonko » Sat Oct 27, 2018 9:28 pm

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: 86
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Fri Nov 02, 2018 4:00 pm

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 2200 times

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

Re: Hacking cartridge HP 84/85

Post by dragonator » Fri Nov 02, 2018 5:03 pm

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: 86
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Fri Nov 02, 2018 5:46 pm

dragonator that's what happened
Attachments
11.png
11.png (3.25 KiB) Viewed 2199 times

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

Re: Hacking cartridge HP 84/85

Post by dragonator » Fri Nov 02, 2018 6:05 pm

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: 86
Joined: Sat Aug 25, 2018 5:26 pm

Re: Hacking cartridge HP 84/85

Post by MAsic12345 » Fri Nov 02, 2018 6:11 pm

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

Post Reply