title: How to read/write to eeprom of xmega64a4u?
body: <p>I want to write to eeprom of xmega64a4u and read data from it</p>
  
  <pre><code>nvm_t.ADDR0 = EEPROM_START; //nvm_issue_command(NVM_CMD.[CCP_t.CCP_IOREG_gc]);
  nvm_issue_command(NVM_CMD_ERASE_EEPROM_gc); // erase eeprom
  //nvm_issue_command(NVM_CMDEX_bm); // Set the CMDEX bit in the NVM CTRLA register.
  
  nvm_wait_until_ready();
  nvm_t.DATA0 = char1;
  nvm_issue_command(NVM_CMD_LOAD_EEPROM_BUFFER_gc);       // load buffer
  nvm_t.ADDR0 = EEPROM_START;         
  
  
  nvm_wait_until_ready();
  nvm_t.ADDR0 = EEPROM_START;
  nvm_issue_command(NVM_CMD_ERASE_WRITE_EEPROM_PAGE_gc);      // erase and write eeprom
  
  nvm_wait_until_ready();
  nvm_t.ADDR0 = EEPROM_START;
  nvm_issue_command(NVM_CMD_READ_EEPROM_gc);          // read eeprom
  
  
  lcd_cmd(0x01);
  lcd_select_location(0x01,0x00);
  lcd_puts(nvm_t.DATA0);
  </code></pre>
  
  <p>is this the correct way to write and read? I have gone through the data sheets thoroughly, they have given the steps and i have written the code accordingly but it is not working.Actually here i have taken only a character which i want to store in the eeprom first, read it and display it on the lcd. The code shows no error, so i program it into the controller, but my lcd display remains empty. i cannot see the hard coded data on the display. I think i am making a mistake while writing the address.
  Please help as I am new to coding.Thanks in advance!</p>