PIC İLE VGA MONİTORDA NASILYAZI YAZILIR?

muratmert4

Usta Üye
Katılım
26 Eyl 2007
Mesajlar
1,107
Puanları
156
Yaş
50
Konum
ANTALYA
S.A.
Pic ile monitorda yazı yazmakla ilgili nette baya araştırmalar yaptım ama tam verimli sonuçlar alamadım. Şemalar var yazılımlar ya asm yada yok. Elinde dökümanı olan yada bilgisi olan benim alnlayacağım şekilde bilgisini paylaşırsa sevinirim.
Programlama olarak CCS C kullanıyorum.Kolay gelsin.
 
Ben pic ile vga monitör konusuyla ilgilenmedim ama asm kodları çözemiyorsanız bu konuda 2 hafta sonra yardımcı olmaya çalışırım, bu 2 hafta sınavlarım var belki kısa kısa biraz yardımım olabilir ama sonrasında yardımım olacağına inanıyorum. Beğendiğiniz asm kodlaı paylaşın biraz bakalım oluru varmı diye.
 
Nette bir proje buldum. Ancak proje sahibi sadece HEX kodunu paylaşmış.

HEX dosyasını, OshonSoft PIC18 Simulator IDE 2.55 ile LIST dosyasına çevirdim.
Yani ASM hali, sanırım daha iyi anlaşılır.

Ayrıca aşağıdaki bağlantıda bir konu var.

Tüm sayfalarını inceleyebilirsin.
PIC micro drives VGA monitor


EasyPIC6 Project 3. PIC drives VGA monitor at 10 Megapixels/sec

What is it?
This is a test of generating VGA to directly drive a PC monitor from a cheap PIC. The 10 MIPS PIC is pushed near its limits doing this, the video data itself is generated by the PIC SPI module at 10 Megapixel/sec and is sent out RC5.

ep6p3_vga.jpg


It generates text of 27 chars x 16 lines, the VGA monitor is operated at 640x480 at 60Hz. Actual pixels at 10 Megapixels/second is 251 horiz pixels (243 are used), and vertical pixels are drawn double to give 240 scan lines. Text chars are 8x12 pixels. Each line of text is 12 pixel lines of the characters and 3 pixel lines (6 scan lines) black, which can be used as processing time.

The colour is done by a simple DAC. Three pins on PORTD are used as "colour killers" and are toggled between high impedance and LOW which kills the RED, GREEN or BLUE respectively. They are independent of the luminance data that comes from RC5. Colour control is done before each scan line so the entire scan line must be drawn in the same colour. The colour was crudely sequenced by text line number, using 3 resistors as a crude 3-bit DAC. so each text line is drawn in a different colour (8 colours total). In proper use any text line could be drawn in any colour

ep6p3_vga2.jpg


This project turned out to be a lot more work than I expected! It didn't take long to get a rock solid Hsync and Vsync coded up, and to get something displayed on screen. But to get wall to wall text across the screen ties up every bit of the 25uS scan line (that is only 250 PIC instructions!) so all line processing etc has to be done in the Hsync pulse, a very full 38 PIC instruction period that must have zero jitter on both edges of the sync pulse.

There is very little time for decoding text from character bytes to 12 bytes of pixel data and writing these to "video RAM" which is 12 simple blocks of RAM that can be "played" by the SPI module as the 25uS scan line occurs. I had to use lots of inline assembler pieces and some assembler jump tables and the code is pretty messy but it works. The clock is working as a demo but I haven't bothered implementing clock set buttons. The next step to make this useful as a text display device would be do hand code another 15 assembler chunks that decode character RAM data to the video RAM buffer so it can display 16 different lines of text, as at the moment it only decodes and displays one line of text repeated down the screen. It is a simple enough job but will require cut and pasting hundreds of lines of assembler and re-numerating into 16 variations so it will have to be a job for some other time...

Anyway for proof of concept it works, the PIC SPI module can output pixels at 10 Megapixels / second with the PIC running at 10 MIPS. One problem I discovered was that the SPI module needs an extra PIC instruction every byte, so it always takes 9 clocks to send 8 pixels. For text use this is ok because I just used a 8 pixel wide font, and the blank pixel is between every text character. Obviously for a graphics display this would be a problem. I've heard that the SPI module has been updated on some of the newer PICs and they might not have this issue.

ep6p3_schem.gif


The hardware is very simple. It only needs 3 resistors and some wires to a standard 15pin VGA connector. The pinout can be seen on the schematic above. Actually if you don't want the colour ability you can leave out the 3 resistors and ignore PORTD altogether, and just connect RC5 direct to one of the R G B pins for the very simplest wiring.

ep6p3_wires.jpg


With more resistors the "DAC" would have more bits and give much finer control of the text colour or even the background colour.

Finishing it? I'd like to finish this up one rainy day as it would be handy to have 27x16 text VGA display using a cheap PIC like a 18F252 or 18F2520 etc. For the moment I won't release source code because it is big and messy but I have provided the .HEX file if anyone wants to replicate my VGA technicolour clock that has no clock set buttons. ;) It should work fine ony any of the EasyPIC dev boards (or a breadboard) as it just needs some simple connections to PORTC and PORTD.

Download HEX File
 
Bir tane daha proje buldum.
PIC18F4620 ile mikroC kullanılarak geliştirilmiş.
Epey bir işini görür sanırım.
PIC PAL Video Library - Ucontrol

Aşağıdaki bağlantıda da;
PIC18F252 ile ASM kullanılarak geliştirilmiş,
PIC16F88 ile de C kullanılarak geliştirilmiş iki ayrı proje var.
VGA-Terminal

Ayrıca şu sitelere de, ayrıntılı bir şekilde bakmanı öneririm:
Rickard's electronic projects page
PIC-Tock

Yine aşağıda ASM ile geliştirilmiş örnekler mevcut:
Video2
 
Bir tane daha proje buldum.
PIC18F4620 ile mikroC kullanılarak geliştirilmiş.
Epey bir işini görür sanırım.
PIC PAL Video Library - Ucontrol

Aşağıdaki bağlantıda da;
PIC18F252 ile ASM kullanılarak geliştirilmiş,
PIC16F88 ile de C kullanılarak geliştirilmiş iki ayrı proje var.
VGA-Terminal

Ayrıca şu sitelere de, ayrıntılı bir şekilde bakmanı öneririm:
Rickard's electronic projects page
PIC-Tock

Yine aşağıda ASM ile geliştirilmiş örnekler mevcut:
Video2


S.A.
Sn. Arkadaşım ben bulinklerin çoğuna baktım asm tabanlı olduğu için hiç birşey anlamadım. en çokta bunu beğenmiştim:

VGA-terminal with PIC18 [PIC24]

Ama onunda yarısı asm bir kısmı basic. Benimde yapmak istediğim bunun gibi birşey ayrı bir pic kullanarak monitoru lcd-glcd gibi kullanmak. saygılar kolay gelsin.
 
S.A.
Sn. Arkadaşım asm yerine yanlışlıkla basic yazmışım özür dilerim. :)
 
Estağfurullah.
 

Yeni mesajlar

Forum istatistikleri

Konular
129,676
Mesajlar
928,940
Kullanıcılar
452,378
Son üye
volkanozt58

Yeni konular

Geri
Üst