sudo avrdude -p m328p -c arduino -P /dev/ttyACM0 -U flash:r:dump.hex:i
avr-objdump -m avr5 -s dump.hex //Dump all w/o disassembly, avr5 is the arch name of m328p
avr-objdump -m avr5 -s -d -j .secX dump.hex //Dump and disassembly sectionX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //AVR gcc config: workspace/.vscode/c_cpp_properties.json | |
| { | |
| "configurations": [ | |
| { | |
| "name": "Linux avr-gcc", | |
| "intelliSenseMode": "clang-x64", | |
| "includePath": ["/usr/lib/avr/include"/*, "~/Dev/libavr"*/], | |
| "compilerPath": "/usr/lib/avr/bin", | |
| "browse": { | |
| "path": ["${workspaceFolder}"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| /** | |
| xo: orginal data | |
| xp: processed data (applied filter) | |
| **/ | |
| #define FILENAME "./stage1.data" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <inttypes.h> | |
| #include "./util.c" | |
| int main() { | |
| struct myData { | |
| int v1; | |
| int v2; | |
| float f1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module runled ( | |
| input wire clk, | |
| input wire reset, | |
| output wire [7:0] led, | |
| output wire [14:0] hps_memory_mem_a, | |
| output wire [2:0] hps_memory_mem_ba, | |
| output wire hps_memory_mem_ck, | |
| output wire hps_memory_mem_ck_n, | |
| output wire hps_memory_mem_cke, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| int main() { | |
| float a = 123.96875f; | |
| uint32_t* ptr = &a; //float is 32-bit | |
| printf("%f = ", a); | |
| for (int i = 31; i >= 0; i--) { | |
| printf("%c", (*ptr>>i) & 1 ? '1' : '0'); | |
| if (i == 31) putc(' ', stdout); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <avr/io.h> | |
| #include <avr/interrupt.h> | |
| #define RC_CLOCK_CALIBRATE 0xA0 | |
| int main(void) { | |
| CLKPR = 0x80; | |
| CLKPR = 0x03; //Clk divider = 8 | |
| OSCCAL = RC_CLOCK_CALIBRATE; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module UART (baud,txData,rxData,sendData,sendWIP,receiveRequest,txPin,rxPin,clk,reset); | |
| input [15:0] baud; | |
| input [7:0] txData; | |
| output [7:0] rxData; | |
| reg [7:0] rxData; | |
| input sendData; | |
| output sendWIP; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;Scratch, save before call child, free to use in subroutine | |
| #define _RA R0 | |
| ;Always zero, do not modify | |
| #define _RZERO R1 | |
| ;Temp register, save before call child, free to use in subroutine | |
| #define _RT0 R18 ;Arg3 | |
| #define _RT1 R19 | |
| #define _RT2 R20 ;Arg2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| How to use: | |
| 1. Login to your uWinSite | |
| 2. Go to: Manage Classes/View my Classes | |
| 3. Choose the semester, and you should see all your classes in the page. | |
| 4. Open the page inspector of your web browser. | |
| 5. Copy the code into the debugger and hit enter. The code is now embedded into the page. | |
| 6. Execute "timetable()" in the debuger. | |
| 7. The timetable will be generated, and it will be located at the bottom of the page. | |
| */ |
NewerOlder