Data Ram alignment

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
spectric
Posts: 74
Joined: 05 Jan 2007 20:12
Location: Cumbria, Uk

Data Ram alignment

#1 Post by spectric » 12 Mar 2022 13:53

Hi there

I am looking at an array to store received messages from the CAN module, the buffers can be located anywhere in device RAM, (DATA) space but the documentation states the start address of this buffer may be need to be aligned on an address boundary.

My declaration is:

data unsigned int CAN1MsgBuf[16][8];

Looking at the example given by Microchip they have an attribute to ensure alignment, unsigned int can1MsgBuf[NUM_OF_CAN_BUFFERS][8]__attribute__((aligned(NUM_OF_CAN_BUFFERS * 16)));

What is the Mikro equivalent of this attribute called aligned please.

Also where can I download the latest manual for Mikro C Pro

thanks Roy
all the best Roy

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Data Ram alignment

#2 Post by filip » 25 Mar 2022 10:28

Hi,

Can you please tell me which MCU are you using ?

Regards,
Filip.

spectric
Posts: 74
Joined: 05 Jan 2007 20:12
Location: Cumbria, Uk

Re: Data Ram alignment

#3 Post by spectric » 25 Mar 2022 16:26

Hi there

I am looking at the DSPIC33EP512MU810 processor, it is one you sell for the prototyping boards.

thanks Roy
all the best Roy

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”