The Mini AV Test Box

Questions and Comments on All Projects
ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Tue Jun 28, 2011 2:26 am

The example video for programming PICs used the 18F452 device which has many more options and much more functionality than a 16F84A.

Set your Oscillator to 'XT' for 4 MHz or less, or 'HS' for 4 MHz or higher.
Watchdog Timer is unnecessary, so it should be disabled. The other configuration bits don't matter just leave them at whatever they are.

::Edit::

I loaded up the project from way back when I made it. I used these configuration bits:

OSC = HS
WDT = OFF
PUT = OFF
CP = OFF

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Tue Jun 28, 2011 3:15 am

I used config bits provided and rebuilt project. Seemed to built ok ( no errors in blue). Proceeded to program with Pickit2, tested out but all I get is a black screen. Seems like it switches to display something but it is just blank....

Just to be on the same page. I am starting project as

1.
Setting debugger/programmer settings like previous post

2.
Project------>
project wizard
Device: PIC16F84A
Active Toolsuite: Microchip MPASM Toolsuite
MPASM Assembler (mpasmwin.exe) v5.37
name for project file saved to desktop
add existing files to project: none
Finish

3.
set config bits as provided

4.
click the build all option under programmer

5.
launch Pickit2
load compiled .hex file and program onto erased PIC.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Tue Jun 28, 2011 11:48 pm

Well, time to debug the circuit hardware....

If you have an oscilloscope or logic analyzer you can connect it to the pins outputting the data and see if they are indeed outputting data. Furthermore, then you can check to see if they are correct VGA signals.

If you don't have access to an oscilloscope debugging will be more difficult. Use a DMM to see if voltage levels are varying on the outputs in accordance with the varying duty cycles that they have.

If you don't have access to any of these tools, debugging will be difficult, I can only suggest looking over your wiring again, programming the pic again and see what happens. Another good test is to make a simple program to turn an LED on or off and see if that program even works, this would tell you that your process for assembling and programming the PIC works.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Wed Jun 29, 2011 2:45 am

I do have a DMM so I'll see if I can maybe find the problem.

I figure it would help if I uploaded some pics of my setup. There might be an obvious problem that I don't recognize. Didn't use the PCB like in the guide, might be the problem, previous electronics projects seem to work ok without PCB. Sorry about the messy wiring. Also test monitor is a 19in Dell.

Image

Image

Image

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Wed Jun 29, 2011 4:20 pm

User032,

Thanks for sharing the pics, I stared at them for some time trying to figure out what is connected where but I'm not sure what is what in that jumble of wires. The only thing that seemed it might be missing, is the ground connection to the VGA connector.

You might consider moving to a more stable platform, like a breadboard with jumper wires. It would be easier to troubleshoot the circuit in that kind of a setup.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Thu Jun 30, 2011 3:23 am

I am familiar with an oscope, but unfortunately do not own one. By signal wires those would be the red, green, blue ones I'm thinking. These should be time varying waveforms and not constant lines (like a DC).

Checking the red green blue each with ground (pin 10 on vga) each one gave me about 2v so I'm sure I did something wrong...

A couple of questions came to mind, before I redo this project on proto-board.

Will wire length have any negative effect on the end result?
Is it ok to use a premade ac/dc adapter like I did in this project, instead of a 7805 regulator setup? I checked out the output with a DMM and it came out as 5.3v (which datasheet for PIC said was within operating voltage).

Thanks for providing these forums, it is really helpful to be able to ask the author questions about projects posted.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Thu Jun 30, 2011 5:37 am

Hi User032,

It sounds like the RGB signals are working from your 2v measurement with the DMM, but this is a crude way to check, an oscilloscope would show you the signals pulsing with time.

If you're comparing to pin 10 (ground), then it sounds like ground is working as well and connected.

Be sure to check the Hsync and Vsync signals too. It's possible you have these signals reversed? That would cause things to stop working.

[1] Wire length will not effect this system, but keep it reasonable, 1-2 meters (less than 10 feet) max, just like a VGA cable.

[2] Power for your system doesn't matter, as long as its within 4.5v - 5.5v. PIC's want +5.0v but that's not always attainable.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Thu Jun 30, 2011 6:45 pm

:D

I got it working on the proto-board this morning!

Major changes made:
-Benchtop power supply (in place of ac/dc adapter)
-different PIC to save time rather than desolder original (will test original in a bit just to see it was at fault)
-vga connector from old video card (pins 5, 6, 7, 8, 10 internally connected = bonus :wink: )

One thing I did notice was that every 2 inches or so there were vertical lines of a faded out white color. Part of normal operation maybe or something with monitor?

Here are some pics:

Image

Image

Image

Image

