Shop OBEX P1 Docs P2 Docs Learn Events
DIRH and DIRL help please — Parallax Forums

DIRH and DIRL help please

WhatWhat Posts: 23
edited 2008-05-16 21:03 in BASIC Stamp
Hi.

I'm trying to send some word to and 2x16 LCD display (BONA MC1602-13 Rev.3) with my Basic Stamp 2.

Wiring is described as:

P8 <-> E \
P9 <-> RW \
P10 <-> RS \
P11 <-> DB4 --- ( 2x16 ) LCD DISPLAY
P12 <-> DB5 /
P13 <-> DB6 /
P14 <-> DB7 /

I'm using a code that i found in a stampworks (Attached). But i can't understand how should i define the DIRL or DIRH.
Sorry for my bad english and if u need any more info to try to help me just say it and i'll add it.

Thanks for all your time and help.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-05-14 12:14
    A "1" "0" makes the associated pin an output, a "0" "1" makes it an output.

    DIRH is for P8-P15.· You're using P8-P14, DIRH = %01111111 makes those pins outputs.

    Post Edit -- OK, I described it incorrectly, but I got the numbers right in my example.· Must wait till my second cup.

    Post Edited (PJ Allen) : 5/15/2008 11:46:41 PM GMT
  • WhatWhat Posts: 23
    edited 2008-05-14 17:18
    Thanks, you help me a lot and my code finally works !! smilewinkgrin.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-15 16:04
    I think PJ meant to say a "0" makes it an INPUT. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-05-15 23:53
    Yep, that's a bust.

    I didn't describe it right, but I managed to get the numbers right in the example.

    I edited that, and thanks.

    [noparse][[/noparse]·It's a fair cop, but SX/B's to blame.· I'm hooked on·my cue·(TRISx =·· ), figuring that·a "1" looks like an I and a "0" looks like an O.· Switching between the two can be, and frequently is,·a real haddock.·]
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-16 21:03
    Something sounds fishy about that explanation... [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.