Olimex Support Forum

DUINO => SHIELDS => Topic started by: Rado on April 26, 2023, 04:58:13 PM

Title: MOD-VGA-32MB library not work
Post by: Rado on April 26, 2023, 04:58:13 PM
Hello everyone  :)

I've just bought MOD-VGA-32MB shield and tried to start some examples from Gameduino library, but only result is random moving figures on VGA display

(G:%5CMOD-VGA-32MB%5Cvga1.jpg)

I tried different libraries with the same result.

I use Arduino Uno with resistor divider 5.1K / 10K for PIN 10, 11, 13 and power up shiled form Arduino's 3.3V pin

Normally, the shield works -I tested it with:

digitalWrite(9, LOW); 
  SPI.transfer(0x80);
  SPI.transfer(0x00);   
  SPI.transfer(0x41);             
  digitalWrite(9, HIGH);             

and see letter 'A' on the upper left corner on the monitor, so the wiring should be OK

Any ideas what to try to solve the problem?
Title: Re: MOD-VGA-32MB library not work
Post by: Rado on April 27, 2023, 11:22:03 AM
I done some research in GD.cpp and skip some rows about SPI

void GDClass::begin(int pin)
{
  delay(250); // give Gameduino time to boot
  GD_SEL_PIN = pin;
  pinMode(GD_SEL_PIN, OUTPUT);
#ifdef BOARD_maple
  SPI.begin(SPI_4_5MHZ, MSBFIRST, 0);
#else
  SPI.begin();
  //SPI.setClockDivider(SPI_CLOCK_DIV2);
  SPI.setBitOrder(MSBFIRST);
  //SPI.setDataMode(SPI_MODE0);
  //SPSR = (1 << SPI2X);
#endif

and the board start working with all examples  :)
Title: Re: MOD-VGA-32MB library not work
Post by: LubOlimex on April 27, 2023, 01:03:09 PM
Good that you level shifted the pins to 3.3V.

Did you run the selftest demo as recommended by the README.txt, first try the library linked at the product page, refer to the README.txt if you haven't already:

https://www.olimex.com/Products/Modules/Video/MOD-VGA/resources/Gameduino_library.zip

Edit: thanks for update glad you figured it out.
Title: Re: MOD-VGA-32MB library not work
Post by: Rado on April 27, 2023, 03:03:08 PM
I've just downloaded library form your link and tried selftest but with the same result (some mess on the screen). After comment the same lines for SPI, I had workin example. All tests PASS, only test_flash: FAIL