2:1 Vga

15 Dec 2012

sanwal muneer wrote:

would it work for reading files frm local file system?

If it works for one file why would it not work for more ? The only restriction is the amount of storage space on the local filesystem (2 Megabyte).

During the tests I did with VGA and the local filesystem I noticed that the screen output stops or gets corrupted so I used a SD card for storage and that works perfect and I have a lot more space.

15 Dec 2012

Gert van der Knokke wrote:

sanwal muneer wrote:

would it work for reading files frm local file system?

If it works for one file why would it not work for more ? The only restriction is the amount of storage space on the local filesystem (2 Megabyte).

During the tests I did with VGA and the local filesystem I noticed that the screen output stops or gets corrupted so I used a SD card for storage and that works perfect and I have a lot more space.

can you put your code here for reading pixels from sd card and displaying them on vga?

16 Dec 2012

when i merge the two libraries of sdcard and vga then it gives compilation error. how did you do it?

16 Dec 2012

vga stops working when i read values from xbee. in a single programm one of them works at a time.i need both of them like reading data from xbee and displayin it on vga. any solutions?

16 Dec 2012

Hi Sanwal,

Does your Xbee routine use interrupts ? If I recall correctly it uses an uart to communicate with the mbed. You could try to init VGA first and then the Xbee routines, the VGA library also changes the system clock frequency from 96 to 100 MHz, it should not be a problem for the uart functions as it is only 4% difference.

Another cause could be that the Xbee routines interfere with the IO port settings. The VGA library is highly critical concerning timing, it uses interrupts and DMA to a strict schedule to display each line right on time.

Without analysing the Xbee routines I can not say what is causing this.

16 Dec 2012

By the way: I used the SDHC filesystem in my projects and it works OK with the VGA libs

16 Dec 2012

Gert van der Knokke wrote:

Hi Sanwal,

Does your Xbee routine use interrupts ? If I recall correctly it uses an uart to communicate with the mbed. You could try to init VGA first and then the Xbee routines, the VGA library also changes the system clock frequency from 96 to 100 MHz, it should not be a problem for the uart functions as it is only 4% difference.

Another cause could be that the Xbee routines interfere with the IO port settings. The VGA library is highly critical concerning timing, it uses interrupts and DMA to a strict schedule to display each line right on time.

Without analysing the Xbee routines I can not say what is causing this.

even if i use a delay of one mili second bto initialize the xbee before init_vga. it does not work.

16 Dec 2012

sanwal muneer wrote:

Gert van der Knokke wrote:

Hi Sanwal,

Does your Xbee routine use interrupts ? If I recall correctly it uses an uart to communicate with the mbed. You could try to init VGA first and then the Xbee routines, the VGA library also changes the system clock frequency from 96 to 100 MHz, it should not be a problem for the uart functions as it is only 4% difference.

Another cause could be that the Xbee routines interfere with the IO port settings. The VGA library is highly critical concerning timing, it uses interrupts and DMA to a strict schedule to display each line right on time.

Without analysing the Xbee routines I can not say what is causing this.

even if i use a delay of one mili second bto initialize the xbee before init_vga. it does not work.

/*
 * 640x480 60Hz fullgraphic monochrome VGA Driver demo program
 *
 * Copyright (C) 2011 by Ivo van Poorten <ivop(at)euronet.nl>
 * and Gert van der Knokke <gertk(at)xs4all.nl>
 * This file is licensed under the terms of the GNU Lesser
 * General Public License, version 3.
 *
 * Inspired by Simon's (not Ford) Cookbook entry and Cliff Biffle's
 * assembly code.
 */
 
#include "mbed.h"
#include "vga640x480g.h"
Serial xbee1(p9, p10);
DigitalOut rst1(p11);

// visual feedback
DigitalOut myled(LED1);
DigitalOut myled1(LED2);
void vga(void)
{
myled1=1;
init_vga();
wait(0.001);

    int s,t;

    // serial port on at 115200 baud
    //linktopc.baud(115200);
    setbuf(stdout, NULL); // no buffering for this filehandle
    
    
    // clear the screen
    vga_cls();
    
    // draw some circles
    for (t=10; t<200; t+=5)
    {
    vga_circle(20+t,399-t,t,WHITE);
    wait(0.04);
    }
    myled1=0;

    // draw some boxes
    for (t=10; t<100; t+=5)
    vga_box(400+t,100+t,400+t*2,100+t*2,WHITE);
  
    // circumfence the screen
    vga_box(0,0,639,479,WHITE);
    
    // show the complete character set
    for (s=0; s<4; s++) {
        for (t=0; t<64; t++) {
            vga_putchar(20+t*8,20+16*s,t+s*64,WHITE);
        }
    }

    // put a string on screen
    vga_putstring(400,370,"Hello World!",WHITE);
    myled1=0;

    // draw some lines
    vga_line(400,390,500,390,WHITE);
    vga_line(500,475,600,375,WHITE);

    // draw a filled box
    vga_filledbox(450,330,550,360,1);

    // draw some more boxes
    for (t=10; t<320; t+=5)
    vga_box(100+t,440-t/16,110+t,440+t/16,WHITE);
    myled1=1;
}

// visual feedback
//DigitalOut myled(LED1);

// define serial port for debug
Serial linktopc(USBTX,USBRX);

int main() {
wait(0.001);
vga();


rst1 = 0;   //Set reset pin to 0
   myled = 0;
   myled1= 1;
  wait_ms(1);
   rst1 = 1;   //Set reset pin to 1
   wait_ms(1);
    unsigned char buff[2000];
    // init the VGA subsystem (always do this first!)
    
    
    
    // all done
    while (1){
         wait(1);
       myled=!myled;
    }
 }
16 Dec 2012

Gert van der Knokke wrote:

By the way: I used the SDHC filesystem in my projects and it works OK with the VGA libs

i merged ur libraray with sdhc file system and it says mbed.debug is missing. do you have any sample program for that??

16 Dec 2012

u mentioned all the peripherals get off after the init_vga signal . so how can i use xbee after that?

29 Nov 2013

how can i make the black colour box of 640x480 on VGA???? and how i can link it with mbed??