Questions tagged [avr]
AVR is a 8- and 32-bit microcontroller core developed by Atmel. AVR was chosen as microcontroller for the first generations of the popular Arduino SBCs.
1,910
questions
0
votes
4
answers
29
views
What does it mean the MCU has 1 ADC and 10 ADC channels?
I got this AVR Microchip MCU ATtiny 204 chip. Now what I can't get, what do they mean in the datasheet it has 1 ADC and 10 channels ADC?
The datasheet:https://datasheet.octopart.com/ATTINY204-SSF-...
0
votes
1
answer
44
views
LCD Entry Mode Set and AVR MCU
I want to simulate **the Entry set mode ** function of and LCD based on HITACHI 44780 Controller.
(Here is the datasheet.)
The "Entry set mode" is given the following code of the 8 bits data ...
0
votes
1
answer
81
views
Analog switch for controlling LED
I need help/suggestions for the implementation of my schematic:
In the schematic image pasted below, particularly look only at the charging IC, boost converter, analog switch, and ATTiny 1616 ...
0
votes
0
answers
24
views
AVR128Dx TCB Input Capture issue
Ive made a code for reading SENT sensor using TCB interrupt with event system. It works 90% of the time, but those 10% seems like it doesnt read correct high pulse duration, mby someone will see, what ...
2
votes
1
answer
295
views
Memory view is showing multiple bytes change after a single byte is assigned to a register. Why?
I am debugging an issue I have on a legacy codebase that is running on an atxmega32c4u chip. I am writing single bytes to registers in PORTC, but the memory view is showing multiple bytes change. The ...
0
votes
1
answer
51
views
No touch points close to the edge of the screen
Just for fun and to learn, I'm writing code to drive a 800x480 TFT with resistive touch driven by an RA8875 and an ATmega328P and avr-libc.
It works fine so far but when reading touch events, I don't ...
0
votes
0
answers
27
views
Which ATtiny TWI parameter provides more robust operation?
I'm using an ATtiny3226 as an I2C client (slave) interface in a robot, to get commands from the main controller (single master) using I2C on a shielded cable.
There are brushless and servo motors ...
0
votes
1
answer
41
views
AVR assembly indirect addressing: "Found no label/variable/constant named …"
I am currently trying to indirectly address the SRAM of the ATMega328P by using the following code:
...
1
vote
0
answers
48
views
SSD1306 display goes out-of-sync only if ATmega328 is reprogrammed
I have ATmega328 directly connected to the SSD1306 Display through I2C. Whenever I power up the ATmega, everything works great and the display works as expected.
The problem occurs only when I upload ...
0
votes
0
answers
29
views
Problems with OCR1B on Atmega328p
Trying to control 4 servos (SG90) using 4 pots on an arduino nano and the one connected to OC1B keeps having problems, with bits of jittering and it just not moving correctly (occasionally spinning), ...
0
votes
1
answer
36
views
Why did fuse bits successfully reset using ICSP and USBASP programmer?
I read a lot about fuse bits in AVR microcontrollers and everyone says that fuse bits can be reset by using high-voltage programmer only, they can't be reset via UART<->ICSP.
So, I've received ...
0
votes
2
answers
68
views
Extended IO registers handling in AVR using Assembly language
I want to program the ADC module of arduino Mega2560 using Assembly language (for simulation and learning),
I can initialise the ADC Module using Assembly and my program converts in the first ...
1
vote
1
answer
49
views
Manipulating EEPROM in AVR using assembly programming
In the following video(at 10min):
https://www.youtube.com/watch?v=YELGX5XDCiY&list=PLgwJf8NK-2e55CdbY_WnY6pejPHoojCkJ&index=18
The microcontroller used in the video series is ATmega32.
Let's ...
1
vote
0
answers
48
views
SPI: Write to display while reading multiple blocks from SD card
I'm reading BMP images with hundreds of kB's raw from an SD card and parse/write the image data to a TFT LCD with an AVR MCU with 2kB RAM.
Reading a single block of 512 bytes with CMD17, passing it to ...
2
votes
3
answers
208
views
Tightest finite wait loop possible in AVR8
I need a wait delay function with fine grained control of the delay. I came up with the fairly standard way
ldi Rx, N
lp: dec Rx
brne lp
This ...
0
votes
2
answers
143
views
AVR ATmega328P if statement wrongly executed after reset
I have simplified the listing to bare minimum where I can still observe this behaviour.
When this program is running, it works as expected. Button press causes LED to show up.
The problem exist on ...
0
votes
1
answer
47
views
How to increase the Atmega32A input output pins
I’m using ATmega32A to control a system which have a 30 outputs and 30 inputs. The issue is that the ATmega32A have only 32 DIO pin which can be use as input output pins.
So how can I increase the ...
0
votes
1
answer
82
views
ATTiny85 won't reprogram
I am using a tiny AVR programmer to program code specifically this one, https://www.amazon.com/dp/B00B6KNJRY?psc=1&ref=ppx_yo2ov_dt_b_product_details , I can successfully upload code onto a blank ...
2
votes
1
answer
117
views
AVR32DA VIH threshold
I am looking into using an AVR32DA48 MCU for a design. The MCU will be powered at 5V and needs to interface with an IC at 3.3V. The IC is 5V tolerant and I am trying to figure out if a level ...
0
votes
1
answer
80
views
How to identify all AVR MCUs (ATtiny and ATmega) that feature a factory-programmed unique ID
On Microchip's site, the "parametric search" table for microcontrollers does not have a filter column to select the models that feature a unique ID. Is there a way to list (enumerate) all ...
0
votes
1
answer
42
views
Can WINC1500 be used with SPI for connecting to a router?
I'm planning to buy the WINC1500 WiFi module. I have heard that it contains a SPI layer, which can be used for telling the WINC1500 to connect to a router.
But as I can see in the documentation, I ...
0
votes
1
answer
52
views
Ohmic load on AVR's SCK?
I have an ATTINY13, and almost all pins are used (only PB2 is free).
What I need to add is a controllable ohmic load, which I believe best way to add is with an N-channel MOSFET, similarly with this ...
0
votes
2
answers
79
views
Can I treat the USB controller in the ATMEGA8U2 as seperate from the rest of the microcontroller?
I'm working on a project that runs on a battery, but can be connected to a computer for a serial connection/charging. In the documentation it lists an example of a bus powered USB controller with ...
1
vote
3
answers
300
views
ATMEGA328 out of memory, but avr-size reports I still have a lot of space
I have a program written in C. I have 390 byte array defined and a long string value consisting of around 475 bytes. Now I hit a problem if I add more characters to the string value, around 30 bytes, ...
4
votes
2
answers
1k
views
Transmitting from PC via USART to MCU working but very slow
I am sending a small 16-Bit RGB BMP image file from my Linux PC via USART (with a loosely wired USB to serial converter) to an AVR ATmega MCU sitting on a breadboard, running at 8 MHz with the ...
0
votes
0
answers
99
views
Graphical LCD With Atmega64
I have ATMEGA64 and LCM240128, The wiring is as below:
And my code is ( I'm using codevision):
...
2
votes
1
answer
379
views
ATmega64 custom board is not programming
I have designed a custom board for ATmega64 as below:
It's the first time I want to program it, and I get a "chip enable program error". I can program ATmega16 and ATmega8, but for ATmega64 ...
1
vote
1
answer
94
views
ATMega328p wakes immediately after sleep
I'm having issues with my current AVR-C project that runs on an ATMega328p. After issuing the sleep command the chip wakes up again immediately.
I want to wakeup with an external interrupt, but while ...
1
vote
2
answers
478
views
Assembly: AVR Studio alternatives for Linux [closed]
I had been using using AVR Studio on Windows to write assembly code for my MCUs (mainly for atmega8515) for a couple years. However, recently I transitioned to Linux and turns out there aren't any ...
4
votes
1
answer
649
views
AVR code disassembly - what is this code doing?
I have read and disassembled the code from an Atmel8 microcontroller from a faulty oscilloscope.
This is the start routine:
...
1
vote
2
answers
179
views
Dual Slope integrator voltmeter improvement in Design
So, I'm attempting to design a dual-slope integrator voltmeter. I have the following block diagram so far.
Now an AVR microcontroller will have an ADC pin in the range of 0-5 Volts . So negative ...
0
votes
0
answers
33
views
Regulating multiple +5V sources to one output to increase current, but avoid interference/noise
I'm designing a circuit with 4 USB 2.0 upstream ports that each connect to their own AVR (ATMEGA32U4), 1 master and 3 slave connected via I2C, master then communicates with a USB controller via SPI, ...
2
votes
3
answers
707
views
AVR code - where is Z register pointing to?
I am disassembling AVR code from a bit of hardware. The processor is an Atmel-8.
On restart, after setting the stack pointer, the program calls a subroutine that starts with:
...
2
votes
2
answers
409
views
3V oscillator to 5V µC with an 74HCT inverter (12.8 MHz) - bad idea?
I'd like to use an AVR (ATmega328P-AU to be precise) in combination with a fairly accurate oscillator for timing purposes. I stumbled upon the fact that oscillators which have greater accuracy mostly ...
0
votes
0
answers
62
views
avr debugWIRE On chip debug system
I am new into avr and am working on atmega328p. I am not able to understand the avr debugwire system. What is this and how it works. I am seen the datasheet but am not getting a good clear ...
0
votes
1
answer
68
views
Multiplexed keyboard based on MOSFET for AVR gives sometimes wrong reading
I made simple example for multiplexed keyboard 2x2 on AVR. Like schematic below:
And Source code:
...
0
votes
0
answers
63
views
AT90USB1286 bricks after disabling clock divider
I have an AT90USB1286 which is connected to a 16MHz external crystal oscillator. It is my understanding that by default from the factory the CKDIV fuse is enabled which makes the chip run at an ...
0
votes
0
answers
52
views
Switching reference voltage with capacitor on AREF
I do two conversions (ratiometric measurement) with AREF = AVCC = VCC = 3 x AAA battery. AVCC is connected to VCC via an LC network as recommended in the data sheet of the ATmega328P. I would like ...
0
votes
1
answer
134
views
Why is nothing happening on my CLKOUT pin, despite the RTC working fine? [closed]
I apologize for the (probably) trivial question -- I'm just starting to get back into coding for MCUs after a long hiatus, so please be patient with me.
I'll preface this by acknowledging that there ...
0
votes
2
answers
90
views
ATMega32U4 USB design considerations
I'm desigining a board with ATMega32U4 microcontroller.
The board will be minimal, and will feed the microcontroller from USB of an M.2 socket (E type) on a PC mainboard:
Now, checking Leonardo's ...
5
votes
3
answers
1k
views
How can I do immediate addition in the Atmel AVR instruction set?
I've been doing some AVR assembly programming for a university course, and I recently happened upon a situation where I would have wanted an "add immediate" instruction. However, no such ...
0
votes
2
answers
466
views
Schematic design for CJMCU Beetle?
I have this bare ATMEGA32U4 breakout:
There are no components on the backside, and I need to redesign this for my own purposes.
I'm looking for the schematic design of this. Although I can reverse ...
1
vote
1
answer
66
views
Cannot stop Microcontroller's Hardware Timer from running
I'm using an Atmel ATMega8 microcontroller to control a stepper motor. (Datasheet).
Timer1 (a 16-bit hardware counter) is used in CTC mode to modulate an IO pin to provide the stepping signal to the ...
0
votes
2
answers
59
views
Driving 10ch outputs with 5V AVR
I use a 5V AVR (ATmega1284p) to measure some data. Depending on the data I would like to switch one of 10 outputs.
Each of these outputs should have a LED (as an indicator and for debugging purposes) ...
0
votes
1
answer
52
views
How to make a circuit which can give divided voltage to ADC and can send a trigger pulse to INT0 when I press a button?
I connected 4 buttons to the ADC module of AVR-ATMega328p with different resistor values,
To know which button is pressed this ...
3
votes
0
answers
52
views
PID H-bridge random current spikes
My H-bridge consists of 4 n-channel MOSFETs. The high side is driven by a basic bootstrap circuit, and the low side is directly driven from the MCU.
Using a PID function to control the motor by its ...
1
vote
1
answer
387
views
How do I measure distance of Ultrasonic Sensor HC-SR04 using the ATmega328P Timer Input Capture?
I am using an ATmega328P MCU with an 16 MHz external oscillator. I need to measure distance of Ultrasonic Sensor HC-SR04 using the ATmega328P Timer 1 Input Capture interrupt. I have to measure the ...
0
votes
1
answer
83
views
Software serial not sending the first byte correctly
I implemented the following program to send data to a serial monitor.When I run it, I expect to see abcd but I always see ⸮bcd:
<...
4
votes
3
answers
428
views
Are ATmega48/168/328 suitable for automotive applications?
I'm trying to figure out if it's ok to use ATmega48 in a homemade project involving some safety-related aspects with moving vehicles. (the project will be a control board for excavator joysticks)
...
0
votes
1
answer
142
views
ESP8266 responds with gibberish and 'ready' to AT commands from C program
I have gotten the ESP8266 working by sending commands manually from the TTY. Now, I'm trying to connect to wifi using the following C program:
...