NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » AVR Simulator IDE - Nerdkit Display

April 24, 2015
by lnino
lnino's Avatar

Hey guys,

I am starting some new projects and because they are getting very large(too large for my 168) I bought a atmega328p. But it takes about a week when it will arrive. In the meantime I want to use the AVR Simulator IDE.

Has somebody some experience with that Simulator?

I think I understood everything right, but I don't get an Output on the virtual Display. Any ideas what is going wrong?

I am using the nerdkits library for the lcd Display. Pins connected to PortD.

Special greetings to Noter and Rick. How are you guys doing?

alt image text

alt image text

#define F_CPU 14745600

#include <stdio.h>

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>

#include <inttypes.h>
#include <string.h>

#include <util/delay.h>
#include "../libnerdkits/delay.h"

int main(void) {

  // fire up the LCD
  lcd_init();
  lcd_home();

  // print message to screen
  //             20 columns wide:
  //                     01234567890123456789
  lcd_line_one();
  lcd_write_string(PSTR("  Congratulations!  "));
  lcd_line_two();
  lcd_write_string(PSTR("********************"));
  lcd_line_three();
  lcd_write_string(PSTR("  Your USB NerdKit  "));
  lcd_line_four();
  lcd_write_string(PSTR("      is alive!     "));

  // busy loop
  while(1) {
    // do nothing
  }

  return 0;
}
April 25, 2015
by Rick_S
Rick_S's Avatar

I'm not familiar with that software, but you might want to change the clock speed to that of the Nerdkit (14.7546MHz) The delay libraries used with the Nerdkit are only accurate at that clock and if the simulated LCD expects proper timings, it may not initialize properly with the software set at the 8MHz clock shown in your photo above.

May 01, 2015
by lnino
lnino's Avatar

Hi Rick, thanks for your reply. But also with the correct MHz it won't work. No Problem for me, so I Wait for the arrival of the 328P. Thanks For Your help.

Post a Reply

Please log in to post a reply.

Did you know that you can build a digital read out (DRO) for a lathe or milling machine? Learn more...