Re: Large buffers
"petermcs" <petermcs-/[email protected]>
| Newsgroups | gmane.comp.hardware.rabbit-semiconductor |
|---|---|
| Message-ID | <[email protected]> |
Dynamic C has trouble accessing arrays over 32K in length but will allow you create them. For example I have the following in my code: bbram far TL_DATA_REC Logs[TL_DEFAULT_LOGS][TL_DEFAULT_ENTRIES]; which allocates 192000 bytes as TL_DATA_REC is 10 bytes in length and the array is 8x4000; I then use far pointers to TL_DATA_RECs to access the data in the arrays. The advantage of doing this is that the arrays are allocated at compile time so you know exactly where they will end up and how much memory is left over afterwards - xalloc() can fail dependinf on fragmentation etc so you need to do run time checks when you allocate using it. Regards, Peter --- In [email protected], "Jesus Manuel Conejo Sarabia" <jmconejo@...> wrote: > > > > Hi Phil, > > Thanks for the answer. I will try what you say. > > > > Thanks > > Jesus > > > > > > > > > > De: [email protected] [mailto:[email protected]] En > nombre de Phil D > Enviado el: jueves, 16 de mayo de 2013 10:03 > Para: [email protected] > Asunto: Re: [rabbit-semi] Large buffers > > > > > > the XMEM functions allow for some large arrays to be stored biggest i have > is 150 x 100 but you could make something bigger. > > im using my xmem to store some large data structures heres an example of > initialisation > > Zone_point is a long holding starting address. > > > > Zone_point=xalloc(sizeof(Zone_XMEM)*ZONE_MAX);//Allocate zones in xmem > > for(x_i=0;x_i<(sizeof(Zone_XMEM)*ZONE_MAX);x_i+=sizeof(Zone_XMEM)){ > > root2xmem(Zone_point+x_i, &Zone_XMEM, sizeof(Zone_XMEM) ); > > } > > > > > > getting somthing out eg > > > > xmem2root(&ZoneD, Zone_point+(n*sizeof(ZoneD)), sizeof(ZoneD)); > > > > Phil > > > > > > On 15 May 2013 21:48, Jesus Manuel Conejo Sarabia > <jmconejo@...> wrote: > > > > Hi!, > > I'm working in a project with a Rabbit6000 and a little cam. > I want to store temporaly frames of the cam. I'm testing on using the RAM > (variables, large arrays) to store the frames but I have not enough space. I > don't want to use RCM modules with serial eeprom or sd cards because as you > know the eeproms have limits on the number of writings so the idea is to use > RAM. Have you experience using large buffers on RAM (variables). Have you > touched on BIOSLIB to get this way?, which is the limit? > > > > Thanks > > Jesus >