Debian Codegraph @

docs/index.md

raw symbols SCIP
1 # Welcome to KuttyPy's documentation
2
3 The [kuttyPy (/kʊtipʌɪ/)](https://csparkresearch.in/kuttypyplus) Microcontroller training software allows live manipulation of the registers
4 in microcontrollers via a connected computer through a Python library or Graphical interface.
5
6 The kuttyPy hardware is an ATMEGA32 microcontroller development board developed by the [ExpEYES](http://expeyes.in) project, and is
7 currently supported. The hardware contains the kuttyPy firmware, but can also be used to run other
8 programs via its bootloader functionality.
9
10 setReg and getReg Python function calls act as debugging and monitoring tools, and combined with Python's visualization
11 and analytical utilities, this approach has immense pedagogical potential for beginners to the microcontroller world.
12
13 ```python
14 from kuttyPy import * #Import the library. also automatically connects to any available kuttypy hardware.
15 setReg('DDRD',160) #0b10100000 PD7(BLUE LED) and PD5(GREEN LED) made output type
16 setReg('PORTD',160) # PD5 and PD7 set to HIGH. Both LEDs start glowing
17 ```
18
19 !!! info "The KuttyPy ATMEGA32 hardware"
20 ![Screenshot](images/kpy_components.jpg)
21
22
23 !!! info "And its companion Python software"
24 ![Screenshot](images/main.png?raw=true "The User Interface")
25
26 !!! tip "Atmega32 Datasheet"
27 [Download](http://ww1.microchip.com/downloads/en/devicedoc/doc2503.pdf) the datasheet before diving
28 into learning how to use microcontrollers
29
30
31 ---
32 ## What can I use it for?
33
34 + It's an atmega development board with a bootloader supporting the 'arduino' protocol
35 + The bootloader also allows real-time manipulation of registers through commmands sent via the serial port.
36 + This is done by the associated Python library and companion GUI
37 + You can monitor every input
38 + Toggle every output
39 + Deal with Peripherals such as PWMs and Counters
40 + View ADC readings via an analog gauge
41 + Scan for sensors connected to the I2C Bus
42 + Monitor readings from [sensors](sensors)
43 + Compile code to hex with the avr-gcc compiler
44 + Upload hex via the built-in uploader
45 + Rapidly prototype and debug educational projects. For example, you can verify ADC input values before handing over control to the uploaded hex file which will likely have very limited debugging capabilities.
46 + Learn how registers are the key to microcontroller operation, as opposed to the Arduino ecosystem which prefers obfuscation of these details underneath abstraction layers.
47
48 ## Python library and Graphical utility
49
50 The graphical window featured in the cover animation allows exploring the functions of each pin of the hardware live, and also
51 viewing the corresponding register manipulations executed for each change. This knowledge can then be applied while writing C programs.
52 ![Screenshot](images/blink.gif?raw=true "Write Python code to blink all of PORT D")
53
54 The python library has setReg and getReg functions calls to manipulate and read registers, in addition to a host of high level functions
55 to access sensors, ADC etc.
56 ```python
57 from kuttyPy import * #Import the library. also automatically connects to any available kuttypy hardware.
58 setReg('DDRD',160) #0b10100000 PD7(BLUE LED) and PD5(GREEN LED) made output type
59 setReg('PORTD',160) # PD5 and PD7 set to HIGH. Both LEDs start glowing
60 ```
61
62 ## Monitor I2C Sensors
63
64 You can plug and play a variety of supported I2C sensors such as accelerometers, pressure sensors etc via the I2C pins (PC0:SCL, PC1:SDA).
65 [Details here](sensors)
66
67 ![Screenshot](images/mpu6050.gif?raw=true "6 DOF inertial measurement unit MPU6050")
68
69 Data from a 6 DOF inertial measurement unit MPU6050 shown with beautiful analog gauges. A data logger is also built-in, and
70 this includes analytical functions to select plot regions and fit against sinusoidal or damped sinusoidal functions for
71 feature extraction and physics experiments.
72
73 !!! info "Everyone loves robots!"
74 <video controls >
75 <source src="images/robot.mp4"
76 type="video/mp4">
77 Sorry, your browser doesn't support embedded videos.
78 </video>
79
80
81 ## 7 channel voltmeter [ 0-5000mV without analog frontend ]
82
83 PA0 - PA7 are ADC enabled pins. The graphical utility allows for their monitoring. This makes it easy to record expected input
84 values from analog sensors before hard-coding them into C programs. You can also use plotting libraries such as matplotlib to monitor variations.
85
86
87 Hall Sensor|Servo Motor
88 ---|---
89 ![Screencast](images/hall_sensor.webp?raw=true "Hall sensor!") | ![Screencast](images/servo_motor.webp?raw=true "Hall sensor!")
90
91 Plug and play various accessories such as this Hall Sensor, & servo motor.
92
93 ![Screencast](images/custom_registers.gif?raw=true "Add Register widgets, twiddle bits, and see what happens!")
94
95 Add custom register blocks, twiddle bits, and observe!
96 In this demo, the ADC is read by first setting the bits in the ADCSRA(control and status register), then reading back ADCL(8LSB)+ADCH(2MSB), and also checking the new status of ADCSRA after the operation.
97
98 ## [C Code compilation and uploading](programming/c)
99 ---
100
101 The kuttyPy also has standalone operation similar to an Arduino, or any other development board.
102 You can [compile C code with avr-gcc](programming/c), and upload via avrdude by selecting the 'arduino' bootloader type, and a 38400 BAUD rate. All
103 this can be easily carried out via pre-configured buttons in the KuttyPy GUI.
104
105 !!! tip "Seamless switching between the KuttyPy monitor, and user uploaded hex file."
106
107 The KuttyPy monitor code is part of the bootloader. This allows users to upload their own Hex files without losing the training utility features.
108
109 ![App Switching](images/switch.gif?raw=true "App Switching")
110
111 This example shows how to skip back and forth to an LED scanning code (which also prints letters to the serial port) written in C and uploaded.
112
113 In the animation, after fiddling a little with the PWM controls on the monitor, the 'user app' button is clicked. This triggers the following
114
115 * Within a few ten milliseconds the user uploaded hex file starts executing
116 * The console turns into a serial monitor, and shows any text sent by the user uploaded hex.
117
118 The user can switch back to the monitoring utility in a snap!
119
120 !!! tip "Persistence of vision display"
121 ![Screencast](images/pov_display.webp?raw=true "POV display!")
122
123 A persistence of vision display made with C code! Write text in thin air using 8 LEDs on PORTB.
124
125
126 ## Contributions:
127 + Special thanks to Georges Khazanadar for Debianizing efforts.
128
129 We welcome packaging efforts for other linux distributions.
130
131 ## Supporting KuttyPy
132
133 kuttypy-gui is an open source project. Its ongoing development is made possible thanks to the support by
134 people purchasing the hardware. We do not yet have a Patreon campaign or equivalent.
135
136 ---
137 Developed by Jithin B.P @CSpark Research