Shop OBEX P1 Docs P2 Docs Learn Events
Help with Stampworks 11 please — Parallax Forums

Help with Stampworks 11 please

basicstampedebasicstampede Posts: 214
edited 2008-09-19 08:18 in General Discussion
Hello.· After a few days of frustration, I would appreciate some help please.
I am converting Stampworks 11 to SX/B (for educational purpose).
I've checked the code but I must have made a mistake somewhere as LCD does not work at all (there is power, but no intelligent characters).
Connections:
RA.0· --- DB0/DB4 on PDB
RA.1· --- DB1/DB5
RA.2· --- DB2/DB6
RA.3· --- DB3/DB7
E····· --- RC.7
RS··· --- RC.6

I suspect I've not correctly translated this code:
BS2:···································SX/B:
LCDBus VAR OutB················· LCDBus VAR RA OUTPUT

Later in the code, the BS2 version has:·
LCDbus = %0011

In SX/B, I wrote this as:
LCDbus = %0011·· Is this·allowed in SX/B·since LCDbus was defined as OUTPUT?

I attach my file here.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-09-13 15:11
    I worked on a conversion of the Parallax parallel LCD program for SX/B a few months back.

    I worked on a conversion of Parallax's PBASIC program for the·parallel LCD into·SX/B a few months back.

    The pins used may be different from yours.

    Post Edit -- If you're interested in following that adventure:

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

    Post Edited (PJ Allen) : 9/13/2008 3:26:24 PM GMT
  • basicstampedebasicstampede Posts: 214
    edited 2008-09-13 16:27
    PJ, thanks. Now it shows something, but it is garbage.

    Msg:
    DATA "SXB", 0

    It shows "o<-/___ _oo/O/" etc. Junk.

    Do I have to find ASCII equivalent of SXB? and store them in DATA statement?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-09-13 17:22
    Shows garbage.

    My program displays some letters.· Does that much work?·

    Or is it after you incorporate it with your plan that it goes to garbage?

    DATA "SXB"...· I'm not certain that's OK.· How's DATA "S", "X", "B" ?
  • basicstampedebasicstampede Posts: 214
    edited 2008-09-13 17:56
    PJ, I modified my code.· I attach it here.· The display reads "Ooooo/__O/" and the like.· That is what I mean by 'garbage'.

    I put 500 ohms pull down resistors to ground (for each of RA.0 to RA.3).
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-09-13 18:16
    Could we establish a baseline?· I know that my program with my drawing works.· I tried it on two different LCDs at the time.· How does my program work for you on its own?

    My schematic shows 4.7KΩ ("4K7")·pulldowns.· It also shows series resistors which should be 220Ω.· I like to keep a series resistor in circuit that way, they're not exactly "necessary."
  • Shawn LoweShawn Lowe Posts: 635
    edited 2008-09-13 18:29
    Do you have a resonator?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    When all else fails.....procrastinate!
  • basicstampedebasicstampede Posts: 214
    edited 2008-09-13 18:57
    PJ, yes your code works. I rewired per your code. 1st row shows A to Z. 2nd row shows SX/B.
    Shawn, I changed the DEVICE and FREQ so it works.

    Thanks for your help.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-13 21:49
    Until today I had never bothered with 4-bit LCD code because the SX28 has four more pins that the BS2; this means there are plenty of pins for 8-bit LCD code. See the Serial LCD program in the help file for an 8-bit LCD interface.

    As an exercise I ported SW #12 (custom characters) to SX/B using a 4-bit interface to the LCD. While PJ's program works just fine it uses old-style syntax and is not quite as efficient or flexible as we can be with SX/B today. The demo I've attached (which also works and requires no "fixing" [noparse][[/noparse]hint, hint....]) uses modern SX/B syntax, hence is very efficient and very flexible.

    Note that I have moved the E pin to RB.1 and am using RB.0 for backlight control. I have tested this program on a PDB.

    Post Edited (JonnyMac) : 9/13/2008 11:52:46 PM GMT
  • basicstampedebasicstampede Posts: 214
    edited 2008-09-14 03:11
    JonnyMac, thank you very much. That is so cool!
    My frustration comes when I try to modify either your or PJ's program. I want to use RA as the 4 bits of data for LCD. Every time I tried using the RA port as data and RC as control pins
    I get something on LCD, but it is half gibberish. That is I get something like "Hellv SX" one time and "Helvo X" another time. It changes for some strange reason, as if there is some noise affecting data to the RA port. And the message is close enough to what I want, so I know that I am not too far off, but I don't know what the problem is. I want to show "Hello SX/B".
    How can I make your program work using RA pins for data?

    RA.0 --- DB4 on PDB
    RA.1 --- DB5
    RA.2 --- DB6
    RA.3 --- DB7
    E --- RC.7
    RS --- RC.6
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-09-14 04:29
    Once you take the time to learn SX/B and the SX you will be able to make those changes without so much frustration. This took all of three minutes to update (to your connections) and verify.

    Post Edited (JonnyMac) : 9/14/2008 4:13:19 PM GMT
  • John BondJohn Bond Posts: 369
    edited 2008-09-19 08:18
    Thanks Jon for a clear 4 bit LCD driver - (I'm often short of pins)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.