migrating

master
Penguin 3 years ago
parent d87af806aa
commit 8b109e6166

Binary file not shown.

@ -270,7 +270,7 @@
</dependencies> </dependencies>
<project id="common.applications.user_application.xplained_pro2.samd21_xplained_pro" value="Add" config="" content-id="Atmel.ASF" /> <project id="common.applications.user_application.xplained_pro2.samd21_xplained_pro" value="Add" config="" content-id="Atmel.ASF" />
<board id="board.samd21_xplained_pro" value="Add" config="" content-id="Atmel.ASF" /> <board id="board.samd21_xplained_pro" value="Add" config="" content-id="Atmel.ASF" />
</framework-data> </framework-data>
</AsfFrameworkConfig> </AsfFrameworkConfig>
<avrtool>com.atmel.avrdbg.tool.edbg</avrtool> <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
<avrtoolserialnumber>ATML2130021800025113</avrtoolserialnumber> <avrtoolserialnumber>ATML2130021800025113</avrtoolserialnumber>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,47 @@
0x000011d0 in _usart_interrupt_handler ()
0x000011d0 in _usart_interrupt_handler ()
─── Assembly ─────────────────────────────────────────────────────────
0x000011d0 ? blx r3
0x000011d2 ? ldr r3, [pc, #16] ; (0x11e4 <_usart_interrupt_handler+264>)
0x000011d4 ? blx r3
0x000011d6 ? ldr r0, [pc, #16] ; (0x11e8 <_usart_interrupt_handler+268>)
0x000011d8 ? ldr r3, [pc, #16] ; (0x11ec <_usart_interrupt_handler+272>)
0x000011da ? blx r3
0x000011dc ? b.n 0x11dc <_usart_interrupt_handler+256>
0x000011de ? nop ; (mov r8, r8)
0x000011e0 ? adds r1, r6, r6
0x000011e2 ? movs r0, r0
─── Breakpoints ──────────────────────────────────────────────────────
─── Expressions ──────────────────────────────────────────────────────
─── History ──────────────────────────────────────────────────────────
─── Memory ───────────────────────────────────────────────────────────
─── Registers ────────────────────────────────────────────────────────
r0 0x00000028 r1 0x00000000 r2 0x41004000
r3 0x000019b1 r4 0x00000029 r5 0x0000000c
r6 0x00000005 r7 0xff7ffffb r8 0xfbbbfffd
r9 0x55f5ff5b r10 0xf7fcff7f r11 0x57b3fffd
r12 0x00000000 sp 0x20002398 lr 0x000001c3
pc 0x000011d0 xPSR 0x61000000 msp 0x20002398
psp 0xff0bff7c primask 0x00 basepri 0x00
faultmask 0x00 control 0x00
─── Source ───────────────────────────────────────────────────────────
─── Stack ────────────────────────────────────────────────────────────
[0] from 0x000011d0 in _usart_interrupt_handler
[1] from 0x1c1d826c
─── Threads ──────────────────────────────────────────────────────────
[1] id 0 from 0x000011d0 in _usart_interrupt_handler
─── Variables ────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────
../../../ePenguin/ePK/software/build/scripts/push.gdb:7: Error in sourced command file:
Error erasing flash with vFlashErase packet
Detaching from program: /storage/Shared/Documents/Projects/D21_ADC_with_DMA/D21_ADC_with_DMA/Release/D21_ADC_with_DMA.elf, Remote target
Remote connection closed
../../../ePenguin/ePK/software/build/scripts/push.gdb:6: Error in sourced command file:
Remote communication error. Target disconnected.: Connection reset by peer.
Quit
Quit
Quit
Quit
Quit
Quit
Quit

@ -137,7 +137,9 @@ src/main.d src/main.o: ../src/main.c ../src/asf.h \
../src/ASF/sam0/utils/stdio/stdio_serial/stdio_serial.h \ ../src/ASF/sam0/utils/stdio/stdio_serial/stdio_serial.h \
../src/ASF/common/services/serial/serial.h \ ../src/ASF/common/services/serial/serial.h \
../src/ASF/common/services/serial/sam0_usart/usart_serial.h \ ../src/ASF/common/services/serial/sam0_usart/usart_serial.h \
../src/drivers/pusart.h ../src/drivers/padc.h ../src/drivers/pusart.h ../src/drivers/padc.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\math.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\machine\fastmath.h
../src/asf.h: ../src/asf.h:
@ -428,3 +430,7 @@ c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-no
../src/drivers/pusart.h: ../src/drivers/pusart.h:
../src/drivers/padc.h: ../src/drivers/padc.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\math.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\arm\arm-gnu-toolchain\arm-none-eabi\include\machine\fastmath.h:

@ -34,6 +34,7 @@
#include <asf.h> #include <asf.h>
#include "pusart.h" #include "pusart.h"
#include "padc.h" #include "padc.h"
#include <math.h>
int main (void) int main (void)
{ {
system_init(); system_init();
@ -51,7 +52,15 @@ int main (void)
for (;;) for (;;)
{ {
float voltage = padc_get_voltage(); float voltage = padc_get_voltage();
printf("Voltage: %d.%03d", (int)voltage, ((int)((voltage - (int)voltage) * 1000))); uint32_t resistance = (voltage * 10000) / (3.3 - voltage);
double var_a = 0.003354016;
double var_b = 0.0002569850 * log(resistance/10000.0);
double var_c = 0.000002620131 * (2 * (log(resistance/10000.0)));
double var_d = 0.00000006383091 * (3 * (log(resistance/10000.0)));
float temp_in_kelvin = (float)(1/(var_a + var_b + var_c + var_d));
float temp_in_c = (temp_in_kelvin - 273.15);
printf("Voltage: %d.%03d\t", (int)voltage, ((int)((voltage - (int)voltage) * 1000)));
printf("Temperature: %d.%03d", (int)temp_in_c, ((int)((temp_in_c) - (int)temp_in_c) * 1000));
delay_ms(500); delay_ms(500);
// clear line // clear line
printf("%c[2K", 27); printf("%c[2K", 27);
@ -61,3 +70,6 @@ int main (void)
printf("%c[1B", 27); printf("%c[1B", 27);
} }
} }
RTC->MODE0
Loading…
Cancel
Save