I looked at the I2C write example and it said 0x28 switches backlight
off (Figure 11), And it's actually 0x20!
Wehoo it's working :)
Well sort of, I think it's my programming skills lacking now :)
Dim screen As oI2C
Dim text As New oBuffer(20)
Dim lp As Byte
Sub Main()
screen.Node = 0x28 ' 0x50 divided by 2
screen.Mode = cv7Bit
screen = 0x20 ' Backlight On
Call CLS()
text.VString="Hello World! "
DisplayText()
End Sub
Sub DisplayText()
screen.Mode = cv7Bit
screen = 0x80 ' Send string
For lp = 0 To 19
text.Location = lp
screen = text.Value
Next lp
End Sub
Sub CLS()
screen.Mode = cv7Bit
screen = 0x8c
End Sub
Sub BackLightOff()
screen.Mode = cv7Bit
screen = 0x28
End Sub
The screen clears but I cannot get any text to appear.
I think it is I don't understand the IC2 stuff just yet.
Thanks for any help.
Cheers,
Jas
--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> What should happen? The 0x28 command just turns the screen on.
Send
> some text to it and see what happens. Carefully read through the
> commands set and experiment. you should get something to go as
long as
> you put in the pull up resistor on the SDA line as we said earlier
in
> this thread.
>
> DLC
>
> jasuk1970 wrote:
> > Hi again.
> >
> > I've given this a go. I found a 3 pin cable which connected to
the
> > pins in the I2C connector.
> >
> > http://www.robotchat.org/images/lcd_oopic_1.JPG
> >
> > The white cable connects to pin 1 in the connector which is data,
the
> > black cable connects to pin 2 which is ground and the red cable
which
> > is the clock. I've connected these to the bread board:
> >
> > http://www.robotchat.org/images/lcd_oopic_2.JPG
> >
> > These then connect to the daughter board, Plus a +5 and Ground to
> > power the board.
> >
> > http://www.robotchat.org/images/lcd_oopic_1.JPG
> >
> > These connect to the respective Data Ground and clock (top left)
and
> > +5, ground connect to the board to power it (bottom right). The
dip
> > switches are set to 00, which sets the IC2 address to 0x50
> >
> > The display then lights up when the power is connected.
> >
> > http://www.robotchat.org/images/lcd_oopic_4.JPG
> >
> > I now write the following program to send the command to switch
off
> > the back light:
> >
> > Dim screen As oI2C
> >
> > Sub Main()
> > screen.Node = 0x28 ' 0x50 divided by 2
> > screen.Mode = cv7Bit
> > screen = 0x28
> >
> > End Sub
> >
> > Unfortunatly nothing seems to happen. Any ideas?
> >
> > Thanks,
> >
> > Jas
> > --- In oopic@yahoogroups.com, <dennis.clark@> wrote:
> >
> >> Yon are correct in all of your guesses. Check the ooPIC site on
> >>
> > the "connectors" page for the part number for that connector.
> >
> >> DLC
> >>
> >> ooPIC Tech Support
> >>
> >> -----Original Message-----
> >>
> >> From: "jasuk1970" <mail@>
> >> Subj: [oopic] Re: NC2004A LCD Screen with Modtronix LCD2S
daughter
> >>
> > board
> >
> >> Date: Fri Jan 25, 2008 3:31 am
> >> Size: 3K
> >> To: oopic@yahoogroups.com
> >>
> >> Thanks for the info. I'm going to give it a try as soon as I Can
> >>
> > get
> >
> >> the I2C pins connected.
> >>
> >> I've posted a picture of the OOBoard with the hilighted sections
> >>
> > from
> >
> >> the manual that came with the OOPic 5 compiler software in the
> >>
> > files
> >
> >> section. It seems to have 2 I2C Ports on the board, One (in the
> >> cluster of Various IO Ports labelled (Local Devices) and one
> >>
> > labelled
> >
> >> Network. I am assuming that it's the local devices one I need to
> >>
> > use.
> >
> >> Also does anyone recognise what the connector type is (Its the
> >>
> > white
> >
> >> connectors) It has 5 pins. I've been trying to google for it,
but
> >>
> > as
> >
> >> 5 pin connector is pretty vague thing to search for, I'm not
having
> >> much luck. I have the pin information in the documentation so
could
> >> end up soldering wires to the pins if need be.
> >>
> >> Cheers,
> >>
> >> Jas
> >>
> >> --- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@>
> >> wrote:
> >>
> >>> It's actually simpler than you are making this out to be. Set
> >>>
> > your
> >
> >> I2C
> >>
> >>> address as they recommend, then divide this by 2 (bit shift
right
> >>>
> >> one
> >>
> >>> place) and this is the .node value. When you are sending data
to
> >>>
> >> the
> >>
> >>> device you would use cv10bit format and the .Location attribute
> >>>
> > is
> >
> >> the
> >>
> >>> command, so you'd do this:
> >>> dev.Mode = cv10bit
> >>> dev.Node = <whatever address shifted right one bit>
> >>> dev.Location = <command>
> >>> dev = <data>
> >>>
> >>> When you are sending a command you would use this:
> >>> dev.Mode = cv7bit
> >>> dev = <command>
> >>>
> >>> That's it. If you are using an ooPIC R you don' t need to
worry
> >>>
> >> about
> >>
> >>> pull ups on the SCL line - Its already driven. The SDA line
> >>>
> >> should
> >>
> >>> have a 4.7K pull up on it.
> >>>
> >>> DLC
> >>>
> >>> jasuk1970 wrote:
> >>>
> >>>> --- In oopic@yahoogroups.com, "rtstofer" <rstofer@> wrote:
> >>>>
> >>>>
> >>>>> --- In oopic@yahoogroups.com, "jasuk1970" <mail@> wrote:
> >>>>>
> >>>>>
> >>>>>> Cheers,
> >>>>>>
> >>>>>> I am looking at this now. I am trying to work out what Mode
> >>>>>>
> > it
> >
> >>>>>>
> >>>>>>
> >>>>> should
> >>>>>
> >>>>>
> >>>>>> be using.
> >>>>>>
> >>>>>> An example of the commands it is looking for to get the
> >>>>>>
> > status
> >
> >> is:
> >>
> >>>>>> SaaaaaaadAccccccccASaaaaaaadAbbbbbbbbP
> >>>>>>
> >>>>>> S= start
> >>>>>> a= address bit (7 bits + direction)
> >>>>>> d= read or write bit
> >>>>>> A= acknowledgement from slave
> >>>>>> c= command bit (8 bits)
> >>>>>> b= First byte of data (8 bits)
> >>>>>> P= stop
> >>>>>>
> >>>>>> If the address is 0x50 then it would look like:
> >>>>>>
> >>>>>> S01010000 A 11010000 A S01010001 A {Recieve first byte of
> >>>>>>
> > data}
> >
> >>>>>> I hope it makes sense, Looking at it I am assuming it is
> >>>>>>
> > cv7Bit.
> >
> >>>>>> Or would I need to do some custom controlling to get this
> >>>>>>
> >> working?
> >>
> >>>>>> Thanks for any help,
> >>>>>>
> >>>>>> Jas
> >>>>>>
> >>>>>>
> >>>>> I must be looking at the wrong datasheet because the one I am
> >>>>>
> >>>>>
> >>
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment