This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Wednesday, December 12, 2007

Re: [oopic] Re: Help with incoming Serial Communcation from PC to ooPic-R I2c LCD03

Very good. As Andy says, you don't need to use.Value, for most objects
simply accessing the object by its name defaults to that.

DLC

Angelo wrote:

>Hi Dennis/Richard,
>
>Thanks for your help.
>
>I have got the LCD03 working in serial mode and the setup the serial
>commincation with my PC.
>
>Here is the code I used if future users require it:
>Dim LCD03 As New oSerialL
>Dim SP As New oSerialPort
>
>Sub Main()
> ooPIC.Delay = 4000
> SP.Baud = cv9600
> SP.Operate = cvTrue
> LCD03.IOLineS = 16
> LCD03.Baud = cv9600
> LCD03.Value = 12
> LCD03.Value = 4
> LCD03.Value = 19
> Do
> If S.Received Then
> LCD03.Value = SP.Value
> End If
> Loop
>End Sub
>
>Regards,
>Angelo
>
>--- In oopic@yahoogroups.com, <dennis.clark@...> wrote:
>
>
>>I didn't notice that the LCD used flow control. Try not using
>>
>>
>IOlineF.
>
>
>>DLC
>>
>>ooPIC Tech Support
>>
>>-----Original Message-----
>>
>>From: "Angelo" <mowens18@...>
>>Subj: [oopic] Re: Help with incoming Serial Communcation from PC
>>
>>
>to ooPic-R I2c LCD03
>
>
>>Date: Wed Dec 12, 2007 3:02 am
>>Size: 5K
>>To: oopic@yahoogroups.com
>>
>>Hi Dennis,
>>
>>Thanks for helping.
>>
>>(1) The code might be incorrect due to my lack of experience in the
>>workings of the ooPic but the LCD03 does work with this code.
>>
>>(2) The SP stuff is needed as this will be used to receive and send
>>data over the serial port to visual basic application. The windows
>>application is working and has been tested to received data and
>>
>>
>send
>
>
>>data. The problem is how to handle the received data on ooPic.
>>
>>(3) To be honest, "LCD03.Mode = cv10Bit", I do not fully understand
>>what this does. I have copied this from another example from the
>>CMP03 digital compass example from the Devantech website.
>>
>>(4) With reference to "LCD03.Value = 1" this actual does what it
>>
>>
>says
>
>
>>and starts the cursor at the home location. Details of this can be
>>found here: http://www.robot-electronics.co.uk/htm/Lcd03tech.htm

