VS1005 Basic Course

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

VS1005 Basic Course

Post by Panu »

This thread is for course material for VS1005 Basic Course for VLSI distributors, held in Tampere, Finland 23rd-24th of May, 2012.

Welcome to the course!
The first step is to install a new version of VSIDE, which supports VS1005. Please install it from the attached file.
Attachments
vside_win32_v211.exe
(10.92 MiB) Downloaded 1106 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Hello, World for VS1005F

Post by Panu »

Here is a Hello, World solution for running natively in the VS1005F board (without VSOS operating system).

Please extract it into your solutions folder and run it.

Edit: In project options (properties), set the "Debugging" tab's "Memory Description" to the same memory description which is in the linker tab.
Attachments
HelloVS1005F.zip
(18.21 KiB) Downloaded 940 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

VSOS Kernel 0.19 for VS1005F Developer Board

Post by Panu »

Here is the source code for the VSOS Kernel version 0.19 as a VSIDE Project.
Please download and compile the kernel with VSIDE.

If you modify the kernel, you should make a new eeprom image from the modified kernel by running a command (you can put this command into external Tools):

Code: Select all

# eeprom.img generator for VS1005F:
coff2allboot -i vs1005fspi $(TARGETPATH)/$(TARGET) eeprom.img
(for VS1005F)
Attachments
documentation_with_source_html.zip
(1.65 MiB) Downloaded 985 times
Kernel_documentation_html.zip
(1.55 MiB) Downloaded 1114 times
vsos_kernel_019.zip
VSIDE Solution for VSOS Kernel 0.19
(963.14 KiB) Downloaded 1128 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

SPI Flasher for VS1005F External Flash

Post by Panu »

Here is a VSIDE solution for promming the external SPI flash on the VS1005F developer board.

Please extract the solution to your hard drive. Then get the "eeprom.img" file from the vsos_kernel_019 folder and copy it to the spi flasher's solution folder. Then run the spi flasher solution with VSIDE.
Attachments
VS1005 Developer Board booting VSOS 0.17 from the SPI flash.
VS1005 Developer Board booting VSOS 0.17 from the SPI flash.
IMG_3270.jpg (515.38 KiB) Viewed 16551 times
vs1005-spiflasher.zip
Spi flasher for VS1005F external boot spi flash
(130.1 KiB) Downloaded 1002 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Kernel Headers for VSOS 0.19

Post by Panu »

After you have flashed the kernel into the SPI flash of your board, you can run a "Hello, World" Application on the board. You can find it in the VSIDE, in VSOS Solutions -> Hello, World application for VSOS.

Compile the application in VSIDE. It will generate an APP file named something like "MYAPP.APP" in the solution folder. rename it to INIT.APP and put it in the SD card and reset the board to load and run it.

After running the Hello, World application, you can modify it. To access more advanced features, you will need the kernel headers in the VSIDE VS1005 library folder. Here is a collection of kernel headers for the VSOS version 0.19. Please extract the files into the vside\libvs1005 folder. Overwrite any older files with the files from this package.
Attachments
headers_019.zip
VSOS Headers 0.19
(65.14 KiB) Downloaded 1670 times
User avatar
Henrik
VLSI Staff
Posts: 1311
Joined: Tue 2010-06-22 14:10

GUI Example for VS1005f / VSOS 0.19

Post by Henrik »

Here is a GUI example for VSOS 0.19 that consists of two solutions: AppLauncher and VS1005GuiExample. Please extract the files to your Solutions folder.

AppLauncher shows all .APP files on the SD memory card, then lets the user select one.

VS1005GuiExample is a work-in-progress MP3 player that plays the file S:TEST2.MP3 (on SD card) and let the user control a graphical user interface. It uses an MVC design pattern and is implemented as two threads: one for the Model, another for the View+Controller.

At the moment the code is poorly commented.
Attachments
VS1005GuiExample.zip
(2.05 MiB) Downloaded 1063 times
Good signatures never die. They just fade away.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

LCD and touchscreen test

Post by Panu »

Some LCD testing code...

Code: Select all

/* For free support for VSIDE, please visit www.vsdsp-forum.com */

// This is a starting point template for VS1005 VS0S App.

#include <vo_stdio.h>
#include <vsos.h>
#include <lcd.h>
#include <touch.h>

#define RGB(a,b,c) __RGB565RGB(c,b,a)

void main(void) {
	u_int16 myTexture[10*10];
	u_int16 i,x,y;
	printf("Hello, world!\n");

	LcdFilledRectangle(0,0,lcd0.width-1,lcd0.height-1,0,RGB(0,255,0));
	LcdFilledRectangle(10,10,lcd0.width-11,lcd0.height-11,0,RGB(0,0,255));

	for (y=0;y<10;y++){
		for (x=0; x<10; x++) {
			myTexture[y*10+x] = RGB(x*10,0,y*10);
		}
	}
	
	lcd0.textColor = RGB(255,255,80);
	lcd0.backgroundColor = RGB(0,0,255);
	lcd0.x = 20;
	lcd0.y = 20;
	printf("LCD RESOLUTION:");
	lcd0.x = 20;
	lcd0.y = 30;
	printf("Width:%d, Height:%d.",lcd0.width,lcd0.height);
	
	for (x=0; x<10; x++) {
		LcdFilledRectangle(x*10+50, 200, x*10+59, 209, myTexture, 0);
	}

	while (1) {
		if (GetTouchLocation(&x,&y)){
			LcdFilledRectangle(x,y,x,y,0,COLOR_WHITE);
		}

	}
}

/*	
	for (i=0; i<256; i++) {
	  LcdFilledRectangle(i,150,i,190,0,__RGB565RGB(i,0,0));
	}
*/
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Schematic of the VS1005F Developer Board

Post by Panu »

Schematic of the VS1005F Developer Board, version 1.5
Attachments
vs1005dev_disp10_sch.pdf
Schematics of the display daughterboard
(877.61 KiB) Downloaded 1061 times
vs1005dev15.pdf
(3.06 MiB) Downloaded 1173 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

MVC model of MP3 player in VSOS

Post by Panu »

The VSOS defines a "Model-View-Controller" (MVC) approach for writing applications on the VSOS.

In MVC, the "Model" is the part of software, which does the functionality of the application, such as MP3 decoding, signal processing and so on.

The View and Controller parts implement the user interface. They are separate from the model, so you will not need to touch the model if the user interface changes. You can for example take a ready implementation of an mp3-playermodel, which has the capability of opening files, playing, seeking, stopping and fast-forwarding. Then you can make your own user interface, which commands the model to start and stop playing.

To be able to make such an application, you don't need to know how the MP3 player functions work. You will only need to know how to send PLAY and PAUSE messages to the model.

And the best part is that if your user interface changes, or you target a completely different device, for instance a device which has just buttons instead of touch screen, you will never need to rewrite the mp3-playermodel.
Attachments
MP3-MVC.jpg
MP3-MVC.jpg (48.84 KiB) Viewed 16691 times
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

VSOS Driver Model

Post by Panu »

Here is a brief presentation about the VSOS driver model and the C object oriented approach to writing kernel code for the VSOS.
Attachments
VsOsDriverModel.pdf
(258.6 KiB) Downloaded 1752 times
Post Reply