Any idea's on porting this to PBP?


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Cape Town SA
    Posts
    23


    Did you find this post helpful? Yes | No

    Default Youre the best!

    Darrel you are amazing!
    I tried this out yesterday and it exactly what I'm looking for ( I am making a fuel consumption / complex odometer for my ancient Land Rover) and as I can't see close up without glasses, but have perfect long distance vision, a normal LCD display on the dashboard is quite useless and I had been considering large 7 seg display, but this is beautiful! Thanks a million.

    PS: any tips on saving a counter on power-down? I was going to have the PIC running off big electrolytic for long power down delay, and then have one port sensing the instant loss of the (voltage divided) 12v ignition and then quickly write to EEProm, but would it be clever to use a brown out flag or something like that?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Thanks, but the credit goes to Scott Edwards on that one.

    If you have a PIC with an LVD (LOW VOLTAGE DETECT) pin. You can use it to generate an interrupt when it detects the loss of power.

    Then you can imediately set all pins to input and shut-down any on-chip peripherals to save current.

    You should be able to run long enough to save about 8-10 bytes with just 10uf or so..
    DT

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hello Everyone,
    This is cool. Anyone got an idea how to force this code to display 4 digits all the time? From 0000 to 9999? Scotts code works well. I tried dispVal = 0000 prior to the LCDOUT I,cgRAM statement and that did alright to start counter at zero and eliminate the initial display of a psudorandom 4 digit number at startup, I am sure it is simple, alas so am I .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Ahhh, I figured out 1 way, Preload with dispVal = 10000. I watched it count up until it overflowed and the zeros remained. Are there better ways ?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    > Anyone got an idea how to force this code to display 4 digits all the time?

    LCDOut DEC4 MyVar

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    >> Anyone got an idea how to force this code to display 4 digits all the time?

    Just comment out this line ...
    Code:
    ;            if dispVal < decade then blankIt
    Added: Or better yet, make it ...
    Code:
    LeadingZeros  VAR BIT
    
                if (LeadingZeros = 0) AND (dispVal < decade) then blankIt
    Then if you want leading zero's just set the bit.
    <br>
    Last edited by Darrel Taylor; - 21st July 2007 at 11:48. Reason: Leading
    DT

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie and Darrel,
    That's 4 dirrerent ways - Great! It seems there is always more than 1 way.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Generating Timed Fades in PBP - ideas ?
    By bcd in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th August 2008, 00:18
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. PBP / XP Crash
    By pondindustrial in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th November 2005, 03:16

Members who have read this thread : 1

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