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 | DSP56F800 & CodeWarrior

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

  

Post a new Thread

DSP56F800 & CodeWarrior - Mariano Filippa - Dec 29 9:14:00 2003

Hello again,
 
Hope somebody can give me a hand with this. I've been struggling with CodeWarrior, and haven't found an answer for the following question:
 
1) How should I declare/define variables in C ? How should I declare/define peripherals? for example:
 
I'm using external memory and ...
MyVar1 = initialized variable to be placed in internal X memory (should use short addressing mode to access)
MyVar2 = initialized variable to be placed in external X memory (normal addressing mode)
SCI_Reg1 = SCI register in internal X memory (should use short addressing mode)
 
The linker would group these variables in the < .data > section and the linker command file cannot separate them into different segments. How can I separate them into different segments and force short addressing when needed?
 
2) If I were to access registers with C, I'd use the following:
 
#define SCI0_SCIBR  *(char volatile *)(SCI0_BASE+0)    /* Baud Rate Register */
SCI0_SCIBR = 0x0080;
 
Which gives me >> movei    #128,X:0x0f00  
 
This is incorrect if I were to use external mode. The compiler should use short addressing. How can I do this ??? Is there any other wat of defining peripherals in C ?
 
Thanks for your help !
MPF







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

Re: DSP56F800 & CodeWarrior - Robert Wood - Dec 30 11:49:00 2003

I'm not sure whether I understand your question properly, but here's my
attempt at answering it!

First for question two:

Have a look at the snippet from the 5680x header file that we modded slightly
from the one Metrowerks provided. We did this so we could do stuff like:

SCI0_SCIBR = 0x0080;

-------------------------------------------------------------------------------- \
-------------------------------------------------------

/* Serial Communications Interface (SCI) */
#define SCI0_BASE 0x1300

#define SCI0_SCIBR (*(volatile char*)(SCI0_BASE + 0)) /* Baud rate
generator */
#define SCI0_SCICR (*(volatile char*)(SCI0_BASE + 1)) /* Control
register */
#define SCI0_SCISR (*(volatile char*)(SCI0_BASE + 2)) /* Status
register */
#define SCI0_SCIDR (*(volatile signed char*)(SCI0_BASE + 3)) /* Data
register (read in - write out) */

-------------------------------------------------------------------------------- \
-------------------------------------------------------

I don't know about your first question, I've only ever used the internal RAM
and data flash. I'm sure someone else out there must have done it!

Cheers,

Rob

Hello again,

Hope somebody can give me a hand with this. I've been struggling with
CodeWarrior, and haven't found an answer for the following question:

1) How should I declare/define variables in C ? How should I declare/define
peripherals? for example:

I'm using external memory and ...
MyVar1 = initialized variable to be placed in internal X memory (should use
short addressing mode to access)
MyVar2 = initialized variable to be placed in external X memory (normal
addressing mode)
SCI_Reg1 = SCI register in internal X memory (should use short addressing
mode)

The linker would group these variables in the < .data > section and the linker
command file cannot separate them into different segments. How can I separate
them into different segments and force short addressing when needed?

2) If I were to access registers with C, I'd use the following:

#define SCI0_SCIBR *(char volatile *)(SCI0_BASE+0) /* Baud Rate Register
*/
SCI0_SCIBR = 0x0080;

Which gives me >> movei #128,X:0x0f00

This is incorrect if I were to use external mode. The compiler should use
short addressing. How can I do this ??? Is there any other wat of defining
peripherals in C ?

Thanks for your help !
MPF


______________________________
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: DSP56F800 & CodeWarrior - Mariano Filippa - Jan 7 17:54:00 2004

> I have the same problem as you discribed with short addressing and
> peripheral from C.
>
> Have you managed to solve the problem ?
> I have tried the suggestion from Robert but it does not help me.
> Right now I have done a stupid work around with assemble code inside
> C. With the movep statement.

The only way I can do it is with inline assembly. I was told (by Lubomir,
Motorola) that "...codewarrior doesn't make difference between x-mem and
p-mem pointers ...". I guess that it doesn't make any difference between
short and long addressing either. I assume that it always points to data
memory using 16-bit addressing. I couldn't find anything on targeting about
addressing. And there is no intrinsics for this either.

**** For assembly language, I am trying the following:

I duplicate my registers/memory definitions, with some prefix, like:
#define asmPLLCR (CLKGEN_BASE+0x0) /* Control Register */

Then I define the following:
#define WriteShort(A, B) asm( move #A , X:<<B )

Then access as: WriteShort(0x300,asmPLLCR);

It is not working for me. I haven't tried much but maybe you can figure out
if it will work or not. The great advantage is that WriteShort is not a
function call. It will give you just one move instruction.

I am still pretty lame with assembly, so I assume that the code I included
is wrong. Maybe you should modify it like this, with two move operations:
#define WriteShort(A, B) asm( move #A , Y0 ; move Y0, X:<B )

Hope this helps. Please let me know if you found a way of making this work.
Mariano


______________________________
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 )