Searching \ for 'Building Text Strings in 16F84' 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/devices.htm?key=16F
Search entire site for: 'Building Text Strings in 16F84'.

Truncated match.
PICList Thread
'Building Text Strings in 16F84'
2000\03\05@221315 by Tom Wehn

flavicon
face
Hi all!

I am new to PICs (like the 16F84 didn't give it away). I would like to be
able to add a 5 digit number to a text string in memory. It seems to me I
should be able to #DEFINE a string with 00.000 for the number, then replace
it in memory. Problem is I have been unable to find the start of the
string. Am I on the right path here? Are strings that strange or is it me?

Thanks!!

Tom

2000\03\06@021102 by piclist.com

face picon face
Not quite sure what you are talking about. Do you mean "append the
conversion from binary to decimal ASCII of a number to a string in memory"?

If you are trying to convert a binary number to a text ASCII string, see:
http://www.piclist.com/faq
under Routines, Math, Base conversions.

PICs don't really do strings. They sort of do arrays (limited to a few
hundred 8 bit values via IND and indexed by the FSR) and if you have an
array that happens to be filled with ASCII values, you sort of have a
string. If you place the result of your number conversion just after that
array in memory, then you have appended it. But there are no string
processing or IO functions unless you program the PIC in a higher level
language like C.

What are you really trying to accomplish?

James Newton, PICList Admin #3
spam_OUTjamesnewtonTakeThisOuTspampiclist.com
1-619-652-0593 phone
http://www.piclist.com

{Original Message removed}

2000\03\06@062640 by Caisson

flavicon
face
> Van: Tom Wehn <.....tomwehnKILLspamspam@spam@EN.COM>
> Aan: PICLISTspamKILLspamMITVMA.MIT.EDU
> Onderwerp: Building Text Strings in 16F84
> Datum: maandag 6 maart 2000 4:11
>
> Hi all!

Hello Tom,

> I am new to PICs (like the 16F84 didn't give it away). I would like to be
> able to add a 5 digit number to a text string in memory. It seems to me I
> should be able to #DEFINE a string with 00.000 for the number, then
replace
> it in memory. Problem is I have been unable to find the start of the
> string. Am I on the right path here? Are strings that strange or is it
me?

It's You :-)

a #DEFINE does not allocate any memory (in ROM or RAM), but tell's your
assembler to replace the first string behind the #DEFINE by the second,
wherever he find's it in the source-file.  When you want to define som
*constant* strings or numbers, you will have to use the "dt" opcode.
  Example:

Label1 dt "Hello world",0  ; A Zero-terminated string (in the Program-ROM
!)

LabelA dt 123,'a',255  ;Multiple byte's (in the Program-ROM !)

If you want to create a "template" number, and want to change it's
content's, you will have to store all bytes one-by-one into the RAM-area.

Regards,
 Rudy Wieser

2000\03\06@070449 by Tom Wehn

flavicon
face
>Not quite sure what you are talking about. Do you mean "append the
>conversion from binary to decimal ASCII of a number to a string in memory"?
>
>
>PICs don't really do strings. They sort of do arrays (limited to a few
>hundred 8 bit values via IND and indexed by the FSR) and if you have an
>array that happens to be filled with ASCII values, you sort of have a
>string. If you place the result of your number conversion just after that
>array in memory, then you have appended it.
>What are you really trying to accomplish?

I have an 8 channel AD converter, a couple of op amps and a LCD wired to
make a Voltage, Current, and Watt monitor. So far I have written the serial
interterface for the AD, 16 bit math, keyboard and LCD routines. And I owe
it all the Piclist! All I want is to be able to build a string that reads
"Starting Volts 12.345" in memory so I can scroll several lines of data up
and down in the LCD. Now I am outputting a string and then the number. If I
could change that to a series of continuous memory locations it would help.

Thanks again!
Tom

2000\03\06@161609 by jamesnewton

face picon face
Just as I said, put the string in one place and start converting binary to
ASCII decimal in the next location.

I'd like to add your project to those listed at:
http://www.piclist.com/projects

Perhaps:
http://www.piclist.com/wehnmeter
?

Would you be willing to post the code and circuit description?

---
James Newton .....jamesnewtonKILLspamspam.....geocities.com 1-619-652-0593
http://techref.massmind.org NEW! FINALLY A REAL NAME!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)


{Original Message removed}

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