>>
>>
>and
>
>
>>using a trial and error method this actual works on the LCD03
>>
>>=> I have tried using the Scott Edward LCD example but it does not
>>seem to work with this decive and .Location could not be used. I
>>agree with you about using iolines as a serial port to commincate
>>with the LCD because the LCD picks up data via the serial port when
>>programming or when receiving data from the PC application. The
>>reason for not using this method is that I could not get the device
>>to work in Serial mode. If you have any sugguestion on how to get
>>
>>
>it
>
>
>>work in serial mode I would be grateful. I have tried the following:
>>
>>
>>
>*********************************************************************
>
>
>>Dim LCDStr As New oBuffer20
>>Dim Sch As New oByte
>>Dim SP As New oSerialL
>>Dim i As New Integer
>>
>>Sub Main()
>> ooPIC.Delay = 4000
>> SP.IOLineS = 16
>> SP.IOLineF = 17
>> SP.Baud = cv9600
>> SP.Operate = cvTrue
>>
>> SP.Value = 12
>> SP.Value = 19
>> SP.Value = 4
>> SP.Value = 12
>>
>> Do
>>
>> SP.Value = 1
>>
>> LCDStr.VString = "Test"
>> For i = 0 To 4
>> LCDStr.Location = i
>> Sch.Value = LCDStr.Value
>> SP.Value = Sch
>> Next i
>>
>> Loop
>>End Sub
>>
>>
>>
>*********************************************************************
>
>
>>Thank you very much for helping.
>>
>>Regards,
>>Angelo
>>
>>--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@>
>>wrote:
>>
>>
>>>Your code is incorrect and it is my guess that your LCD doesn't
>>>
>>>
>>work,
>>
>>
>>>let me comment below:
>>>
>>>
>>>Angelo wrote:
>>>
>>>
>>>
>>>>Hi all,
>>>>
>>>>I hope someone can help me with this problem... I have been
>>>>
>>>>
>>fighting
>>
>>
>>>>with my ooPic for a week now with no luck :(
>>>>
>>>>Hardware:
>>>>(1) ooPic-r
>>>>(2) Devantech LCD03 (I2C)
>>>>(3) Laptop with RS232 Serial Port
>>>>
>>>>Objective:
>>>>Using Visual Basic 8 on a Laptop to transmit a short line of text
>>>>(String) over the RS232 Serial Port that will be displayed on
>>>>
>>>>
>the
>
>
>>LCD
>>
>>
>>>>on the ooPic-r
>>>>
>>>>Issues:
>>>>Converting the output(byte?) from the ooPic's received buffer to
>>>>
>>>>
>a
>
>
>>>>string to be displayed on the LCD
>>>>
>>>>Accomplished thus far:
>>>>(1) Visual Basic 8 software to send a line of text and received
>>>>
>>>>
>>and
>>
>>
>>>>convert bytes on a line of text(string)
>>>>(2) LCD03 setup
>>>>(3) Convert to string to byte to send to LCD03
>>>>
>>>>Could someone please help me figure out how to convert the data
>>>>coming from the serial port to a string that can be sent to the
>>>>
>>>>
>>LCD03?
>>
>>
>>>>Regards,
>>>>Angelo
>>>>
>>>>ooPic software thus far:
>>>>
>>>>
>>*********************************************************************
>>*
>>
>>
>>>>Dim LCD03 As New oI2C 'I2C Setup for LCD03
>>>>Dim LCDStr As New oBuffer20 'Buffer LCD String Conversion
>>>>Dim Sch As New oByte 'Temp Byte Location for LCD String
>>>>Dim SP As New oSerial 'Serial Port Setup for PC Communication
>>>>Dim i As New Integer
>>>>Dim j As New Integer
>>>>
>>>>Sub Main()
>>>> ooPIC.Delay = 4000 'Initializaion delay
>>>> 'Serial Port Configuration
>>>> SP.Baud = cv9600 'Serial Port Baud Rate
>>>> SP.Operate = cvTrue
>>>>
>>>>
>>>>
>>>>
>>> The SP stuff is unneeded. Your ooPIC R already has the serial
>>>
>>>
>>port
>>
>>
>>>set up as you defined.
>>>
>>>
>>>
>>>> 'LCD03 Configuration
>>>> LCD03.Node = 99 'I2C address for LCD03
>>>> LCD03.Width = cv10Bit
>>>>
>>>>
>>>>
>>>>
>>> This should be .Width = cv8Bit or cv16bit.
>>>
>>>
>>>
>>>> LCD03.Mode = cv10Bit
>>>>
>>>>
>>>>
>>>>
>>> This means that you are addressing the device internally as
>>>
>>>
>>registers,
>>
>>
>>>256 of them, correct?
>>>
>>>
>>>
>>>> LCD03.NoInc = cvTrue
>>>> LCD03.Value = 12 'Clear LCD03 Screen
>>>> LCD03.Value = 19 'Switch on LCD03 Screen
>>>> LCD03.Value = 4 'Remove cursor on LCD03 Screen
>>>> LCD03.Value = 12 'Clear LCD03 Screen
>>>>
>>>> Do
>>>> LCD03.Value = 1 'Start at home position on LCD03 Screen
>>>>
>>>>
>>>>
>>>>
>>> Are you sure about that? That should be just writing a value
>>>
>>>
>to
>
>
>>the
>>
>>
>>>device, I think that you should be accessing this some other
>>>
>>>
>way.
>
>
>>The
>>
>>
>>>LCD03 can be used either serial or I2C. I would use serial and
>>>
>>>
>use
>
>
>>an
>>
>>
>>>oSerialL line to talk to it rather than I2C. However if you are
>>>
>>>
>>going
>>
>>
>>>to use it in I2C mode you have to address one of the four
>>>
>>>
>>registers, I
>>
>>
>>>don't see you doing that (.Location= for instance).
>>>
>>>Lets start there and see if we can get things going.
>>>
>>>
>>>DLC
>>>
>>>
>>>
>>>> 'String input to LCD03
>>>> LCDStr.VString = "Test: " & Str$(j)
>>>> j = j + 1
>>>> 'Convert to Byte to send to LCD03
>>>> For i = 0 To 20
>>>> LCDStr.Location = i
>>>> Sch.Value = LCDStr.Value
>>>> LCD03.Value = Sch
>>>> Next i
>>>> Loop
>>>>End Sub
>>>>
>>>>
>>*********************************************************************
>>
>>
>>
>>>>
>>>>
>>>>
>>>>Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>--
>>>------------------------------------------------------
>>>Dennis Clark ooPIC Tech Support
>>>www.oopic.com
>>>------------------------------------------------------
>>>
>>>
>>>
>>
>>
>>
>>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:

http://docs.yahoo.com/info/terms/

No comments: