Your browser does not allow scripts
Please click here to view a static table of contents without scripts
VNC1L Bootloader Pseudo Code
Return to Introduction  Previous page  Next page
A simplified VNC1L programming application outline is provided below, not taking account of error recovery.

A VNC1L programming application should perform the following steps:

·Initialise programmer UART with the following characteristics:  
   Baud rate: 115200
   Data bits: 8
   Stop bits: 1
   Parity:   None
   Handshaking: RTS/CTS

·Synchronise the programmer and VNC1L  
   LOOP
      Send an Echo command (0xFF)
      Wait for a response
      Read bytes available
   UNTIL   last byte received is the Echo response (0xFF)
   Send alternative Echo command (0xFA)
   LOOP
      Check for data available
      If data available, read it. Otherwise wait for data
   UNTIL    Last byte received is the Echo response (0xFA)
   If last byte received was the alternative Echo response, then synchronisation complete
   If last byte received was not the alternative Echo response, repeat synchronisation

·Set desired VNC1L Baud rate and timer value of 6000 using the Set Data Variables command  

·Set programmer UART to the same Baud rate as the VNC1L  

·Program flash from file  
   LOOP
      Read a block of data from the firmware ROM file
      Send Write Flash Block command for Count bytes (128 bytes required)
      Wait for acknowledgement (0x02)
      Write the block of data to the VNC1L
   UNTIL   the complete firmware file has been written to the Flash memory

·Verify the Flash contents  
   LOOP
      Read a block of data from the firmware ROM file
      Send the Read Flash Block command requesting Count bytes (128 bytes required)
      Wait for acknowledgement (0x02)
      Wait for Count bytes to be returned
      Compare the data from the ROM file and the Flash memory
      If they do not match, flag an error
   UNTIL   the entire firmware file has been compared to the entire Flash memory OR an error was found

·Flash programming complete