Forum Replies Created
-
AuthorPosts
-
MichaelKeymaster
The assembler for capturing image data is very carefully crafted to be timed exactly. The approach is to read the analog comparator value to determine if a pixel should be “on” or “off”. This loop represents the capture of 8 bits (8 pixels), then it repeats until the screen is done.
For each pixel the code is something like this. I’ve included more comments
"in __tmp_reg__,%[acsr]nt" //2 -- this is the 2nd bit of the byte we are capturing. Read the ASCR register into __tmp_reg__
"bst __tmp_reg__,5nt" // store the 5th bit of this value into T. 5th bit is analog comparator val
"bld r16,6nt" // load T into the 6th bit of r16. r16 is the byte that holds the captured bits
"delay2nt" // delay 2 cycles for perfect timing
Study the AVR assembly guide and you’ll understand each instruction:
http://www.atmel.com/Images/doc1022.pdfNo, this can’t be sped up! This is written in assembly so we can do it as fast as possible. There isn’t even a spare cycle to be had. That’s why you can only do LOW resolution with the TVout library — the processor can’t run fast enough to capture or output pixels at the same rate as the TV scan rate.
MichaelKeymasterJDraugr, sounds like you’re having fun. When a button inside the joystick is “pressed” (like when you move hte joystick up), does that connect the pin (in this case WHT) to ground? That’s the way the inputs on the Hackvision are programmed; a button press is indicated by the pin being connected to GND.
It looks like there are enough digital input pins on the hackvision to accomodate two joysticks. Joystick A would connect to pins D2,D3,D4,D5,D10 just like the onboard buttons. Joystick B could connect to pins D6,D8,D12,D13 and A0 that are broken out on the right side of the board. The software would need to be changed to look for input on these pins for Joystick B input.
Regarding the button pin being shared between joystick and paddle — that should be fine to have it wired to both connections on Hackvsions (D10 and D0). When the button is pressed it will connect to ground and the software can detect that.
I think you are on the right track — just do some experimentation. Start with one DB9 connector for one joystick/paddle wired to D2, D3, D4, D5, D10 for joystick and D0,A3 for the paddle.
MichaelKeymasterYes, the Eagle schematic and board files are in the file downloadable on the design page:
http://nootropicdesign.com/ve/design.htmlMichaelKeymasterThe Video Experimenter only has one input and one output. They are composite video. Wireless transmission of the frame buffer is probably beyond what the ATmega328 can do.
MichaelKeymasterIt depends on how the game author wrote their code. For the games I wrote (Space Invaders, Asteroids), the answer is no. The scores will be preserved.
MichaelKeymasterIt depends on how much code and memory is required by the game. For Space Invaders, I was able to squeeze a simple Pong implementation into the same program. But Asteroids was too big to fit anything else.
No plans for additional storage. Just upload different games if you want to play something different.
MichaelKeymasterPerhaps you could tell us what “the CS game” is.
MichaelKeymasterYes you can change the code to make the sound different. Do you have a USB to serial adapter?
I have no idea what “the CS game” is….
MichaelKeymasterNo, but you can use one of the LED connections if you want. That’s one way to connect to something external.
I didn’t want to make it too easy to control external devices in case someone wanted to make something actually dangerous.
MichaelKeymasterNot sure I understand what you mean by connecting to outside boards. What do you want to do?
Study the source code available on the Hack page: http://nootropicdesign.com/defusableclock/hack.html
The code for assigning the wires is in the function [tt:1lildtnm]countdown()[/tt:1lildtnm]. Just change this code if you want it nonrandom.// assign random pins
defusePin = random(WIRE_1, (WIRE_4+1));
detPin = defusePin;
while (detPin == defusePin) {
detPin = random(WIRE_1, (WIRE_4+1));
}To require a particular sequence, you’d have to be more clever, but the work is in the function [tt:1lildtnm]countdown()[/tt:1lildtnm]. With some coding skill, you can do it.
MichaelKeymasterHey, nice job! So few people have the skills to hack around with the timer routines, etc.
MichaelKeymasterI’m confused – the Video Experimenter shield is a chip for processing composite video. What is your composite video source?
Or are you saying that you want to use the VE shield for video output only, and not for processing an incoming video signal?MichaelKeymastermes64,
Please contact orders@nootropicdesign.com to arrange for a replacement kit.MichaelKeymasterYes, you need to run 5V, GND, and pins 2-5. And the reset line if you want that capability.
I’m completely shocked that it is working on a Max32, as the digital outputs are only 3.3V on that board, and the Digit Shield requires 5V logic levels….!!
MichaelKeymasterNo, you cannot power a motor from the output pin connected to the LED. An output pin of the ATmega328 cannot source that much current. You would need to use the output pin to control a transistor which in turn switched the current for the motor.
You can make the code mod by getting the source code from the hack page:
http://nootropicdesign.com/defusableclock/hack.html -
AuthorPosts