Advertisement

Firmware and software design

The firmware was developed using open source library ‘Lightweight USB Framework for AVR,’ commonly known as LUFA. It requires free compiler WinAVR GCC 2010 to be installed in your PC. It is advised to install AVR Studio 4 before WinAVR as programming and compilation are easier in AVR Studio. Now load project file GenericHID.aps file (from www.efymag.com or EFY DVD of this month’s EFY Plus) into AVR Studio environment. Compile the code to generate the hex code.

Burning the hex code. Microcontroller AT90USB1287 comes with a preloaded bootloader program that can be used to burn a hex file through USB using ATMEL Flip software.

Fig. 3: An actual-size, double-side, solder-side PCB track layout of USB data acquisition system
Fig. 3: A double-side, solder-side PCB track layout of USB data acquisition system
Fig. 5: Component layout
Fig. 5: Component layout
Fig. 4: Component-side track layout
Fig. 4: Component-side track layout
Fig. 6: The author’s assembled board with input and output pin details
Fig. 6: The author’s assembled board with input and output pin details
Fig. 7: GUI for DAQ device communication using C# program
Fig. 7: GUI for DAQ device communication using C# program

Download PCB and Component Layout PDFs: Click here

Download Source Code: Click here

Press S3 (HWB) button and S2 reset button simultaneously and then first release S2 while S3 is pressed. This will put the board into an inbuilt bootloader programming mode. In programming mode, the board can be seen in device manager of the PC. You can load the hex code into the MCU using ATMEL Flip programmer.

But to make a generic code run with read and write support in flash memory, you need to erase the entire flash (default bootloader) and load a new bootloader called ‘ATMEL USB DFU Bootloader’ from ATMEL’s website. This also enables the microcontroller to run at its full speed of 16 MHz. You just need to make necessary changes in the fuses to make it run with external clock of 16 MHz (without CKDIV8 fuse enabled). Now burn the new bootloader using any ISP programmer by connecting the programmer to the ISP connector on the board.

User-interface program

After assembling the components on the PCB, you need to interface the board with the PC for data exchange. For that, you have software that communicates with the physical hardware through USB interface using its device driver dynamic link library (DLL). The graphical-user-interface (GUI) software was developed using Microsoft Visual C# 2010.net and NI LabView Version 8.6 (2008).

The hardware developed has the firmware loaded onto the flash memory of the microcontroller on the DAQ board. To design the GUI program, first you need to know how the firmware in the board and the PC should communicate.

Advertisement


9 COMMENTS

SHARE YOUR THOUGHTS & COMMENTS

Please enter your comment!
Please enter your name here