Modules, cases, buttons...
by spinal » Thu Oct 20, 2016 7:46 pm
Hi everyone,
I have just started putting together a gamebuino and attempting to use the old TV-out lib instead of a nokia screen. I figured it would be a simple process, but I have only just started looking into it.
Current progress, I have the tv-out lib installed and the gamebuino lib and can compile the example files. For now though, I can init the tv-output, but not get any picture...
Does anyone have an experience messing with the screen code that could possibly help out a bit?
Watch this space...
-
![User avatar](./download/file.php?avatar=1897_1477125116.gif)
spinal
-
- Posts: 22
- Joined: Thu Oct 20, 2016 7:39 pm
by naed » Thu Oct 20, 2016 10:40 pm
-
![User avatar](./download/file.php?avatar=1789_1469487866.jpg)
naed
-
- Posts: 140
- Joined: Tue May 31, 2016 3:18 pm
by rodot » Fri Oct 21, 2016 7:08 am
It's based on
Myndale's TV out adapter : it's an atmega328 that sniffs the SPI bus to get the nokia frames, and generate TV output.
-
![User avatar](./download/file.php?avatar=2_1505825079.jpg)
rodot
- Site Admin
-
- Posts: 1290
- Joined: Mon Nov 19, 2012 11:54 pm
- Location: France
-
by spinal » Fri Oct 21, 2016 9:38 am
Yeah, seen it, but it does require a second arduino and a working gamebuino to start with.
Currently I have managed to get a stable tv output, however it's just a garbled mess. I'm not sure if my screen pointer is correct or if maybe the two are using different formats (1bpp, top left to bottom right?)
[edit]
I'm getting close, I have most of the screen visible, but I'm getting solid lines every 8th.
-
![User avatar](./download/file.php?avatar=1897_1477125116.gif)
spinal
-
- Posts: 22
- Joined: Thu Oct 20, 2016 7:39 pm
by jonnection » Fri Oct 21, 2016 9:30 pm
Gamebuino lib and tv out lib should NOT work together.
This is because Gambuino uses Timer 1 for sound whereas Tv out lib uses timer 1 for tv signal generation. this is coming off the top of my head from way back when i worked with the hackvision. But in any case there is a conflict between timers - the tvout lib was never able to produce decent sound because there were no more free timers to use.
How you managed to get a picture out is a mystery to me.
![Laughing :lol:](./images/smilies/icon_lol.gif)
-
![User avatar](./download/file.php?avatar=414_1411348614.png)
jonnection
-
- Posts: 317
- Joined: Sun May 04, 2014 8:21 pm
-
by spinal » Sat Oct 22, 2016 8:30 am
I currently have a solid picture... it's sideways, but it's a picture. As you said though, no sound, not sure what I'll do about that, my first aim is to get the picture correct.
Currently I'm using a second buffer and converting the LCD buffer which has two drawbacks, 1. extra time, 2. extra RAM, neither of which I want.
Next step I guess is to re-write the display code to write directly to my TV buffer, hopefully that won't take much more than changing the read/write pixel functions... I hope.
-
![User avatar](./download/file.php?avatar=1897_1477125116.gif)
spinal
-
- Posts: 22
- Joined: Thu Oct 20, 2016 7:39 pm
by jonnection » Sat Oct 22, 2016 10:55 am
Rodot has already written the Gamebuino library in such a way, that picture can be rotated. All functions call the setpixel routine.
So turning your image 90 degrees should be no problem at all. Just make the setpixel routine in gamebuino library to write directly to the tvout buffer and you're done.
Also, how about making a short video about your tv output ? I have done it myself a couple of years ago, and I had some issues as well to get a stable picture. If I saw what problems you are having, I could maybe give you a hint what might be wrong.
-
![User avatar](./download/file.php?avatar=414_1411348614.png)
jonnection
-
- Posts: 317
- Joined: Sun May 04, 2014 8:21 pm
-
by spinal » Sat Oct 22, 2016 11:20 am
I have not got the picture correct, re-did the pixel code and reverted the bitmap code to the older one (that draws pixel-by-pixel). The only thing I don't like about it, is the NEEDS a second screen buffer, as the tv-out redraws the screen regardless, it's fast enough to catch the clearing etc. that's going on, so I have to double buffer the display, wasting 528 bytes.
My only issue now is A - No sound, can't think of a way around that right now, and B a good handful of gamebuino games won't compile, even a couple of the examples. see
here maybe a memory thing? Idk.
But yeah, a bunch of the examples work fine, as does the tron game, others just won't compile, for some reason id sometimes doesn't like the asm macros in the tv-out lib.
-
![User avatar](./download/file.php?avatar=1897_1477125116.gif)
spinal
-
- Posts: 22
- Joined: Thu Oct 20, 2016 7:39 pm
by spinal » Sat Oct 22, 2016 7:39 pm
Please excuse the double post, I thought some of you would want to the see the 'progress'.
![Image](http://socoder.net/uploads/124/Img_1172.jpg)
Here are my modified libs -
http://socoder.net/uploads/124/tvout_gamebuino.zipIf you want to follow in my footsteps, you'll have to rewire your inputs, I couldn't get the tvout code to use anything other than pin 9.
My buttons are as follows -
//buttons pins
#define BTN_UP_PIN 10
#define BTN_RIGHT_PIN 7
#define BTN_DOWN_PIN 6
#define BTN_LEFT_PIN 8
#define BTN_A_PIN 2
#define BTN_B_PIN 5
#define BTN_C_PIN A3
the tvout pins are 9 (sync) and 4 (data)
If anyone gets further than me, don't hesitate to let everyone know!
Also, if anyone can get any of the following games to compile with the above changes, please tell me how...
A2K
AGEDDON
Artillery
B-Rally
blocksBuino
Bomber
bub
Castle
conduit
Copter
CopterStrike
CrazyTown
DescentIntoHell
Digger
FlappyBirdo
GambiPaint
GlaciGlaca
invaders
Maruino
microHex
paqman
SmashandCrash
snakeAbcBuino
StickFighter
Super-Crate-Buino
uforace
ZombiEscape-master
-
![User avatar](./download/file.php?avatar=1897_1477125116.gif)
spinal
-
- Posts: 22
- Joined: Thu Oct 20, 2016 7:39 pm
by jonnection » Sat Oct 22, 2016 8:40 pm
Wow. Well done !
Alas, there are not any good ways around the sound problem. I tried to put the sound code into the hsync interrupt myself (hblhook), but there isn't enough time to process sound code inside that interrupt. The picture will break, because the hsync can not be delayed. There's only a couple of cycles available and thats not enough to do the calculations needed by sound. The tone function in tvout library uses a different technique to generating sound than the Gamebuino library. The Gamebuino library manipulates the OCR2A value i.e. the duty cycle of timer 2 PWM inside the timer 1 interrupt. The tone library in tvout on the other hand uses a fixed duty cycle PWM signal generated by timer 2 but with a frequency that can be set at every vsync (once per frame). This is just of my memory, can't be bothered to check.
The pin 9 thing you mention is a direct result of timer 1 being physically attached to pins 9 and 10. Using pin 10 for video signal should be possible, but I haven't tried it myself and don't know if it helps in this case anyways.
As to the compilation problem: use file->preferences->verbose output in Arduino IDE and report back the compilation error.
-
![User avatar](./download/file.php?avatar=414_1411348614.png)
jonnection
-
- Posts: 317
- Joined: Sun May 04, 2014 8:21 pm
-
Return to Hardware Development
Who is online
Users browsing this forum: No registered users and 108 guests