_______ ( ____ \ | ( \/ | (_____ (_____ ) ) | /\____) | \_______)
###### # ## ## ## # ######
### ## ### ## ## ## ## ## ### ## ## ## ###
_______ ( ___ ) | ( ) | | | | | | | | | | | | | | (___) | (_______)
## ## #### ## #### ## ##
IMPORTANT: enter the case-INsensitive alphabetic (no numbers) code AND WRITE SOME SHORT summary of changes (below) if you are saving changes. (not required for previewing changes). Wiki-spamming is not tolerated, will be removed, so it does NOT even show up in history. Spammers go away now. Visit Preferences to set your user name Summary of change: Now that you did the previous steps on OnlineCourse, '''you succeeded to compile and upload the application to the GenBoard''' it's time to write your first addition. The ''"Hello World"'' application for microcontrollers is ''blinking LEDs''. On GenBoard/VerTwo you can use the small SMD LED on PORTA3 (this is inverted! lights up on output=0) or the NPN driven LEDs on PORTA4..7 pins. The best place to stick your code is ''megasquirt.c'', ''main()'' function, right after ''ioinit()''. ''ioinit()'' set these ports to output with the ''DDRA=...'' instruction. The simplest way to do the delay is with a busyloop (untested code, but should work): uint16_t inner; uint8_t outer; #define MASK (0xF8) for(outer=0xff; outer; outer--) for(inner=0xffff; inner; inner--) PORTA = (PORTA & ~MASK) | (outer & MASK); You could say it's unnecessary to write the same value 65536*8 times to the PORTA bits (bits that are high in the MASK). But this makes sure that GCC does not optimize the cycles away (which it could if we put in a ''nop()'' inside). After this is executed, (in a few seconds for 16MHz clock), the MS-AVR application will start. Go back to OnlineCourse Optional: Add document to category: Wiki formatting: * is Bullet list ** Bullet list subentry ... '''Bold''', ---- is horizontal ruler, <code> preformatted text... </code> See wiki editing HELP for tables and other formatting tips and tricks.