VGA1306 plus NES Controller (now with FX goodness!)

Thanks to @uxe I have been able to transport 1943 to my TV!

Based on a Leonardo clone, this one uses a VGA1306 converter and a hacked NES Controller.

11 Likes

Sweeeeeeeeeeeeeeeeeet! :slight_smile:

Yeah, I wiash I could have got hold of some 7core-black cable instead of the ribbon cable but JayCar only had a 10M roll at $45 and it was really thick!

I am now looking at ideas for sound.

Well, apparently getting ‘line-level’ sound out of an Arduino pin is as simple as this (might need another trip to Jaycar!):

Maybe try it with some cheap PC speakers or something first before you go plugging it into an expensive TV though!!

Bice … I found this schema on the site which confirms D5. I thought the Arduboy did something a with a pair of pins to allow some sort of bi-tonal sound ?

Yes,

SPEAKER PIN 1 = Leonardo pin 5 (PORTC6)
SPEAKER PIN 2 = Leonardo pin 13 (PORTC7)

I just have a piezo buzzer on mine, using a single channel - one side connected to Leonardo pin 5, and the other to GND.

Pin 13 on a Leonardo is where the user LED is, so could cause complications??

OK … can I do this with ‘line level’ sound output?

Line level is for connecting to the audio input on a TV, or a stereo or whatever.

A Piezo buzzer on the other hand, you can just connect directly to an Arduino pin, no other components needed (be careful not to get a buzzer that only produces a single set frequency though).

A ‘speaker’ is different again, and depending on who you ask, you should be using it with a resistor, a resistor and a transistor, or resistors transistors and capacitors! :crazy_face:

Yes, I probably didn’t ask that question properly. Can I use two pins (as per the Arduboy’s piezo) in a configuration similar to the ‘line out’ schematic shown. If I connect just the one pin as shown in the ‘line out’ schematic, will the sound be compromised when using the Arduboy libraries?

I’m not sure how many Arduboy games make use of both channels?

You would need to duplicate that schematic if using both channels, have one circuit for each pin, and then feed them both into a single stereo audio jack, or two separate RCA jacks?

But, like I said, having the user LED in the circuit when using pin 13 could do weird things… would need to ask an electrical engineer! :upside_down_face:

2 Likes

But@Mr.Blinky has shown here that pin 6 can be used as an alternative for the second speaker pin, using an adapted library.

By default, pin 6 would be OLED RESET, but you don’t need that when using the VGA1306. So that could be an option?

Ah but that is ATMLib … I am more interested in ArduboyTones as that is what my games use. I might just wire up the simple circuit and see what it sounds like.

Good luck! :slight_smile:

If it doesn’t work, then could just make a modified version of ArduboyTones that uses pins 5 & 6 instead. This should probably be done regardless, for the benefit of all the DIYers using Leonardos and Micros for their own clones?

What do you know - it already has been done!

1 Like

…and here’s a modified Arduboy2Core.h to use with it (swaps OLED RESET to pin 13, and SPEAKER_2 to pin 6):

https://pastebin.com/dYicgYhE

1 Like

you could connect two 1K resistors in series between leonardo pins 5 and 13 and connect the center point of those 2 resistors to that 2.2K resistor in the schematic @uXe posted.

Stranded cat5 is your friend failing that chop up an old scart/ vga or printer cable.

1 Like

Have been playing with this tonight on my Leonardo, and digging deeper into ArduboyTones (for the first time! :blush:)

ArduboyTones only uses the second speaker pin for volume boost, no ‘bi-tonal’ sound there.

So you won’t be missing out on any notes if you just use pin 5 for your line-level output.

Actually, not sure how that circuit above will react if both pins are fed into it, when they are in ‘volume boost’ differential-drive 10Vpp mode? Time to find that electrical engineer again… :stuck_out_tongue:

2 Likes

OK - good to know.

I am hoping to play with this on the weekend. I will update with results.

So a bit more sciencing today and I have sound.

As you will see, when it isn’t actually playing sound I have some awesome white noise going on. Obviously, all my wiring is on top of each other which is probably not helping but I wonder if the Arduboy introduces sound itself?

I did not even have to change anything code-wise to get this going. Again, would any of the Arduboy library hacks people have mentioned help the issue? @uXe, @Mr.Blinky ?

2 Likes