No announcement yet.

Can I bypass the Checksums

  • Filter
  • Time
  • Show
Clear All
new posts

  • Can I bypass the Checksums

    Greetings all,

    First kudos to the folks that have rewrote the Serial Firmware for the LCD displays; the new firmware has allowed me to up my serial speeds without intermittent lockups with my Nano processors from Basic Micro which brings great joy!

    Also the GTX Utility really helped me with my code generation tonight also; great job on the GTX Utility too!

    Also please provide more info on byte level commands as not all of us are using the libraries and need to have the info for data sent and data received; too many of the App Notes are geared to Ards and RaspberryPi.

    Actual Question Here:
    But right now I would like to say that the CHECKSUM used by the Visi-Genie is killing me! Is there a way to configure the firmware/PMMC to not have to send a CHECKSUM based on the commands (I know there is a tech issue why you want to include checksums but now I've got to add code using some XOR commands that don't seem to be working as expected and now I'm frustrated again...all I want to see is my thermometer level rise from data sent from my Nano-18).

    Thanks and good job on great improvements on the Serial part of your displays and the Visi-Genie may help me with a few quick projects.


  • #2

    We note you've also sent an email to support and we have been scratching our heads as to how such a simple checksum could be giving you issues.

    Here's the code from the arduino library that generates the checksum
    uint16_t genieWriteObject (uint16_t object, uint16_t index, uint16_t data)
    uint16_t msb, lsb ;
    uint8_t checksum ;

    lsb = lowByte(data);
    msb = highByte(data);

    _genieError = ERROR_NONE;

    _geniePutchar(GENIE_WRITE_OBJ) ; checksum = GENIE_WRITE_OBJ ;
    _geniePutchar(object) ; checksum ^= object ;
    _geniePutchar(index) ; checksum ^= index ;

    _geniePutchar(msb) ; checksum ^= msb;

    _geniePutchar(lsb) ; checksum ^= lsb;

    _geniePutchar(checksum) ;


    But surely that would have been what you would have tried first?

    Another thought is that whatever method you are using to write to the serial port is 'improving' your data, by suppressing 0x00s or adding 0x0Ds to 0x0As.

    Perhaps try using your programming cable (or PA5) as a serial monitor to see what is actually being sent to the display?


    • #3

      Thanks for the response but you didn't address my concern of extra code for a checksum which again I wish you would consider removing in future releases of the firmware (just a suggestion of a paying customer who thinks your products are cool)

      Not sure what I was doing wrong last night "wrong" but I was able to get the code working once I removed some HEX modifiers from the HSEROUT per your suggestion (thanks). It appears that I over complicated the code by adding a HEX modifier; once removed I was able to write values to the Thermometer (finally...much joy).

      BTW: I didn't open a support call for this issue (I did open one over two years ago for a defective display ?32? which frankly I just gave up on only to find out using the new firmware that as I stated the touch screen was bad as well as the uSD drive was there was no warranty sticker on it which made it interesting to figure out what firmware I needed). But today 4D Systems is a new day so try to take it a bit easy on us who ARE NOT professional programmers (and not Raspberry Pi/Ards users) and don't simply install libraries and copy code examples (I'm off my soapbox now).

      Here is the code example just in-case other BM users stop by this forum:

      ; *** Example code to connect a Basic Micro Nano-18 to a 24PTU using Visi Genie ***; *** This uses the "Thermometer" (ID$12) *** PAUSE 500LCD_RSTCONP3;Pin-16 TEMP_CASEVARBYTELCD_CKSMVARBYTELCD_STATUSVARBYTE CLEAR SEROUT S_OUT,I9600,[0,Resetting the LCD,13] HIGH LCD_RSTPAUSE 250LOW LCD_RSTPAUSE 100HIGH LCD_RSTPAUSE 3000 SETHSERIAL1 H9600 SEROUT S_OUT,I9600,[0,Program starting...,13] SEROUT S_OUT,I9600,[Temp 91,13] HSEROUT [$01,$12,$00,$00,$5B,$48]GOSUB NAKPAUSE 3000 SEROUT S_OUT,I9600,[Temp 50,13] HSEROUT [$01,$12,$00,$00,$32,$21]GOSUB NAKPAUSE 3000 FOR TEMP_CASE=25 to 100 LCD_CKSM=$01^$12LCD_CKSM=LCD_CKSM ^ 0LCD_CKSM=LCD_CKSM ^ 0LCD_CKSM=LCD_CKSM ^ TEMP_CASE SEROUT S_OUT,I9600,[Temp Case Valule:, DEC TEMP_CASE,13]SEROUT S_OUT,I9600,[LCD Checksum Value:, HEX LCD_CKSM,13] HSEROUT [$01,$12,$00,$00,TEMP_CASE,LCD_CKSM]GOSUB NAK NEXT END ; Subroutine to check for communication from the LCD NAKHSERIN [LCD_STATUS] IF LCD_STATUS=$06 THENSEROUT S_OUT,I9600,[LCD COM OK:,HEX LCD_STATUS,13]ELSESEROUT S_OUT,I9600,[LCD COM Error:,HEX LCD_STATUS,13]ENDIFRETURN