=09 IVP wrote 2014-04-26 23:35: >> I'm not sure the CGRAM implements 8 bytes per character, >> because the characters themselves are 7x5 pixels in size. > > For display, only 5 bytes per character are needed, and that's all > I've ever sent However, the datasheet does say that CGRAM is > "512 bits", or 8 x 8 x 8. CGRAM character base addresses are > divisible by 8, so there must be 3 bytes of RAM per character > that are writeable/readable but never displayable. No, 8 bytes are used for each characted, but 3 of the *bits* in each *byte* are not used for display and can, acording to a HD44780 manual, "be used as a general purpose RAM area". Only using 3 bits out of each byte is a bit messy, of course... The 8'th byte is the "cursor position" under the character itself, but can be programmed to display any pattern. So the available space is 5x8 bits for each user defined character. > Not on a typical > 16 x 2 anyway. They probably are useable for other displays, like > a dot matrix. > > I used CGRAM as GP RAM only once, a long time ago, and > have no idea where that s/w is now so can't refer to it. But I do > occassionally use redefined characters, like this last project, a > vertical bar scale. The prototype is still breadboarded, I should > find out whether there really are 64 r/w RAM bytes > > Joe > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Snippet - > > ;Read 4 bytes of data into CGRAM 0-3 for '5' shape > ;Read 4 bytes of data into CGRAM 4-7 for '4' shape > ;Read 4 bytes of data into CGRAM 8-11 for '3' shape > ;Read 4 bytes of data into CGRAM 12-15 for '7' shape > ;Read 8 bytes of data into CGRAM 16-23 for whole block shape > ;Read 8 bytes of data into CGRAM 24-31 for half-block shape > > redef movlw .5 ;number shape '5' > movwf shape > movlw .0 ;CGRAM address for digit 1 > movwf cg_addr > call read4 ;get 4 bytes of data > > movlw .4 ;number shape '4' > movwf shape > movlw .4 ;CGRAM address for digit 2 > movwf cg_addr > call read4 > > movlw .3 ;number shape '3' > movwf shape > movlw .8 ;CGRAM address for digit 3 > movwf cg_addr > call read4 > > etc > > > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .