Sign in

username:

password:



Not a member?

Search motoroladsp



Search tips

Subscribe to motoroladsp



motoroladsp by Keywords

56303 | 563xx | 5680 | 56805 | 5680x | 56F80 | 56F800DEMO | 56F805 | 56f807 | 56F830 | ADC | Bootloader | Codec | CodeWarrior | CW5 | CW6 | Debugger | DSP56303 | DSP56303EVM | DSP563xx | DSP5680 | DSP56800 | DSP56807 | DSP56858 | DSP56858EVM | DSP56F803 | DSP56F805 | DSP56F807 | DSP56F80x | DSP56F826 | DSP56F827 | DSP56F8xx | EVM | FFT | Flash_over_jtag | GPIO | Interrupt | Interrupts | JTAG | LCD | Linker | MCF5307 | Metrowerks | Modulus | MSCAN | PCMaster | PWM | Quad | Rif | RTOS | SDK | SPI

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Freescale DSPs | Compressed characters for Metrowerks Codewarrior for DSP56F807

Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).

  

Post a new Thread

Compressed characters for Metrowerks Codewarrior for DSP56F807 - Wim de Haan - Nov 14 15:47:00 2002

Hello,

I'm looking for a method to store 2 characters in 1 word, because I have not
enough data flash memory.

Normally you use:
char *line1={"AaBbCc"}; // 1 character in 1 word

This is possible:
struct bytes {
unsigned low_byte: 8;
unsigned high_byte: 8;} ;
struct bytes line2[3]={'A','a','B','b','C','c'};// 2 characters in 1 word

However this makes text not so well legible and time consuming to program.
Does somebody have a solution to store "AaBbCc" with 2 characters in 1 word?

Thanks in advance! Wim de Haan Exendis B.V.
W.J. de Haan
P.O.box 56, 6710 BB Ede
Keesomstraat 4, 6716 AB Ede
The Netherlands.
Tel: +31-(0)318 - 676305
mailto:
URL: http://www.exendis.com




______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )

RE: Compressed characters for Metrowerks Codewarrior for DSP56F807 - Art Johnson - Nov 14 16:40:00 2002

You can use either of the assembler directives 'DCB' or 'DCBR' (note that 'DCBR'
only applies to the 56800E processor). This will do what you want, but you
should be aware that the standard C library functions like strcpy(), strlen(),
strcat(), strcmp(), etc. will NOT work with these "packed" strings. If you want
to have functions that perform these operations, you will have to write them
yourself in assembler. Here is the section about the assembler directive 'DCB' from the CodeWarrior
on-line manual:

-------------------------------

DCB

Define constant byte.

[label] DCB arg[,arg,...,arg]

Remarks
The DCB directive allocates and initializes a byte of memory for each arg
argument. The arg may be a byte integer constant, a single- or
multiple-character string constant, a symbol, or a byte expression. The DCB
directive may have one or more arguments separated by commas. Multiple arguments
are stored in successive byte locations. If multiple arguments are present, one
or more of them can be null (two adjacent commas), in which case the
corresponding byte location will be filled with zeros.

If label is present, it will be assigned the value of the runtime location
counter at the start of the directive processing.

Integer arguments are stored as is, but must be byte values (e.g. within the
range 0-255); floating-point numbers are not allowed. Single- and
multiple-character strings are handled in the following manner:

Single-character strings are stored in a word whose lower seven bits represent
the ASCII value of the character.
Multiple-character strings represent words whose bytes are composed of
concatenated sequences of the ASCII representation of the characters in the
string (unless the NOPS option is specified; see the OPT directive). If the
number of characters is not an even multiple of the number of bytes per DSP
word, then the last word will have the remaining characters left-aligned and the
rest of the word will be zero-filled. If the NOPS option is given, each
character in the string is stored in a word whose lower seven bits represent the
ASCII value of the character.
Example
TABLE DCB 'two',0,'strings',0
CHARS DCB 'A','B','C','D'

------------------------------- Here is the section about the assembler directive 'DCBR' from the CodeWarrior
on-line manual:

-------------------------------

DCBR

Define constant with byte-order flip.

DCBR expression

Remarks
The DCBR directive is useful for defining byte strings with byte-order flip. The
byte-order flip allows C code to properly address the byte strings. This
directive applies to the 56800E processor.

------------------------------- I hope this information is helpful for you.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com
-----Original Message-----
From: Wim de Haan [mailto:]
Sent: Thursday, November 14, 2002 7:47 AM
To:
Subject: Compressed characters for Metrowerks Codewarrior for DSP56F807 Hello,

I'm looking for a method to store 2 characters in 1 word, because I have not
enough data flash memory.

Normally you use:
char *line1={"AaBbCc"}; // 1 character in 1 word

This is possible:
struct bytes {
unsigned low_byte: 8;
unsigned high_byte: 8;} ;
struct bytes line2[3]={'A','a','B','b','C','c'};// 2 characters in 1 word

However this makes text not so well legible and time consuming to program.
Does somebody have a solution to store "AaBbCc" with 2 characters in 1 word?

Thanks in advance! Wim de Haan Exendis B.V.
W.J. de Haan
P.O.box 56, 6710 BB Ede
Keesomstraat 4, 6716 AB Ede
The Netherlands.
Tel: +31-(0)318 - 676305
mailto:
URL: http://www.exendis.com



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )

RE: Compressed characters for Metrowerks Codewarrior for DSP56F807 - Simon Lightbody - Nov 14 17:19:00 2002

I think you can go 'Aa' (Ie., use single quotes around two characters)

-----Original Message-----
From: Wim de Haan [mailto:]
Sent: Thursday, November 14, 2002 7:47 AM
To:
Subject: [motoroladsp] Compressed characters for Metrowerks Codewarrior
for DSP56F807 Hello,

I'm looking for a method to store 2 characters in 1 word, because I have not
enough data flash memory.

Normally you use:
char *line1={"AaBbCc"}; // 1 character in 1 word

This is possible:
struct bytes {
unsigned low_byte: 8;
unsigned high_byte: 8;} ;
struct bytes line2[3]={'A','a','B','b','C','c'};// 2 characters in 1 word

However this makes text not so well legible and time consuming to program.
Does somebody have a solution to store "AaBbCc" with 2 characters in 1 word?

Thanks in advance! Wim de Haan Exendis B.V.
W.J. de Haan
P.O.box 56, 6710 BB Ede
Keesomstraat 4, 6716 AB Ede
The Netherlands.
Tel: +31-(0)318 - 676305
mailto:
URL: http://www.exendis.com _____________________________________
/groups.php3


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )

Re: Compressed characters for Metrowerks Codewarrior for DSP56F807 - Jacob Christ - Nov 14 21:47:00 2002

It appears that you can change the alingment boundary in the linker
by using the . = ALIGN(bytes) command. This would require that you
create a special section for you compressed strings,
say .compressed_strings. It looks like that you will then need to
have a seprate file just for your constant data that can be assigned
in the linker file to the .compressed_strings section.

If I have time later today I'll try it out myself.

Jacob Christ
www.pontech.com
Motorola DSP Developemt Tools

--- In motoroladsp@y..., Wim de Haan <w.d.haan@e...> wrote:
> Hello,
>
> I'm looking for a method to store 2 characters in 1 word, because I
have not
> enough data flash memory.
>
> Normally you use:
> char *line1={"AaBbCc"}; // 1 character in 1 word
>
> This is possible:
> struct bytes {
> unsigned low_byte: 8;
> unsigned high_byte: 8;} ;
> struct bytes line2[3]={'A','a','B','b','C','c'};// 2 characters in
1 word
>
> However this makes text not so well legible and time consuming to
program.
> Does somebody have a solution to store "AaBbCc" with 2 characters
in 1 word?
>
> Thanks in advance! > Wim de Haan > Exendis B.V.
> W.J. de Haan
> P.O.box 56, 6710 BB Ede
> Keesomstraat 4, 6716 AB Ede
> The Netherlands.
> Tel: +31-(0)318 - 676305
> mailto:w.d.haan@e...
> URL: http://www.exendis.com



______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )

Re: Compressed characters for Metrowerks Codewarrior for DSP56F807 - Jacob Christ - Nov 14 23:08:00 2002

Wim,

I tried it, it doesn't work, although the maunal says that the ALIGN
command will align to the byte, it only aligns to the word.

Borland C++ Builder has a compiler pragma to do this, but I could
find no such pragma in my Metorwerk DSP Compiler manual. Might be a
good feature in the future, I'm not out of space (yet) so I can wait
but you might start contacting MW.

Jacob
www.pontech.com
Motorola DSP Developemt Tools

--- In motoroladsp@y..., "Jacob Christ" <jacob@p...> wrote:
> It appears that you can change the alingment boundary in the linker
> by using the . = ALIGN(bytes) command. This would require that you
> create a special section for you compressed strings,
> say .compressed_strings. It looks like that you will then need to
> have a seprate file just for your constant data that can be
assigned
> in the linker file to the .compressed_strings section.
>
> If I have time later today I'll try it out myself.
>
> Jacob Christ
> www.pontech.com
> Motorola DSP Developemt Tools
>
> --- In motoroladsp@y..., Wim de Haan <w.d.haan@e...> wrote:
> > Hello,
> >
> > I'm looking for a method to store 2 characters in 1 word, because
I
> have not
> > enough data flash memory.
> >
> > Normally you use:
> > char *line1={"AaBbCc"}; // 1 character in 1 word
> >
> > This is possible:
> > struct bytes {
> > unsigned low_byte: 8;
> > unsigned high_byte: 8;} ;
> > struct bytes line2[3]={'A','a','B','b','C','c'};// 2 characters
in
> 1 word
> >
> > However this makes text not so well legible and time consuming to
> program.
> > Does somebody have a solution to store "AaBbCc" with 2 characters
> in 1 word?
> >
> > Thanks in advance!
> >
> >
> > Wim de Haan
> >
> >
> > Exendis B.V.
> > W.J. de Haan
> > P.O.box 56, 6710 BB Ede
> > Keesomstraat 4, 6716 AB Ede
> > The Netherlands.
> > Tel: +31-(0)318 - 676305
> > mailto:w.d.haan@e...
> > URL: http://www.exendis.com


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of motoroladsp -- send a blank email to motoroladsp-subscribe@yahoogroups.com )