Do you have enough ram in your msp430 for 1024 buffer? Or are you using external ram? consider using an external fifo like https://www.ti.com/lit/ds/symlink/sn74v293.pdf
thanks for valuable commands.. my doubt is how to choose ram size.. for example if i want to store 1024 value in buffer. each value size will be in 2byte so my ram size should be more than 2k byte (1024x2=2048)..well,
msp430 does not support external memory addressing, meaning if you need more memory you will have to interface it yourself with a cost of both GPIO's and efficiency...
so, either you choose a msp430 series with enough ram for your needs, or you will have to use external memory... there are IC's that provide lot of solutions on this subject.. you can have them interfaced by a bus, or by SPI or I2C. I've suggested that FIFO as an example for an DAC or ADC bus interfacing...
sorry, but I don't know much more about the subject... If ram is really an issue you should have a look on ATmega uC... I know there a few models that support external memory addressing..
Code C - [expand] 1 2 3 4 5 struct fifo_node { struct fifo_node *next; value_type value; };
well, if is an array, is not a fifo =);
the advantage of the struct is that the data does not need to use sequential physical positions on the memory, so you can add nodes in any free position available, or delete nodes this way having a dynamic size... to do that with an array, you will have to copy the full modified array to another place in memory (than you still using the double of the memory and plus, it need to be sequential free space).. anyway, you wouldn't have that problem since you are using a fixed size array, but you will have a processor overhead while processing the reorganization of the list when it changes) ... for example if you have 1000elements, each time you eliminate one element you will have to reorganize 999 elements... no problem if processor efficiency is not an issue for your application, but when it comes about FIFO's it usually is...
_______
I'm sorry, I'm feeling quite stupid now... I totally forgot that with a fixed size you can have a "ring FIFO", https://en.wikipedia.org/wiki/Circular_buffer , (.. this way the array is not a good option.. only need to check the overflow...)
so with ring fifo, you only need
2048 + 2 for buffer array
2 for current last position
2 for current first position
hi ..
I tried the coding by means of array its working properly but the problem is if my array size is 1000
value means after reading the one value from FIFO i need to swap the array location ..
so for this it s taking large time.. so i thought to use external fifo memory..so please guide me
regarding how to interface external FIFO buffer with msp430. Is there any sample code is available
for interfacing FIFO??
#define BUFSIZE 1024
uint16 MyBuffer[BUFSIZE];
uint16 * read_ptr;
uint16 * write_ptr;
read_ptr = MyBuffer;
write_ptr = MyBuffer;
*write_ptr = new_val;
write_ptr++; // By the way, you can do directly *write_ptr++ = new_val, but this might be better at debug time
if(write_ptr >= MyBuffer + BUFSIZE) write_ptr -= BUFSIZE;
val_to_read = *read_ptr;
read_ptr++; // By the way, you can do directly val_to_read = *read_ptr++, same as above
if(read_ptr >= MyBuffer + BUFSIZE) read_ptr -= BUFSIZE;
whether its enoughy for my 1024 samples ??how can i verify this??
is there any thing possible to know my code size and memory utilization of my code
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?