Shop OBEX P1 Docs P2 Docs Learn Events
Going to start a project, want to double check some things.. — Parallax Forums

Going to start a project, want to double check some things..

CheechCheech Posts: 30
edited 2007-08-01 10:03 in BASIC Stamp
I have a project I've been wanting to do for a long time, I'm finally getting around to it now and I just would like to double check I have all the items I need and collect any advice before I start.

Goal: Create a display to show interest accruing in realtime on a display.· Will be using the 4x20 Serial LCD for·now because I already have it,·but in the future would like to use large·7-segment displays.
I want to have 3 pieces of information displayed:
1.) The total amount at this moment $999,999.99
2.) The interest earned for this month $999.99
3.) And the most fun part, the daily interest with a high decimal count to watch the numbers fly (My reasoning behind this is I will get so amused at watching the sign count up, I will want to save more to make it go faster!).· The decimals for this would be $99.999999· I would like this to update as fast as possible to create·the greatest effect.

I have:
BSp24
4x20 Serial LCD
Keypad (might or might-not use it, hate to see it go to waste)

I need:
DS1302 Timekeeping Chip (http://www.parallax.com/detail.asp?product_id=604-00005)

I think I need:
Floating Point Coprocessor V2 (http://www.parallax.com/detail.asp?product_id=604-00030)

My main question is, is the coprocessor necessary to achieve the accuracy of 8 decimal place resolution I am looking for, or can the BSp24 handle it without it AND do everything else it needs to do to make the display work?· And any advice on the general project?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-30 04:40
    You don't need the coprocessor. You could do the whole thing in BCD since it's just addition or even do it in ASCII digits with the actual numbers kept in scratchpad RAM. If you just want approximate time, you could wire up a 555 timer in asynchronous mode to produce timing pulses once a second. As long as the computation and display takes less than a second, the Stamp would just have to wait for the next pulse leading edge, then do the next cycle.

    The ASCII digit add for two 8 digit numbers in scratchpad RAM (locations 0-7 and 8-15) would look like
    add8Digits:
      digitPtr1 = 7
      digitPtr2 = 15
      do
        get digitPtr1,value1
        get digitPtr2,value2
        value1 = value1 + value2 - "0"
        put digitPtr2,value1
        digitPtr1 = digitPtr1 - 1
        digitPtr2 = digitPtr2 - 1
      loop until digitPtr1 < 0
      return
    
    
  • CheechCheech Posts: 30
    edited 2007-07-30 14:47
    It's not just addition, its division and multiplication. Also I need to know the start and ends of months, when 12:00am is every day, and the whole nine yards.

    See, I'm not just crunching the numbers once and just putting it on a continuous addition loop, its going to be compounding interest once a month, plus account for the additional money I put in my account every week. Thats why the Time chip is so important.

    I think I will just save myself the hassle of doing "workarounds" to make it do the math I want and just get the coprocessor.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-30 15:01
    I suggest you do include the keypad. It will help with debugging if you can use the keypad to switch what's being displayed and optionally put the program into "single step" mode where it will use one of the buttons on the keypad to "advance the time" rather than run off the clock. You could also use the keypad to correct the numbers from time to time since round-off will cause errors to creep in over time and you may change what you save.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-08-01 10:03
    If you are only making one then you should stick with the BS2 as it is easier to interface to. However you may want to also consider·using a much·lower cost SX-28 and 4 MHz resonator (+$30 Blitz programmer) as I have already interfaced an SX-28 to a DS1302 and an LCD.

    http://forums.parallax.com/showthread.php?p=643780

    Also in the examples section of the SX/B help guide it shows you how to interface an sx28 to a 4x4 keypad. I have also modified this for a 3x5 keypad in past projects too.

    http://forums.parallax.com/attachment.php?attachmentid=47155

    See page 205

    Good luck.
Sign In or Register to comment.