Storing hours and minutes into single byte?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Storing hours and minutes into single byte?

    Ha! You see? It has spurred another thought: By dividing the elapsed time since midnight by 85 (seconds) it is possible to use each bit as a flag - with limited resolution, but... well, perhaps adequate.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Storing hours and minutes into single byte?

    User inputs time in hours and minutes, so second precision is not required, minute-level precision will be enough.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Storing hours and minutes into single byte?

    Hi,
    Differentiation between 11:14 and 14:11 will be quite easy, because when time from RTC reaches that time, a variable is toggled, which can be later used to determine exactly what time should be read now.
    I'll admit, I don't really get that or exactly what you're doing but I thought the issue was lack of variable space.... If you're going to use flags to keep track of what's what then you might as well use those flag bits as part of the "time variable" to increase its resolution.

    Anyway, if the resolution can be reduced then of course you can fit in any number of bits, just a matter of how much you need to reduce the resolution.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default Re: Storing hours and minutes into single byte?

    I'm doing a light controller timer. It has 16 channels, user can set up individual channel ON and OFF times, by inputting time in hours and minutes.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Storing hours and minutes into single byte?

    @Amoque
    Nor do I full understand why 6 minute samples are needed? There are 12 five minute segments in an hour; if it possible to represent the 12 hour positions in 4 bits, why can not the 12 five minute positions be represented similarly (in four bits)?
    There are 24 hours in a day and 4 bits will only "do" 0-15.

    George

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Storing hours and minutes into single byte?

    I have to ask, Why are the byte constraints so important? Why not words? Are you that straped for eeprom space?
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. SEROUT command (single byte value not string)
    By MrRoboto in forum mel PIC BASIC
    Replies: 15
    Last Post: - 12th June 2010, 03:34
  2. 6 hours for a comma, a space, and some caps.....
    By boroko in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 13th March 2009, 20:31
  3. 10,20,30,40 minutes
    By helena in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st March 2007, 12:04
  4. Timer and long (hours) sleep period - how to?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th January 2007, 07:32
  5. increases every 5 minutes
    By Sasha in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd April 2006, 21:09

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