The kuttyPy (/kʊtipʌɪ/) Microcontroller training utility allows real-time manipulation of the registers in microcontrollers via a connected computer containing its python library. setReg and getReg function calls act as a real-time debugging and monitoring utility, and combined with Python's visualization and analytical utilities, this approach has immense pedagogical potential for beginners.
The kuttyPy Nano hardware is an ATMEGA328p microcontroller development board
Supports a variety of tasks such as IO manipulation, ADC reading, I2C sensor data logging, C compile and upload IDE, blockly based graphical programming etc
Download the hex file
Flash the bootloader hex file using USBASP
avrdude -B10 -c usbasp -patmega328p -U flash:w:kuttyboot_atmega328p.hex
avr-gcc -Wall -O2 -mmcu=atmega328p -Wl,-Map,blink328.map -o blink328 blink328.c avr-objcopy -j .text -j .data -O ihex blink328 blink328.hex
avrdude -b 57600 -P /dev/ttyUSB0 -pm328p -c arduino -U flash:w:blink328
Select board Arduino-> Diecimilia Select processor -> 328p
sketch uses 930 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
/usr/bin/avrdude -C/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/arduino_build_618935/Blink.ino.hex:i
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/jithin/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 5.0
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/tmp/arduino_build_618935/Blink.ino.hex"
avrdude: writing flash (930 bytes):
Writing | ################################################## | 100% 0.27s
avrdude: 930 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_618935/Blink.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_618935/Blink.ino.hex:
avrdude: input file /tmp/arduino_build_618935/Blink.ino.hex contains 930 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.24s
avrdude: verifying ...
avrdude: 930 bytes of flash verified
avrdude done. Thank you.
Connect the hardware, and import the library. Import will throw an error if the hardware is not detected
from kuttyPy import *
getReg('PINC')
readADC(0)
To view the full list of ATMEGA32 registers
print(REGISTERS.ATMEGA32_REGISTERS)
py -3 -m pip install kuttypy
kuttypy
pip3 install kuttypy
kuttypy
sudo apt-get install python3 python3-serial python3-pyqt5 python3-pyqt5.qtsvg
git clone https://github.com/csparkresearch/kuttypy-gui
cd kuttypy-gui
python3 KuttyPyGUI.py
Addition Boards Manager URL
https://scischool.in/kuttypy_arduino.json
Developed by Jithin B.P @CSpark Research, 2018.
Special thanks to Georges Khazanadar for Debianizing efforts.