Armscope firmware is simple and straightforward.
Main loop scheme:
- check for command from PC,
- execute command if complete command is received,
- check for trigger condition,
- collect samples if triggered (via internal slope trigger or PC CMD_FUNCTION_TRIGGER_EXECUTE request),
- if CMD_FUNCTION_FETCH_DATA was received send full data buffer or special "no data" frame to PC.
Toolset used is WinARM version 20070505. Other versions should work too.
Go to
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/#winarm
Code related to USB device is modified CDC example from Atmel.
Main difference is non-blocking read that allows continuous poll for commands from PC.
Atmel USB device/CDC framework does not require user to do any USB polling (like i.e. Microchip CDC for PIC18Fx5x0 family). This allows to block main loop for a long time collecting samples from ADC.
Armscope firmware is upgraded (or loaded in case AT91SAM7S was not programmed before) via SAM-BA USB bootloader. To allow this make sure BOOT pushbutton is accessible to user.
To load firmware unplug device, push BOOT, plug USB, wait about 10 seconds, unplug device, release boot. After this operation first two FLASH sectors will be overwritten by bootloader and device will be recognized as "atm 6124.Sys ATMEL AT91xxxxx test Board" and may ask for compliant driver. Load .bin file with PC SAM-BA application and replug device.