Wonko
can you write a code template?I tried and cannot combine
thank you
Hacking cartridge HP 84/85
-
- Posts: 116
- Joined: Sat Aug 25, 2018 5:26 pm
- Location: Poland
Re: Hacking cartridge HP 84/85
- Attachments
-
- 55.png (29.48 KiB) Viewed 14373 times
- dragonator
- Site Admin
- Posts: 605
- Joined: Fri Aug 14, 2015 4:48 pm
- Location: The Nethelands
- Contact:
Re: Hacking cartridge HP 84/85
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)
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");
}
-
- Posts: 116
- Joined: Sat Aug 25, 2018 5:26 pm
- Location: Poland
Re: Hacking cartridge HP 84/85
did here what happened
port (b) for some reason does not work, perhaps I burned it
found ports from arduino mega changed to port (a) and that's what happened
and the question arose why the second output gives some kind of signal if only one first is connected
port (b) for some reason does not work, perhaps I burned it
found ports from arduino mega changed to port (a) and that's what happened
and the question arose why the second output gives some kind of signal if only one first is connected
-
- Posts: 116
- Joined: Sat Aug 25, 2018 5:26 pm
- Location: Poland
Re: Hacking cartridge HP 84/85
Wonko
teensy I do not have,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)
if you say that arduino will not repeat the desired signal then I will order teensy
Re: Hacking cartridge HP 84/85
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/
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/
-
- Posts: 116
- Joined: Sat Aug 25, 2018 5:26 pm
- Location: Poland
Re: Hacking cartridge HP 84/85
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?
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?
- dragonator
- Site Admin
- Posts: 605
- Joined: Fri Aug 14, 2015 4:48 pm
- Location: The Nethelands
- Contact:
Re: Hacking cartridge HP 84/85
Teensy direct port manipulation requires different code.
Try it with Digital writes first. Teensy should even then be faster than Arduino with Port manipulation.
Try it with Digital writes first. Teensy should even then be faster than Arduino with Port manipulation.
-
- Posts: 116
- Joined: Sat Aug 25, 2018 5:26 pm
- Location: Poland
Re: Hacking cartridge HP 84/85
dragonator that's what happened
- Attachments
-
- 11.png (3.25 KiB) Viewed 14235 times
- dragonator
- Site Admin
- Posts: 605
- Joined: Fri Aug 14, 2015 4:48 pm
- Location: The Nethelands
- Contact:
Re: Hacking cartridge HP 84/85
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.
I would need to look in some of my code to find Teensy port manipulation code.
-
- Posts: 116
- Joined: Sat Aug 25, 2018 5:26 pm
- Location: Poland
Re: Hacking cartridge HP 84/85
dragonator delayed I did not set
I used the LED code and removed the delay
I used the LED code and removed the delay