Image

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Thu Jun 30, 2011 10:09 pm

Sweet!

It's always rewarding when you finally get it working, especially VGA because it's so frustrating to debug without an oscilloscope.

I didn't notice fading in the monitor's colors when I tested it on quite a few different monitors, however each monitor did act a little different, probably because the PIC's VGA timing signals aren't perfect (but they're close).

Thanks for sharing all the pictures of 'success'. I really like your variable power supply too :P !!

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Thu Jun 30, 2011 11:34 pm

Yep, power supply is just too useful not to have around. :)

I managed to test out the original PIC and it works exactly the same. So it must have been a flaw in the wiring I believe.

Testing two other monitors gave me different results. (one was the same as the dell and one had the first vertical quarter black then the 3 horizontal bars of color). So it must be with timing as you mentioned. I'm pretty happy that I got it working though.

I think I'll give the pcb making process a shot, now that I got it working. I'll add in audio portion too, to make it complete and more useful in the field.

How hard would you say it would be to display actual images (like say a pic of a car)? Would this need to be done entirely in code by hand or maybe there's a image to asm code converter?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Sat Jul 02, 2011 4:34 pm

Hi User032,

If you wanted to have this PIC16F84A setup displaying an image, it would be difficult and would not come out anywhere near the way things look on your 24 or 32 bit color lcd's. That is because, in order to get different colors to show you would need a VGA Resistor DAC and even then, you'll be lucky to get 256/512 (3 bit) color with this PIC's limited I/O pins.

Along with all of that, you would have to redo the assembly for every pixel of the picture to display the static image. I have done this before, usually I made a script to scan the image and then spit out the assembly code, but it really isn't pretty and I doubt any larger images would fit onto the PIC's limited memory.

So, if this is something that interests you, try making your own 5x5 image on the screen, anywhere, with just Red/Green/Blue by modifying the existing assembly code. You'll get a better feel for how things are working in software and the level of difficulty for a small object.

user032
Newbie Pyro
Posts: 14
Joined: Sat Jun 18, 2011 1:55 am

av test box

Postby user032 » Sat Jul 02, 2011 5:42 pm

That vga resistor DAC reminds me of when I worked a bit with the altera student board in a class I took. We used vhdl code to light up leds with switches and do some basic logic (and, not, xor, etc).

I can really start to see how the code would start to pile up, pixel per pixel. :shock:

I'll see what I can do with the existing code (start out basic), like you suggested. Still it's pretty cool that I got it working. First step to better understanding ucontrollers, programming and ICSP (really useful!).

Have a good 4th of july!

foxclab01
Newbie Pyro
Posts: 2
Joined: Sun Aug 14, 2011 1:46 pm

Questions about the project...

Postby foxclab01 » Sun Aug 14, 2011 2:02 pm

Hello to all from Greece.

Pyro is fantastic and all projects are great. My knowledge is very weak, so ...please have patience!

I have 2 questions about the project :

1. It is written that if we use a faster microcontroller ( e.g. 40 Mhz ) then the analysis will rise up to 480 x 260.
Is this going to happen automatically or do we have to do something? ( for example, give some orders through the microcontroller about the numbers "480" and "260" ). Does the monitor have an internal chip that handles all this work automatically?

2. If I have a monitor that is not VGA but just RCA video ( the key word is "cheap" hehehe ), like this, and I use an adaptor like this to convert the input signal to VGA, and I do the whole project using the adaptor as the microcontroller VGA output, will it work?

Thank you in advance for your time

P.S. The forum does not let me to post the URLs :( ...but I hope you understood what I want to say.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Postby ThePyroElectro » Fri Aug 19, 2011 8:47 pm

Hi, sorry for the late response!

1. It is written that if we use a faster microcontroller ( e.g. 40 Mhz ) then the analysis will rise up to 480 x 260.
Is this going to happen automatically or do we have to do something? ( for example, give some orders through the microcontroller about the numbers "480" and "260" ). Does the monitor have an internal chip that handles all this work automatically?


It won't happen automatically. You will need to re-write the timing for the horizontal and vertical synchronizations in the VGA.

2. If I have a monitor that is not VGA but just RCA video ( the key word is "cheap" hehehe ), like this, and I use an adaptor like this to convert the input signal to VGA, and I do the whole project using the adaptor as the microcontroller VGA output, will it work?


It could work, but i doubt that it will work very well. I wouldn't recommend trying this unless someone is paying you, it sounds like a painfully large amount of work.

foxclab01
Newbie Pyro
Posts: 2
Joined: Sun Aug 14, 2011 1:46 pm

Postby foxclab01 » Fri Aug 26, 2011 10:46 pm

Thanks for your answer. Can ou give an example of these re-arrangement?


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 4 guests