Menu

Address bus binary from a decimal number <65535

Help
jeff
2021-04-26
2021-04-26
  • jeff

    jeff - 2021-04-26

    My application is to bus an AT043TN24 V.7 LCD 272 X 480 pixel. Using 3 bit for color 2 pxl can be contained in 1 byte and the full display would then contain some 272 x 240=65280 addresses in RAM.I am getting the pxl (graph) points from 8 bit ADC which then produces 256 points out of the 272. I now need from this dec number up to 65280 the 2 binary bytes to constitute the address bus.Can you please suggest a way for the code to produce the 2 bytes contained in the Word ?

     
  • Chris Roper

    Chris Roper - 2021-04-26

    Take a look at "Variable Aliases" on this page of the Help files: http://gcbasic.sourceforge.net/help/_variables.html you will find it about 2/3 of the way down.

    It lets you reuse the same location with different names, so a word could have the bytes separately named in addition to the word name.

     

    Last edit: Chris Roper 2021-04-26
  • stan cartwright

    stan cartwright - 2021-04-26

    don't you need the scale function?
    word_variable = Scale (value_word , fromLow_word , fromHigh_word , toLow_wordr , toHigh_word [, calibration_integer] )
    pixel16=scale (pixel,0,255,0.65280)
    where pixel is your 0-255 and is stored as a word variable.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.