Shop OBEX P1 Docs P2 Docs Learn Events
2x16 LCD timer in assembly ? — Parallax Forums

2x16 LCD timer in assembly ?

CalebjoCalebjo Posts: 15
edited 2008-12-08 21:28 in General Discussion
Hey does anyone know where I could find an example of making a timer with the parallax 2x16 serial LCD in·assembly? I found a few on controlling LCDs with SX/B so if I would appreciate a good example program of making a serial LCD stopwatch in assembly or SX/B.
Thanks, Calebjo


[noparse][[/noparse]Edit] Calebjo, I added a subject for you. Bean

Post Edited By Moderator (Bean (Hitt Consulting)) : 12/5/2008 11:38:31 AM GMT

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-12-05 06:42
    Calebjo,

    In the future please try to use a more descriptive subject for your post. "(No Subject)" doesn’t convey what you need help with. This will often limit potential useful responses as those who can help may never see your message.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-12-05 07:06
    Can the forum engine be changed to block new topics that has No Subject?
    This can solve a lot of headache.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-12-05 23:28
    If you're going to build a stopwatch from scratch you may as well include a direct connection to the LCD as well. Right?
  • CalebjoCalebjo Posts: 15
    edited 2008-12-06 05:09
    Hey I'm sorry I forgot to post the subject as well. Sometimes that escapes my memory. Requiring·a subject would be a good reminder like Willia, Chan said. Anyway sorry for the subjectless post.

    Jonnymac, what exactly do you mean by having a direct connection to the LCD?·Do you mean just directly connecting the·serial LCD to the SX?·Sorry if there is an obvious inference here.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-12-06 05:53
    No, what I mean is connecting a parallel LCD directly to the SX. Using 8-bit mode (easiest) you need 11 IO pins -- see the serial LCD example project in the SX-B help file.
  • John CoutureJohn Couture Posts: 370
    edited 2008-12-06 18:56
    Calebjo,

    Ok, let's start by defining it.

    =======================
    Project Description:

    To develop a timer using a 2x16 LCD panel.

    Timer is to have ?? buttons labeled ???, ???, ???

    Display is to be formated as (in other words what do you want to display)
    xxxx.xxxx.xxxx.x
    xxxx.xxxx.xxxx.x

    ========================
    Additional Options you might consider:

    1) Timer to have a resolution of ??? milliseconds (or microseconds or just tenths of a second)

    2) Are the buttons going to be simple push buttons or are you connecting to a piece of equipment?

    3) You will probably need to "debounce" push buttons.

    4) Do you want to be able to turn off (or dim) the backlight to save power?

    5) Is the power source a battery or will you be plugging it into a power supply (a.k.a. wall wart)

    6) Do you need to have more than one timer (like some watches that have two or three timers that you can independently start and stop)

    7) How accurate does it need to be? (this means if you are just measuring tenths of a second over the period of a couple of minutes, you are fine using an resonator. However, if you want to measure over a period of several days you might want to consider a real time clock.

    8) Do you want to use one of the SX pins to simoultaneously send the time to a RS-232 connector so you can read the timer with your Desktop PC? (for logging purposes).

    ===========================

    Hope this helps. Keep it simple at first something like:

    -- display "hello world" on the LCD
    -- program a loop to count from zero to 255
    -- start and stop the count with one button
    -- add logic to display seconds, minutes, hours
    -- start and stop your timer
    -- etc, etc

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-12-07 19:41
    I happen to have a project coming up (March N&V column) that requires a real-time clock and an LCD interface, and as I believe that working on things in discrete chunks is best I've put together the program that's attached. The program combines a 4-bit LCD interface that I wrote a few months ago with a software RTC. The program is SX/B but uses assembly for the interrupt to keep everything as swift as possible. The RTC uses BCD format like popular silicon RTCs (e.g., DS1302, etc) which makes output of the timer values pretty easy.

    The program is happily running on my PDB at the moment, using this display format: HH:MM:SS.th (where th is tenths and hundredths). Even though the timer has higher resolution (100us) you can barely see the tenths digits with the display being updated so frequently; the hundredths is a blur.

    Take this code and John C's good advice from the response above and create your stopwatch.

    Post Edited (JonnyMac) : 12/8/2008 12:41:38 AM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2008-12-08 21:28
    BTW: You can find a complete stopwatch source code in my book (you can download it from the Parallax site, see APP015.SRC) using a 6-digit 7-seg LED display. Be aware: this is "Hard-core Assembly" and not SX/B smile.gif .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.