Searching \ for '[PIC] Search Code for String Output to character d' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=output
Search entire site for: 'Search Code for String Output to character d'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Search Code for String Output to character d'
2005\11\02@062435 by ens M. Guessregen

flavicon
face

Hello,

Does anyone has a assembler-code for sending out a string to character
display?
I do not need the controller code for the LCD itself, just a code to
transform a string into single characters.

Right now, I have to define every character for itself, which is not
very elegant.

Thx

Jens

2005\11\02@064234 by Jan-Erik Soderholm

face picon face
Jens M. Guessregen wrote :

> Does anyone has a assembler-code for sending out a
> string to character display?

In assembler context, what do you mean with a "string" ?

> I do not need the controller code for the LCD itself, just a code to
> transform a string into single characters.

Again in assmebler context, what is the difference ?

A "string" is just a number of characters (or rather bytes, since
that's the only data type assembler knows about).

Maybe you should look up the FSR's to make indexed
addressing !?

> Right now, I have to define every character for itself,
> which is not very elegant.

That's is very hard to comment on, since youre hiding
what you are doing. An example maybe ?

You're also hiding what PIC model you're using, which
makes it even harder...


Jan-Erik.



2005\11\02@070332 by ens M. Guessregen

flavicon
face
Hello,

> > Does anyone has a assembler-code for sending out a string
> to character
> > display?
>
> In assembler context, what do you mean with a "string" ?

Ok, a string is not cvalid in assembler. Better : I want to define a
string in the source-code.

> > I do not need the controller code for the LCD itself, just
> a code to
> > transform a string into single characters.
>
> Again in assmebler context, what is the difference ?

In assembler, there is no difference.

Better : I want tofind a easy way to define a string in the source code,
which will be transformed to single characters, which will be send to
LCD.

> A "string" is just a number of characters (or rather bytes,
> since that's the only data type assembler knows about).
>
> That's is very hard to comment on, since youre hiding what
> you are doing. An example maybe ?

I just try to make this wit an macro. Maybe this will work out.

> You're also hiding what PIC model you're using, which makes
> it even harder...

PIC is 16F872.

Best Jens

2005\11\02@072609 by David Van Horn

picon face

I'm not sure what you're asking exactly, but one common technique is to
point to a string in rom, which is terminated with a null, then call a
routine that passes each non-null char to the output device.  

Implementations vary, I've also seen counted strings where the string
starts with a byte that indicates how many chars in the string. This is
useful if the string must contain nulls (00h)




2005\11\02@074408 by Jinx

face picon face
> Better : I want tofind a easy way to define a string in the source code,
> which will be transformed to single characters, which will be send to
> LCD.

Bit rusty myself on some, but there are several options, some static,
some dynamic. How you retrieve them from memory depends on
how you choose to store them

For exmple

 data "123456"  ;stores 2 numbers per word

 data 'A','B','C'  ;stores letter + 00 per word (2 letters / word on 18F)

 data 0x41,0x42,0x43  ;stores letter + 00 per word (ditto)

 dt "ABCDEF"  ;creates retlws

 de to store in EEPROM at programming time

org to store text in Flash at programming time

#define text "abcdef"

etc etc etc

What exactly is the source of these strings ?

2005\11\02@083053 by ens M. Guessregen

flavicon
face

I just tried as following:


;-----------------------------------------------------------------------
----------
; lcdmacro for textstrings
jmg/02.11.2005

lcdstring macro        text                                ; text of max 16
character

               local        Message
               local Start        
               local        stop
               local        i=0

               goto        Start

               dt                text                        ; form a lookup
table from parameters
               dt                0

Start        

               while i<16
               call        Message+i
               addlw        0
               bz        stop
               movwf        DisplayData                        ; load w to
DisplayData (defined in header)
               call        LCDout                        ; print out Data from
DisplayData        
i += 1
               endw
stop                                
               endm

;-----------------------------------------------------------------------
----------



But using it in code with:

       lcdstring "test"


Brings me lots of errors, all like this:

Error[118]   C:\WORK\PIC\LCD.INC 487 : Overwriting previous address
contents (0020)
Error[118]   C:\WORK\PIC\LCD.INC 487 : Overwriting previous address
contents (0020)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0021)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0021)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0022)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0022)
Error[118]   C:\WORK\PIC\LCD.INC 489 : Overwriting previous address
contents (0023)
Error[118]   C:\WORK\PIC\LCD.INC 489 : Overwriting previous address
contents (0023)
Error[118]   C:\WORK\PIC\LCD.INC 490 : Overwriting previous address
contents (0024)
Error[118]   C:\WORK\PIC\LCD.INC 490 : Overwriting previous address
contents (0024)
Error[118]   C:\WORK\PIC\LCD.INC 486 : Overwriting previous address
contents (0025)
Error[118]   C:\WORK\PIC\LCD.INC 486 : Overwriting previous address
contents (0025)
Error[118]   C:\WORK\PIC\LCD.INC 487 : Overwriting previous address
contents (0026)
Error[118]   C:\WORK\PIC\LCD.INC 487 : Overwriting previous address
contents (0026)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0027)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0027)
Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting previous address
contents (0028)
.........


Any idea?

Best Jens

2005\11\02@155238 by Jinx

face picon face
> Error[118]   C:\WORK\PIC\LCD.INC 488 : Overwriting
> previous address contents (0028)
>
> Any idea?

What is happening is that a memory range containing code or
data is being over-written by other code or data

eg say you have a data table at 0x200 and a small program
from 0x20 to 0x1f0. Add another routine to the program and
it'll over-write the table

You need to manage where in memory your code and data
are going to live

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...