From 99f21a1796acefb8cf9a435b03211e9381129116 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 24 Mar 2024 06:11:27 +0100 Subject: [PATCH 1/3] Some more registers --- MPU6050.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MPU6050.h b/MPU6050.h index 9ba54f9..66b7f9f 100644 --- a/MPU6050.h +++ b/MPU6050.h @@ -5,7 +5,11 @@ // MPU-6050 register addresses #define MPU6050_REG_ACCEL_XOUT_H 0x3B +#define MPU6050_REG_ACCEL_XOUT_L 0x3C #define MPU6050_REG_GYRO_XOUT_H 0x43 +#define MPU6050_REG_GYRO_XOUT_L 0x44 +#define MPU6050_TEMP_OUT_H 0x41 +#define MPU6050_TEMP_OUT_L 0x42 #define MPU6050_REG_PWR_MGMT_1 0x6B #include From 353e7cadaee53df0af841aacb76d55351adce5e3 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 24 Mar 2024 06:11:41 +0100 Subject: [PATCH 2/3] Links to datasheet/register map --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 70eb548..e9e503c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # AVR Playground -See [AVR i2c library](https://github.com/Sovichea/avr-i2c-library). +See: -[QEMU AVR Docs](https://www.qemu.org/docs/master/system/target-avr.html) +- [AVR i2c library](https://github.com/Sovichea/avr-i2c-library). +- [MPU-6000/6050 Datasheet](https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf) +- [MPU-6000/6050 Register Map](https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf) +- [QEMU AVR Docs](https://www.qemu.org/docs/master/system/target-avr.html) ```bash sudo dnf install avr-binutils avr-libc avr-gcc avr-gcc-c++ avrdude qemu-system-avr From 446dad024263b310264f0c29808c79f2212c8f25 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 24 Mar 2024 06:12:01 +0100 Subject: [PATCH 3/3] Makefile targets related to various readouts --- makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 41ecf40..e45067f 100644 --- a/makefile +++ b/makefile @@ -70,4 +70,15 @@ size: $(TARGET).hex # Reset target reset: - avrdude -p $(MCU) -c $(PROGRAMMER) -E reset \ No newline at end of file + avrdude -p $(MCU) -c $(PROGRAMMER) -E reset + +read-flash: + avrdude -p $(MCU) -c $(PROGRAMMER) -U flash:r:flash.hex:i + +read-eeprom: + avrdude -p $(MCU) -c $(PROGRAMMER) -U eeprom:r:eeprom.hex:i + +read-fuses: + avrdude -p $(MCU) -c $(PROGRAMMER) -U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h + +.PHONY: all clean flash qemu asm serial reset read-flash read-eeprom size \ No newline at end of file