Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).
Hi all,
Probably showing my ignorance here, but its beginning to try my
patience so I thought I'd turn to the group.
I'm trying to define an array of 512-bytes using the c5510, and
define it as follows:
Uint8 configBuffer[512] = {1,2,3,4 ... 511, 512};
But when I use the Code Composer to view the memory where the array
has been created, it appears to have stored them as 16-bit words
i.e. It displays 0x0001, 0x0002, 0x0003, and so on.
This is also true of the watch window where, although it displays
Uint8 type for each element, each element is displayed as a 16-bit
word.
I want to use a 16-bit pointer to send the 512-byte buffer to an
external peripheral using 256 16-bit transactions, but when I do
this, I get the first 256 bytes of my buffer, each extended to 16-
bit words with 0x00 for the MSB e.g. I get 0x0001, 0x0002, ... when
I was hoping to get 0x0102, 0x0203, ...
Does anyone have any ideas where I am going wrong ?
Cheers,
Scotty
Hi,
You are not going wrong at all :)
The minimum addressable unit for the c55x architecture is 16bit.
Addressing data with an Uint8 or Uint16 pointer give back the same
result (16bit value). Also try sizeof(char). You will be surprised. This
causes a lot of troubles when writing code with data stored both as
16bit and 8bit values.
Regards,
Marko
smiffoz wrote:
> Hi all,
>
> Probably showing my ignorance here, but its beginning to try my
> patience so I thought I'd turn to the group.
>
> I'm trying to define an array of 512-bytes using the c5510, and
> define it as follows:
>
> Uint8 configBuffer[512] = {1,2,3,4 ... 511, 512};
>
> But when I use the Code Composer to view the memory where the array
> has been created, it appears to have stored them as 16-bit words
> i.e. It displays 0x0001, 0x0002, 0x0003, and so on.
>
> This is also true of the watch window where, although it displays
> Uint8 type for each element, each element is displayed as a 16-bit
> word.
>
> I want to use a 16-bit pointer to send the 512-byte buffer to an
> external peripheral using 256 16-bit transactions, but when I do
> this, I get the first 256 bytes of my buffer, each extended to 16-
> bit words with 0x00 for the MSB e.g. I get 0x0001, 0x0002, ... when
> I was hoping to get 0x0102, 0x0203, ...
>
> Does anyone have any ideas where I am going wrong ?
>
> Cheers,
>
> Scotty
>
>
>
---- Quoted message ----
1. c5510 - Array of bytes
Posted by: "smiffoz" s...@yahoo.co.uk smiffoz
Tue Aug 15, 2006 6:22 am (PST)
Hi all,
Probably showing my ignorance here, but its beginning to try my
patience so I thought I'd turn to the group.
I'm trying to define an array of 512-bytes using the c5510, and
define it as follows:
Uint8 configBuffer[512] = {1,2,3,4 ... 511, 512};
But when I use the Code Composer to view the memory where the array
has been created, it appears to have stored them as 16-bit words
i.e. It displays 0x0001, 0x0002, 0x0003, and so on.
This is also true of the watch window where, although it displays
Uint8 type for each element, each element is displayed as a 16-bit
word.
I want to use a 16-bit pointer to send the 512-byte buffer to an
external peripheral using 256 16-bit transactions, but when I do
this, I get the first 256 bytes of my buffer, each extended to 16-
bit words with 0x00 for the MSB e.g. I get 0x0001, 0x0002, ... when
I was hoping to get 0x0102, 0x0203, ...
Does anyone have any ideas where I am going wrong ?
Cheers,
Scotty
---- End quoted message ---
I believe this is due to the fact that the C55 can only address memory
in 16-bits (16-bit MAU.) This means, for example, address 0x1 is
16-bits beyond address 0x0.
If you want to manipulate bytes individually, you have to OR them
together and write them one word at a time.
This is one reason string manipulation is a major pain for a DSP...
Ralph Walden