Joining 5 bit variables and splitting them into 8 bit ones later?


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    Oh, and by the way, is there any possibility to increase SPI speed? I'm running 16F886 @ 8mhz, and update rate is clearly not good - forget about scrolling letters and other stuff like that.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    Oh, and by the way, is there any possibility to increase SPI speed? I'm running 16F886 @ 8mhz, and update rate is clearly not good - forget about scrolling letters and other stuff like that.
    yes don't use shiftout, on a chip that has a mssp module it's an order of magnitude or two slower than spi
    its like having a dog and barking yourself

    Well, I already have buffer, but 32x1 pixels in size, because the data is sent to display line by line.
    yet characters persist over 8 lines and you are ignoring that present data, furthermore there is no way to recover that data from the chip
    you figure it out
    Warning I'm not a teacher

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    after some thought ,

    Well, I already have buffer, but 32x1 pixels in size, because the data is sent to display line by line.
    But the problem is different, I can't understand why this works only per 8 bit: SCREEN32[Y+8]=CHAR2.0(Y) - if I enter any other number instead of 8, which is not multiple of 8, say 5 or 17, everything becomes garbled, while it should not. So, maybe I'm writing in array incorrectly?
    i assume SCREEN32 is your 32 bit array ,
    SCREEN32[Y+8] is then a complete nonsense as the only valid locations are 0 to 3

    similarly wtf is char2 ? if its a byte then
    CHAR2.0(Y) a valid y value can only be 0 to 7

    then we have this, wtf is char1 a byte a word an array ? , a pointless snippet

    char1=char1 | char2>>5
    char2=char2 <<3 | char3>>2
    char2=char2 | char4>>7
    char3=char4<<1char4=0
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    Yes, SCREEN32 is 32 bit array.
    And why locations only can be from 0 to 3 ?
    There are 32 bits, or what you want to say, that is not possible to write into specific bit of bit array?

    I'm reading a bit from variable and writing it into bit of an array, to later read bits as needed.

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    thats what happens with snippets ,there is no context

    SCREEN32 var bit[32] would have made it clear


    I'm reading a bit from variable and writing it into bit of an array, to later read bits as needed.
    good luck
    Warning I'm not a teacher

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    proof of concept
    btw i like your font it looks better than my 6x5 one

    sorry for shaky vid , was trying to use mouse while steering phone , failed both accounts

  7. #7
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: Joining 5 bit variables and splitting them into 8 bit ones later?

    Well, I'm designing fonts for last 30 years, so no surprise mine is better
    proof of concept of what?
    Any code was posted?

Similar Threads

  1. 32 Bit NEC IR Constants/Variables
    By Zebryk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd July 2013, 15:51
  2. Joining variables and displaying on an LCD
    By Navaidstech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th April 2009, 05:12
  3. 32-bit Variables and DIV32, Hourmeter 99999.9
    By Darrel Taylor in forum Code Examples
    Replies: 9
    Last Post: - 23rd November 2006, 08:23
  4. How to tell which PICs can handle 16 bit variables?
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st August 2005, 09:44
  5. Bit variables... typo?
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th November 2004, 19:11

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts