AnnexRDS Getting Started Guide
(for the ESP32S3 – S3V Zushi)

AnnexRDS is an advanced IDE that utilizes the BASIC language for application programming. All coding is done over the air (OTA) via a web browser. The S3V Zushi supports an extensive range of AnnexRDS capabilities, including VGA output, USB input devices and I2S Audio. In this getting started guide we will work through the process of setting up your 3SV board to work with AnnexRDS.

Part I: Uploading AnnexRDS Firmware to your S3V Zushi

1) Connect the S3V Zushi to your computer (e.g., your PC) using a USB-C cable.

2) Ensure the slider switch on the Zushi is set to PRG (not USB). The initial setup of AnnexRDS on an S3V requires a direct connection to the PC. All subsequent programming and setup can be performed via the web interface on the S3V Zushi.

3) Press the [BOOT] button on the S3V, and while continuing to press the [BOOT] button down, simultaneously press and release the [RESET] button. This will put your S3V Zushi board into bootloader mode.

4) On your PC open this link in a browser: https://cicciocb.com/.

5) Click [Web Installer].

6) In your web browser click [Connect].

7) Select your board. Your S3V board will be indicated as USB JTAG/serial debug unit (COM18), though the exact naming of the identified board and the specific COM port information may be different depending on your operating system and how it identifies serial devices. Select the correct Flash size for your S3V board. This is typically either 8MB or 16MB.

8) Click [Connect].

9) Click the [Set Config] button.

10) The Configuration Form enables setting a range of Wi-Fi settings and also the Time Zone information. These settings can be changed later in the web interface or through AnnexRDS Basic commands. The parameters for this are described in the comprehensive AnnexRDS help system.

11) In the Configuration Form enter ZUSHIBRD_1 as the Access Point Name. Feel free to change the AP name as required for your specific scenario.

12) Click [Save].

13) Click [Select Firmware].

14) Select DMT_LVGL_HID_OTG_ATS_2.99.27_qio_opi.bin.

15) Ensure all of the [Write] options are checked.

Note: Updated versions of AnnexRDS may be made available from time to time. However, you must ensure that you do not attempt to install a version of the AnnexRDS ESP32S3 firmware that exceeds the Flash storage capacity of the S3V board. AnnexRDS will warn you if you attempt to do this.

16) Click [Program].

17) The firmware programming process will be displayed in the Console. Allow sufficient to for this to complete (approximately one minute). The message waiting for download will be displayed when the process is successfully completed.

18) Click the [Close] button.

19) Power Cycle or press the [RESET] button on your S3V Zushi. It will take a minute or two for the S3V Zushi to reboot into the AnnexRDS environment and present itself as a Wi-Fi Access Point (AP).

20) In your Wi-Fi setting connect to the ZUSHIBRD_1 AP on your computer.

21) Close the Web Installer window in your browser.

22) Create a new browser window on your computer and enter the following URL: 196.168.4.1. If everything was setup correctly you will be presented with the AnnexRDS programming interface. If not repeat the steps above until you have successfully flashed the Zushi.

Note: It is possible to change the IP for the Zushi AP service in the Configuration Form. You may need to change the IP address if it conflicts with your existing network address (e.g., your router). Make sure that you record the IP address you use.

Part II: Configuring AnnexRDS for your S3V Zushi

1) In the S3V Zushi’s web interface Click the [Config] Button.

2) In the Config panel set the Module to CUSTOM.

3) In the Config panel set TFT Display to VGA_CUSTOM.

Note: The Config panel has a drop down option for enabling the use of an SD Card (Enabled/Disabled) on your S3V Zushi. It is important to note that AnnexRDS will run/save files either off the ESP32S3’s FLASH storage or off an SD Card (assuming it is installed and enabled). But, this support is either/or, not both. If you have a FAT/FAT32 formatted SD Card you can now put this in the SD Card socket on your S3V. You will also want to enable SD Card support in the Config Panel.

4) Click [SAVE].

5) Click the [Advanced] button.

6) Enter the correct pin numbers as indicated on the image below. You can enter the SD card pins (MOSI, MISO, SCLK and CS for SD CARD) even if you do not currently have an SD card installed.

7) Click [Save].

8) Back in the Config panel, click [Reboot]. Allow a minute or two for the S3V Zushi to reboot, and then repeat steps 20-22 in Part I. If you have successfully connected to the S3V Zushi you will see a green indicator for the OUTPUT PAGE Connection.

9) Click [Editor].

Part III: Setting up your S3V Zushi for VGA

1) We are now going to setup the VGA output for the S3V Zushi. Please ensure you have connected the Zushi to a VGA monitor using a standard VGA cable. You can also use a VGA to HDMI adapter. Instructions on converting VGA to HDMI are in our FAQ.

2) In general you will want to set your S3V Zushi to a VGA resolution of 640X480. This is the most consistently compatible resolution for computer monitors and televisions. Please note that AnnexRDS only supports 8 bit VGA at this time. This means that the EXPANDER port on your S3V Zushi can be used for other purposes (e.g., for BZMods). If you are going to be using AnnexRDS exclusively please remove all of the jumpers in the Expander [E] and put these away for safe keeping!

3) There are some steps required to set the S3V Zushi up for VGA output. In the Editor’s Immediate window please enter (or cut/paste) the following command: option.vgamode 16, 96, 48, 640, 10, 2, 33, 480, 25175000 and then press [Enter] on your keyboard.

Note: We have also had some success with 800×600 (computer monitors only). The option.vgamode command for that resolution is: option.vgamode 24, 72, 128, 800, 10, 2, 10, 600, 3600000

4) In the same Immediate window type reboot and press enter. This will force the S3V Zushi to reboot.

5) You should also see the blue AnnexRDS “Bee” Screen on your VGA device. If there no splash screen on your monitor verify your VGA connection and repeat steps 3-4 above. Once the VGA mode is setup on the S3V Zushi it does not have to be modified unless you need to change resolutions.

6) Reconnect to the code editor (step 20-22 in part II).

Part IV: Blink Sketch for S3V Zushi

We are now going to test the blink LED on the S3V Zushi. Please enter the following code in the code editor. The press the [Run] button. The LED on your S3V Zushi should now blink.

' AnnexRDS Blink Example for S3V Zushi
' Blink the S3V LED (GPIO47)
led = 47
pin.mode led, output

for z = 0 to 1000
  pin(led) = 1 - pin(led)  
  pause 500                
next z
end

Part V: VGA, Sound and USB Device Example for S3V Zushi

The next code example demonstrates a simple VGA example with sound playback and USB device (mouse) support. AnnexRDS also supports Joysticks and Keyboard (including some combination Bluetooth keyboards) via its HID Interface Library.

For this demo please connect a USB mouse to your S3V Zushi (USB-A). The .BAS file can be downloaded here.

This is example includes the use of Lovyan GFX Commands (TFT) and the GUI Objects Library. For even more sophisticated graphics projects please explore the LVGL examples in the AnnexRDS Help File.

' Set the Blink LED To On. 
PIN.MODE 47, OUTPUT
PIN(47) = 1

' Play MP3
' Configure for I2S audio output using I2S DAC
PLAY.SETUP 1,8
PLAY.VOLUME(100)
PLAY.MP3 "/test.mp3"

WLOG "Blink LED"
TFT.INIT

' Not Strictly Required as S3V Conforms to Annex Default 8Bit VGA Pins 
OPTION.VGAPINOUT 6,7,8, 12,13,14, 18, 21, 1,2

' Example of Timed Code
' timer0 1000, Other_task

' Setup USB Support (Mouse)
USB.SETUP TFT.WIDTH, TFT.HEIGHT
' Add Event Handlers for the Mouse
onMouseMove mouse_move
onMouseClick mouse_click

 'TFT screen size
' Define the Resolution of the Screen     
xres=640: yres=480    

' Set the initial Mouse Cordinates 
mouseX = 0
mouseY = 0

' Initialize variables
x = 0
y = 0
oldx = 0
oldy = 0

' Size and Color Selection 
dia=20 
mousecolour=tft.rgb(255,255,255)  'set dot size and colour
bgcolour = tft.color(BLACK)
bordercolour=tft.rgb(255,255,255)

' Clear the display initially
tft.fill bgcolour
' Create a Rectangle for the Screen
tft.rect 2,2,638,458,bordercolour

gui.init 2, black
gui.autorefresh(2)
WLOG "hello"

txt_x = GUI.Textline(2,460,100,20, "x:", 2)  'x,y,w,h,text,fontsize
txt_y = GUI.Textline(104,460,100,20, "y:", 2)  'x,y,w,h,text,fontsize

' This code draws the pointer on the screen and updates the mouseX and Y values
While 1'

   ' Refresh the Border
   tft.rect 2,2,638,458, bordercolour
   
  ' Obtain the Mouse Position
  x = mouseX
  y = mouseY
    ' Display the Mouse Position
  Gui.SetText txt_x, STR$(mouseX)
  Gui.SetText txt_y, STR$(mouseY)
  
  ' Check for A Screen Overun (Y Axis)  
  if (y >= 440) then
  y = 440
  end if
  if (y <=15) then
  y=15
  end if 
  if (x >620) then
  x = 620
  end if 
  if (x<20) then
  x = 20 
  end if 
  
  ' Draw the New Location and Clear to Old Location
  if (x > 0) AND (y > 0) then
  if (x <> oldx) OR (y <> oldy) then
    
 ' Erase the old target 
  tft.line oldx-10,oldy, oldx+10, oldy, bgcolour
  tft.line oldx,oldy-10,oldx,oldy+10, bgcolour
  
  endif
  
  ' Draw the new target
  tft.line x-10,y, x+10, y, mousecolour
  tft.line x,y-10,x,y+10, mousecolour
  endif

   oldx = x
   oldy = y
    
  wend
 end
 
Other_task:
' Can Put Timed Code in This Sub
return
  
Mouse_move:
WLOG  mouseX, mouseY, mouseZ
return

Mouse_click:
WLOG "Mouse Click"
mousecolour = TFT.COLOR(RED)
return 

' Can Add Events for Keyboards and Joysticks
    
    
 Save as PDF

BrainBoardzTM and Plug and CodeTM 
are Trademarks of BrainBoardz Inc. © Copyright, 2021