-
Notifications
You must be signed in to change notification settings - Fork 0
License
ls4096/avrsysh
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The "avrsysh" project is a system and interactive shell which explores some of the capabilities of AVR MCUs. Currently supported are the ATmega328P (used on boards such as the Arduino Duemilanove and Arduino Uno), the ATmega2560, and the ATmega32U4. This system must be able to run within the memory constraints of each of the various supported MCUs (32-256 KB for instructions, and 2-8 KB SRAM for data), so it is an interesting challenge to see how much can be accomplished in each case. The system works within these limits, and there is room for additional features still, especially with more memory available on the ATmega2560. NOTE: The build as it is configured assumes a 16 MHz core clock, which is the default configuration on the Arduino boards. If running with a different clock, the F_CPU value should be modified accordingly. Other things may also misbehave at different clocks (such as the ADC, where the prescale factor used may need to be changed, and possibly the serial communication if the timings don't quite match up), but it should be possible to resolve with some minor code modifications or playing with some defined constants. Some AVR MCU functionality used: - Timer - Serial communication using the USART (additional USART on ATmega2560 can be used for serial proxying to communicate with another board). - ADC to estimate the chip's internal temperature (ATmega328P only) - Some very basic power management using the "sleep" instruction Features of "avrsysh" include: - A lightweight "shell" from which to launch built-in commands - with limited use of VT100 codes to support "backspace", "up" for previous command, and for clearing the screen - tab completion support - Some system utilities, including a "CPU usage" counter and a stack pointer monitor which samples the stack pointer and can help with estimating memory "usage" over time - Some basic shell utilities commonly found on Unix-like systems, like "grep" and "seq" - Serial proxy ("sp" command), available on the ATmega2560 - Useful for forwarding USART communication to/from other boards - Basic capability to execute two concurrent threads, created when a pipe is used in the shell, with the output of the first command being fed in as the input to the second - For example: "sysinfo | grep uptime" - Note that not all commands are supported on either side of the pipe - Random number generator - LCG algorithm with some added entropy based on USART RX timings - Some games - Pong - 'w'/'s' for player 1 controls; 'o'/'l' for player 2 controls; space to resume; 'Q' to quit - Snake - "wasd" to control; 'Q' to quit - Bricks - 'a'/'d' to control; space to resume; 'Q' to quit ==================== Build and run steps: 1. Ensure that the AVR build and flash tools are installed. These tools can be obtained from the Arduino development package, for example, which can be found online. 2. Set up environment: $ export AVR_TOOLS_DIR="/path/to/hardware/tools/avr/" $ export AVR_FLASH_PORT="/dev/ttyUSB0" - Or another port, if not /dev/ttyUSB0 $ export AVR_MCU=$AVR_MCU_TYPE - Where $AVR_MCU_TYPE is one of the following: - atmega328p - atmega32u4 - atmega2560 3. Build: $ make 4. Flash to board: $ make flash - OR - $ make flash_uno - OR - $ make flash_2560 - OR - $ make flash_32u4 5. Connect to board over serial: $ screen $AVR_FLASH_PORT 38400 - Or any other available serial communication tool 6. Once connected over serial, type "help" to get a list of commands which can be run.
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published