How to work w external parallel SRAM in CVAVR ? ATmega64 or so.
Any example please .
Regards !
How to work w external parallel SRAM in CVAVR ? ATmega64 or so.
Any example please .
Regards !
That's a rather vauge question. Can you give more details on what you are looking for?
I have used the external memory interface on a mega162 to connect a 2kx8 sram, and a 2kx8eeprom. Worked flawlessly.
Here is a snippet of what I did. It is not the complete code, but it is a start.
Jim
When you 'turn on' the external memory interface, the rd wr and ale pins start working, and porta and portc become the address bus... the datasheet shows using an 8 bit latch on portc.. this latches the hi byte of the addr on the 1st cycle, then on the next cycle, data comes out on porta and lo byte off addr hops out on portc, so you sort of need to buy a board with the external memory latch and ram already there unless you are good with a pclayout program. But turning on the memory is just poke a couple magic numbers into the external memory control register. Then the memory suddenly appears at ram address 0x1100 to 0x7fff. You access it through pointers initialized to the address you want to read or write.
Well said Bob.
Let's see what the OP comes back with.
Jim
You should be able to find many schematics and discussions of attaching external SRAM to an appropriate AVR such as the Mega64. The datasheet has information on address mapping. Have you looked for app notes?
The CodeVision manual/Help has a section on Setting the External SRAM.
What particular questions do you have? What have you done so far?
Thanks to ALL !
The CodeVision manual/Help has a section on Setting the External SRAM.What particular questions do you have? What have you done so far?
SRAM is coneccted as in stk501
http://www.atmel.com/dyn/product...
I need some C code example of bsic read write for char or int var's and init XRAM source code.
CodeVision manual/Help has no that one. Google too !
Well either your C compiler can simply be configured to locate its heap/.data/.bss/stack into the external RAM space (though watch for performance hit with wait states) or in the most simplistic sense, Say your AVR has the ext-mem mapped to 0x4000 then:
unsigned char * ptr = (unsigned char *)0x4000; *ptr = 'a'; if (*ptr == (unsigned char)'a') {
uses a pointer set to an absolute location to access that memory. You can extend this further with something like:
typedef struct { int n; char c; long l; unsigned char array[20]; int n_array[10]; } myvars_t; myvars_t * ptr = (myvars_t *) 0x4000; ptr->l = 123456789; ptr->c = 'x'; ptr->n = 31000; memcpy(&ptr->array, buffer, 10); if (ptr->n_array[5] == 32) {
which would dump a whole bunch of variables at location 0x4000 onwards.
Cliff
Thanks !