Neoxeekhrobe@gmail.com
Operating the PV SDK
First get the SDK from the Casio site. There are three different SDKs for different models of Pocket Viewer.
I have PV s600Plus.
Run the exe file and keep clicking on 'Next'. The SDK is installed by default in the C drive.
C:\CASIO\PV2EN03\SIM\Sim3022.exe
If you like, this is a good time to create a desktop shortcut of the SDK. This way you won't have to go through folders each time you want to work on it.
Before you start working with the SDK, you need a folder to place your work and to compile it.
Switch to C:\CASIO\PV2EN03\C folder and creat a New folder 'HelloWorld'.
Note: Troughout these tutorials please give extra attention to UPPERCASE and LOWERCASE characters in a word, the special characters and the brackets. A little mistake can waist alot of your time.
C:\CASIO\PV2IN03\C\HelloWorld
In the HelloWorld folder create five more folders.
Open any text editor and copy the following code and paste it in the editor.
| #include <stdrom.h> #include <string.h> #include "define.h" #include "libc.h" #include "l_libc.h" #define TouchAreaName1 0x9000 void Screen1text(); void OutputText(); TCHTBL far TouchAreaScreen1Name[] = { 30, 72, 130, 88, ACT_MAKE | ACT_MOVE_IN | ACT_MOVE_OUT | ACT_BREAK_IN, TouchAreaName1, 0x0000, 0, 0, 0, 0, switch(tsts.obj) void main() |
Save it as 'HelloWorld.c' in the C folder.
C:\CASIO\PV2EN03\C\HelloWorld\C\HelloWorld.c
Note: If you are using Windows Notepad then enclose the file name in double qoutations ("HelloWorld.c") and hit Save. This will save the file as a .c file or C code file. I will explain some of the code and the highlighted text in the next tutorial.
Open the Sample folder and copy the MAKEFILE file and the mk.bat file and paste them in the HelloWorld folder.
C:\CASIO\PV2EN03\C\Sample\MAKEFILE
C:\CASIO\PV2EN03\C\Sample\mk.bat
to
C:\CASIO\PV2EN03\C\HelloWorld\MAKEFILE
C:\CASIO\PV2EN03\C\HelloWorld\mk.bat
In the Sample folder open the MENUICON folder and copy the ICON.bmp and LICON.bmp
C:\CASIO\PV2EN03\C\Sample\MENUICON\ICON.bmp
C:\CASIO\PV2EN03\C\Sample\MENUICON\LICON.bmp
to
C:\CASIO\PV2EN03\C\HelloWorld\MENUICON\ICON.bmp
C:\CASIO\PV2EN03\C\HelloWorld\MENUICON\LICON.bmp
Open the HelloWorld folder and double click the MAKEFILE file. Open With dialogue box will appear. Click on the Notepad icon and click OK. Delete the text that has been highlighted in red and change the text highlighted in blue with the word HelloWorld.
| #Makefile for PocketViewer2 Sample
Program
include ..\COM_LNK\MakeSDK.1 ### -------- Define Make Application -------- ### #== TargetName == #== Program Name == #== ProgramVersion(EX. 0100->Ver1.00) == #== MenuIcon (Xsize=45dot,Ysize=28dot) == #== ListMenuIcon (Xsize=27dot,Ysize=20dot) == #== CompileObjectFile == #== IncludeHeaderFile == ### ----------------------------------------- ### include ..\COM_LNK\MakeSDK.2 |
Or select all the text in the MAKEFILE file and delete it and paste the following already modified text and save it.
| #Makefile for PocketViewer2 HelloWorld
Program
include ..\COM_LNK\MakeSDK.1 ### -------- Define Make Application -------- ### #== TargetName == #== Program Name == #== ProgramVersion(EX. 0100->Ver1.00) == #== MenuIcon (Xsize=45dot,Ysize=28dot) == #== ListMenuIcon (Xsize=27dot,Ysize=20dot) == #== CompileObjectFile == ### ----------------------------------------- ### include ..\COM_LNK\MakeSDK.2 |
Now go back to the HelloWorld folder and copy every file and folder execpt for the C and the 0Tamplate folder into the Tamplate folder.

Open the HelloWorld folder and double click on the mk.bat file. Dos window will appear and you will see the following message.
Anything else, which you won't get since you did what I told you to do, means there is some thing wrong with the code or may be you are using the wrong SDK.
After compilation there will be addition of files in the HelloWorld folder. Don't worry about them. Move one level up in the folder tree and look for the Bin folder in the C folder.
C:\CASIO\PV2EN03\C\Bin
Open the BIN folder and there you will see four .bin files. The HelloWorld.bin is your first compiled PV programme.
Congratulations. You are know a real PV programmer/hacker.
; )
Click on the shortcut icon on the desktop of Sim3022.exe to start it. Click
the
open button and select one of the .cpj files in the Selecting Loading Project
File window. Chose the file that has the same number as the number of your
PV model or the closest one. For example I own PV s600plus, the options I
had were PVS460.cpj and PVS660.cpj. I selected PVS660.cpj since 660 is closer
to 600 than 460.
Alot of small windows will open and with them you can see a copy of your PV's simulator.
The Pocket Viewer's Simulator
Open the Project menu in the menu bar and select Configuration.

The Hardware Configuration window appears. Click on the Chips tab and search the CS5 chip. Right click on the Sample ROM and select Properties.

In the Chip File Property window remove Sample in the Chip Caption text field and enter HelloWorld. Click the Browse button for the Chip Filename to open the Bin directory and select the HelloWorld.bin file.
C:\CASIO\PV2EN03\C\BIN\HelloWorld.bin
Make sure that the Load Offset Address is 00140000.

Tap on the four crosses in the corners of the Simulator's screen. Tap on OK - on YES - on YES - on SET buttons. The Tools window appears. Note how fast the time is moving. Tap on MENU and then on the down button to move down one screen. Tap on the HelloWorld icon. Tap on the Click Here! button. The programme shows the text "Congratulations!! You have created Your first PV HelloWorld program" and then exits to the main menu.

To Stop the Simulator click the Abort
button or press the ESC key. Click OK. Click on the Close
button and then click the YES button. Now you can close the SDK safely.
If you get errors in your programme the best way to handle them is to make changes one at a time. Most of the times correcting one mistake will automatically correct many other that were occuring due to the error that you corrected. To recompile you have to delete all the additional files that appear in the HelloWorld folder after you first compiled. Thats a bit irritating. You have to go manually in each subdirectory and delete the unwanted files. For this particular reason I asked you to create the 0Template folder.
What you need to do is that after you are done with changing the code safe the .c file in the C folder. If you want to make a new programme, the .c file of the previous programe save it some where in the D: drive and start a new .txt filem, enter the code and save that new file as a HelloWorld.c in the C folder. Then delete everything in the HelloWorld folder except for the C and the 0Template folders. Now open the 0Template folder and copy everything in it. Come back one level up in the HelloWorld folder and paste everything in it.
While you are learning to programme for the PV, either you want to change the code or want to make a new programme, follow the steps mentioned in the previous para and it will safe you alot of time and energy which will result in a less frustrated and more peaceful you.
Happy programming.