This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Programming Flash (AT49BV1614)

Hello!
i wanted to programm this flash (AT49BV1614).

So I copied the flash programming algorithms for AT49xV16x4A (Atmel Flash) and changed the flashdev.c and flashprog.c
But it won't work.

So I compared the datasheet from AT49xV16x4A with the algorithms from keil and found some difference:

The Algorithm from Keil for AT49xV16x4A:

int EraseChip (void) {

  // Start Chip Erase Command
  M16(base_adr + 0xAAA) = 0xAA;
  M16(base_adr + 0x554) = 0x55;
  M16(base_adr + 0xAAA) = 0x80;
  M16(base_adr + 0xAAA) = 0xAA;
  M16(base_adr + 0x554) = 0x55;
  M16(base_adr + 0xAAA) = 0x10;

  return (Polling(base_adr));  // Wait until Erase completed
}

The Hex Command definition from Atmel for AT49xV16x4A (Chip Erase):

1. Cycle: Adr: 555; Data = AA
2. Cycle: Adr: AAA; Data = 55
3. Cycle: Adr: 555; Data = 80
4. Cycle: Adr: 555; Data = AA
5. Cycle: Adr: AAA; Data = 55
6. Cycle: Adr: 555; Data = 10

As you can see the Adresses are different (seem to be inverted, but 554 and AAA?), but commands are equal, so i wonder how this can work?!?
This concerns also sector erase and programm.

In a simple test programm i tried to access the flash directly, with the commands from atmels datasheet. This seems to work fine.

Has anybody tried to write a flash prog. algorithm or an idea how to get it work?

  • "I compared the datasheet from AT49xV16x4A with the algorithms from keil and found some difference"

    This should come as no surprise!
    Different Flash chips have different algorithms - you just have to implement the correct algorithm for the chip you're actually using!

    This is why PROM programmers always have a list of supported devices!

    "In a simple test programm i tried to access the flash directly, with the commands from atmels datasheet. This seems to work fine."

    That's exactly as it should be - just do what the datasheet tells you!

  • Andy,

    I'm not sure, but I think what the poster was trying to say is that the algorithms from Keil that he attempted to use were stated to be the ones that DO work for his chip, but after checking the datasheet, he finds that's not the case.

  • "As you can see the Adresses are different (seem to be inverted, but 554 and AAA?), but commands are equal, so i wonder how this can work?!?"

    It's the difference between byte mode and word mode. The addresses are shifted up by one (e.g., AAA becomes 554 because the upper address bits are "don't care").

  • Thank You :-)
    that's exactly the information i was searching for!
    I'm sorry for my very very bad english