The VGA 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 » Sun Jun 29, 2008 9:09 am

intro.inc is something I created. It's what displays the 'Ready' message. I uploaded it here:

http://www.pyroelectro.com/projects/vga ... /intro.zip

I'll answer your other questions a little later tomorrow. :D

coutinhoware
Newbie Pyro
Posts: 7
Joined: Sat Jun 28, 2008 3:15 pm

Postby coutinhoware » Sun Jun 29, 2008 12:59 pm

ok. so then answer me this too:

why the header file indicates p18f4520??? weren't we supposed to use PIC18F452??

and other. the signal for R, G and B comes out from which port? I mean, the wire that goes to the SPTT switch comes out from which port?

Regards.

coutinhoware
Newbie Pyro
Posts: 7
Joined: Sat Jun 28, 2008 3:15 pm

Postby coutinhoware » Sun Jun 29, 2008 2:24 pm

one more thing:

my project does not work, I'm afraid because I must show it up tomorrow at school.

I've connected all pins, and was getting base at the schematic, but later I found out it was wrong. So I started to follow the pictures. But there are some pins I just can't notice where to connect! The video doesn't show it accurately. For example, there are two orange wires connected in ground, with two wrapping wires coming out of them, but I can't see where they're goin' to. If I just could get the right schematic or somethin' else. :cry:

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

Postby ThePyroElectro » Sun Jun 29, 2008 6:53 pm

coutinhoware wrote:ok. so then answer me this too:

why the header file indicates p18f4520??? weren't we supposed to use PIC18F452??

and other. the signal for R, G and B comes out from which port? I mean, the wire that goes to the SPTT switch comes out from which port?

Regards.


The PIC18F452 and PIC18f4520 are identical. If you are using 18F452, then use the 18F452 header, if you are using 18F4520 then use the 18F4520 header file.

Code: Select all

blank:   macro
   bcf     PORTB, 1
   endm
point:   macro
   bsf     PORTB, 1
   endm


According to the code (not my messed up schematic) PortB pin 1 is the output signal to the RGB SPTT.

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

Postby ThePyroElectro » Sun Jun 29, 2008 6:58 pm

coutinhoware wrote:one more thing:

my project does not work, I'm afraid because I must show it up tomorrow at school.

I've connected all pins, and was getting base at the schematic, but later I found out it was wrong. So I started to follow the pictures. But there are some pins I just can't notice where to connect! The video doesn't show it accurately. For example, there are two orange wires connected in ground, with two wrapping wires coming out of them, but I can't see where they're goin' to. If I just could get the right schematic or somethin' else. :cry:

Well, if you can go through and understand the code, you can see the hardware pins that are used. I messed up when drawing the schematic but I kept it because the general idea of the project is displayed through it.

According to the code here are the hardware pins used & purpose:

Code: Select all

PORTB Pin 1 - RGB signal

PortB Pin 3 - Horizontal Sync
PortB Pin 4 - Vertical Sync

PortD Pin 0 - X Switch
PortD Pin 1 - Square Switch
PortD Pin 2 - Circle Switch
PortD Pin 3 - Triangle Switch


This should clear things up. Good luck! :D

coutinhoware
Newbie Pyro
Posts: 7
Joined: Sat Jun 28, 2008 3:15 pm

Postby coutinhoware » Mon Jun 30, 2008 2:46 am

right! I got it!

but, the last thing (I swear): where should I connect the ground wire at the SPTT switch?

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

Postby ThePyroElectro » Mon Jun 30, 2008 5:35 am

There should be no ground connection to the 3-way -- SPTT switch. It is used for switching between Red, Green & Blue colors via the mechanical switch. The video signal is sent from the PIC to one of the 3 color options (..whichever the mechanical switch is currently in contact with).

Let me know how it works out for you. :)

coutinhoware
Newbie Pyro
Posts: 7
Joined: Sat Jun 28, 2008 3:15 pm

Postby coutinhoware » Mon Jun 30, 2008 5:55 am

right, understood.

I tried here at home and it finally showed up "READY" in the screen. But when I press down PORTD buttons, "READY" simply vanishes and nothing is showed up. Could it be any software problem?

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

Postby ThePyroElectro » Mon Jun 30, 2008 6:16 am

Honestly, it could be any number of problems.... :shock:

My first guess would be that you're using a pushbutton and not a switch?
Debugging hardware issues via a forum is never easy :P .

I'm glad something is working though!

coutinhoware
Newbie Pyro
Posts: 7
Joined: Sat Jun 28, 2008 3:15 pm

Postby coutinhoware » Mon Jun 30, 2008 6:30 am

yes, maybe that's the problem. I'll drpo by the shop tomorrow to do buy the switches, then (I'm a jerk ¬_¬).

and tell me something: in which monitors could it work? I tried at one Philips here at home and it did not work, only in my LG LCD and my LCD TV. Is it related to H and V frequency?? Is there a way we can change it for a higher ou lower frequency??

Thanks Chris.

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

Postby ThePyroElectro » Mon Jun 30, 2008 11:35 pm

The code I developed using 4 MHz has a very, very low probability of working with LCDs. It is meant to be used with CRT monitors.

Since the device operates at such a low frequency meeting the timing constraints of VGA is near impossible, so this project hinges on the fact that CRTs are still completely analog and therefore more forgiving when it comes to timing.

I have more tutorials on generating true vga signals, whatever that means. They use the altera UP1 board with a 25.175MHz clock (but that is also FPGA/CPLD and not Microcontroller).

coutinhoware
Newbie Pyro
Posts: 7
Joined: Sat Jun 28, 2008 3:15 pm

Postby coutinhoware » Tue Jul 01, 2008 12:47 am

oh well... I tried in many CRTs and it didn't work, as I said, only in my LCDs, couldn't it be related to the monitors frequency??

Today I presented the work and took a A+ 8)

I really enjoyed to work with vga, and maybe I get to study it more deeply.

Thanks for your time and your support, Chris.
:D

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

Postby ThePyroElectro » Tue Jul 01, 2008 4:32 pm

Awesome!

I find it strange it didn't work on CRTs as that's what I'd designed it for. It is definitely related to the monitors frequency. Everything was designed for 60Hz vertical refresh.

Again, I would never use a 4 MHz clock for generating VGA ever again. The project was sort of a proof of concept to myself. The VHDL VGA methods I put in the tutorials section:
:arrow: http://www.pyroelectro.com/tutorials/vh ... index.html
:arrow: http://www.pyroelectro.com/tutorials/ch ... index.html

show much more viable methods for creating quick, easy & proper VGA signals that any device will display correctly. If you do venture on with studying VGA I'd suggest going that route. VHDL/FPGA allow you to control everything that is happening every clock cycle.

danic
Newbie Pyro
Posts: 1
Joined: Thu Jul 17, 2008 12:27 am

Postby danic » Thu Jul 17, 2008 12:33 am

hi, i've been working on a project like this one but instead of using a 4mhz crystal, I am using a 25.175 mhz on a PIC 16f628A. I know the maximum frequency of this pic is 20 mhz, but it is suppose to work at higher frequency and ive made some test and it worked good. I have all the exact vga timing but the monitor wont show up anything. Can I send the code to you so you can look a it and see if there is something wrong with my code?

Thank you very much

Danic

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

Postby ThePyroElectro » Thu Jul 17, 2008 1:06 am

Hi,

You're welcome to e-mail/pm me the code, however please include the timing diagrams or any timing information that you worked out for your specific project.


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 3 guests