avr

Rotate a bitmap represented by an array of bytes

依然范特西╮ 提交于 2019-12-13 09:15:37
问题 In an AVR, I'm using an array of eight bytes to store a picture displayed on an 8x8 LED matrix. The picture needs to be rotated from time to time. So, given the picture ┘ defined as: uint8_t rows[8] = { 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b11111111 }; I want to "rotate" this anticlockwise to get ┐ as: uint8_t rows2[8] = { 0b11111111, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001, 0b00000001 }; Or this if done clockwise,

Shell / Makefile Linker

一个人想着一个人 提交于 2019-12-13 09:15:33
问题 I have downloaded the makefile and I'm running it with C/C++ code in xcode. It works and output the information (in console mode), but when I'm doing app (with GUI) it says: **make: avr-gcc: No such file or directory make: *** [main.o] Error 1** I'm running it like this: snprintf(cmd, sizeof(cmd), "make -C \"%s/System/\" flash", path); etc.. but the compiler dosen't generate / export the (.o) files, so the linker fails to find them. The makefile is: ######### AVR Project Makefile Template ###

cannot jump into arduino boot loader

怎甘沉沦 提交于 2019-12-13 07:08:14
问题 I want to jump from my application to the bootloader ( I load via bluetooth and have an application command to jump to the boot loader). the following work : void* bl = (void *) 0x3c00; goto *bl; or asm volatile { jmp BOOTL ::} asm volatile { .org 0x3c00 BOOTL: } (but code size grows to 0x3c00) BUT, the most obvious option asm volatile { jmp 0x3c00 ::} does not (seems it does not even produce code } Any idea why ? 回答1: The question as stated is not clear, as to what is working and what is

Custom enum type declaration with Arduino

ⅰ亾dé卋堺 提交于 2019-12-13 05:23:51
问题 I'm having some trouble using a custom enum type in Arduino. I've read elsewhere that using a header file is necessary for custom type declarations, due to Arduino IDE preprocessing. So, I've done that, but I'm still unable to use my custom type. Here's the relevant portions of my code in my main arduino file (beacon.ino) #include <beacon.h> State state; And in beacon.h: typedef enum { menu, output_on, val_edit } State; But, when I try to compile, I get the following error: beacon:20: error:

Counting without “counter” in microcontroller is Possible?

和自甴很熟 提交于 2019-12-13 04:35:40
问题 Hello friends i am new in microcontroller domain wants to know is this not possible to counts an events without using counter i mean by monitoring the pin which is connected to the the event generator.i am asking this question because presently i want to calculate the frequency of sensor i have already checked it frequency by using DSO(Digital storage oscilloscope) and it(DSO) says its frequency is 98khz but as we all now that the maximum value of an 8 bit counter is 255 then how it is

No connection between simulAVR and gdb

我们两清 提交于 2019-12-13 03:13:05
问题 I'm trying to connect gdb to a running simulavr session. The commands used are: simulavr -d atmega328 -f tiny.elf -B main -g after which I get the message: Waiting on port 1212 for gdb client to connect... On sending ^C, I get: ^CSystemClock::Endless stopped number of cpu cycles simulated: 909726536 which seems to be encouraging. When I try to connect to that session using gdb I get: (gdb) file tiny.elf Reading symbols from tiny.elf...done. (gdb) target remote localhost:1212 localhost:1212:

Unable to connect to Atmega328P chip with 16MHz crystal

牧云@^-^@ 提交于 2019-12-13 02:26:37
问题 I am trying to connect to Atmega328P chip through eXtreme Burner. I used 22pf capacitors and 10K pull for reset. I am able to read the chip if I use 8 MHz Crystal. But cannot read if I connect 16MHz crystal. When I looked at the datasheet, it says fuse bits are same for 8 MHz and 16 MHz. I get "Power On Failed" error message with 16 MHz. I am using USBASP programmer. Please note: With 8 MHz crystal, though I am able to read the device, I get error message "Incorrect Chip Found! Continue". If

How to interpret avr32-size output?

…衆ロ難τιáo~ 提交于 2019-12-13 00:43:28
问题 I have C program running on a AVR32 microcontroller (UC3C0512C). Issuing the avr32-size -A PROGRAM.elf command generates the following output: PROGRAM.elf : section size addr .reset 8200 2147483648 .rela.got 0 2147491848 .text 99512 2147491848 .exception 512 2147591680 .rodata 5072 2147592192 .dalign 4 4 .data 7036 8 .balign 4 7044 .bss 5856 7048 .heap 48536 12904 .comment 48 0 .debug_aranges 8672 0 .debug_pubnames 14476 0 .debug_info 311236 0 .debug_abbrev 49205 0 .debug_line 208324 0 .debug

UART register is not debugging to terminal

和自甴很熟 提交于 2019-12-12 04:59:04
问题 This is a UART transfer between two atmega328p controllers. I am trying to confirm that the data is being properly passed by printing a variable from the data struct on the receiving controller. My terminal is not displaying any information. I can only confirm that the code is being reached from my LED calls, where I enable portB. I am fairly sure my BAUD rate is correct (51 for 8mhz). Also confident the hardware is hooked up properly. Any recommendations on how to debug further to find the

How do AVR Assembly BRNE delay loops work?

删除回忆录丶 提交于 2019-12-12 04:42:27
问题 An online delay loop generator gives me this delay loop of runtime of 0.5s for a chip running at 16MHz. The questions on my mind are: Do the branches keep branching if the register becomes negative? How exactly does one calculate the values that are loaded in the beginning? ldi r18, 41 ldi r19, 150 ldi r20, 128 L1: dec r20 brne L1 dec r19 brne L1 dec r18 brne L1 回答1: How exactly does one calculate the values that are loaded in the beginning? Calculate total amount of cycles => 0.5s * 16000000