Flashing avrPrayog using Boot loader and a simple DIY USB circuit

Every avrPrayog board comes with a pre-programmed boot loader program so that the user program can be updated without having an external programming hardware like USBasp. Though avrPrayog itself does not have an USB connection onto it. User can build his/her own ultra low cost USB sketch loader.

The schematic of the USB circuit is as given below Solder the above circuit scheme onto a Perforated PCB and make connections to board pins as shown in the schematic.

Now follow the steps as…

  1. Make the connections as shown in the figure above. Connect D- to PD4 of Prayog and D+ to PD2 through 68 Ohms resistors.
  2. Now If you want to enable the boot loader for programming Short the Jumper JP6 that makes the PD7 pin Low and enables the bootloader.
  3. RESET the avrPrayog using On-board Reset Button.
  4. If everything goes well, after RESET, avrPrayog will emulate itself as USBasp to the HOST PC. (If not, please check the USB circuit and its connections to Prayog Properly)
  5. Now you can flash the Intel HEX file assuming you have USBasp connected to your PC. You can use avr-dude or any other standard programming application taht supports USBasp for In System Programming.
  6. Now if you want to program the avrPrayog board directly from Arduino IDE you can do that simply by Modifying the Boards.txt file of Arduino. I will show you how to do that next.

To add avrPrayog to the list of boards in Arduino follow these steps…

  1. Go to Arduino Folder (which is distributed by Arduino Officially)
  2. Go to the directory Hardware/arduino, Open boards.txt file.
  3. This boards.txt file contains the information about all the boards available to be programmed by Arduino IDE directly.
  4. Add following lines into Boards.txt
##############################################################
avrPrayog.name= avrPrayog w/ ATmega8, 16MHz
avrPrayog.upload.protocol=usbasp
avrPrayog.upload.maximum_size=7168
avrPrayog.upload.speed=19200
avrPrayog.bootloader.low_fuses=0x9f
avrPrayog.bootloader.high_fuses=0xc0
avrPrayog.bootloader.path=prayog
avrPrayog.bootloader.file=prayog_atmega8_16mhz.hex
avrPrayog.bootloader.lock_bits=0x2F
avrPrayog.build.mcu=atmega8
avrPrayog.build.f_cpu=16000000L
avrPrayog.build.core=arduino
avrPrayog.build.variant=standard
avrPrayog.upload.disable_flushing=true
##############################################################

Now Restart the Arduino IDE Window, You should be able to see avrPrayog as one of the boards under the menu Tools→Board. Select avrPrayog as your board.

You are almost done. Now write your program in Arduino IDE and load it directly from Arduino IDE itself. You just made a low cost and simple Arduino based development system.

For any Queries drop a mail at info@electroons.com


Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 32 bytes) in /home/electroo/public_html/wiki/inc/auth/plain.class.php on line 290