Questions tagged [atmega]

ATMega is a family in the AVR series of Atmel microcontrollers. This is the main microcontroller of the Arduino prototyping platform. Please Specify the specific part number in your question.

84 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
1answer
54 views

How to upload code to AtMega2560 using JTAG ICE 2.0

Background : I'm used to code in Arduino(Uno, Mega, Esp32, Esp8266). But this time i have to code directly on AVR Atmega 2560 Chip. I have AVR JTAG ICE 2.0 (like this one) and download several ...
2
votes
1answer
41 views

ATmega crystal setup and and power routing

I have finished designing my first circuit boards and am uncertain about a couple of things. First of all, I know that I should connect both sets of ground pins and +voltage pins on the chip. My ...
2
votes
0answers
108 views

PWM to synth control voltage improvements

Just built this little circuit to control my Moog Werkstatt. The plan is to make a MIDI-to-CV converter and add more CV outputs and of course a GATE output later. But before going further, I thought I'...
2
votes
1answer
243 views

ATMega328P Programs at 2V but not at 1.8V

I'm perplexed by this one: I'm trying to run my ATMega328P at 1.8V. The voltage at the chip (pin 4 and 21) sits at 1.82V (BK Precision Multimeter). When using the AVRISP mkII, the programmer LED ...
2
votes
0answers
130 views

DC motor speed control

I am trying to control the speed of motor using ADC value received using ATMega16, the system works well with 12V. But when I go for 24V the motor runs continuously, even when ADC value is 0. I have ...
2
votes
0answers
178 views

Can not interface with Winbond W25Q16DVSIG over SPI

I'm trying to attach Winbond W25Q16DVSIG to Atmega 1284P-PU. I've attached SPI bus according to the pinout, CS pin has 10K pullup resistor. Whenever I'm trying to perform any operation, chip is not ...
2
votes
0answers
122 views

Sending Serial Data Over FTDI causes loop

I'm trying to send and receive serial data from an atmega328 (using the arduino library) over an FTDI (FT232R) chip. I can send data to my pc and view it in a serial monitor. I can send data from my ...
1
vote
1answer
32 views

ATmega2560 I2C (TWI) assembler configuration problems

I am using ATmega2560 for testing an I2C code. I wrote subrutines in assembler for init, start, write, read and stop the I2C setup. The goal is that master writes 11110000 to a slave with address ...
1
vote
0answers
48 views

AVR SPI stops clocking if the main loop contains a delay

I have a weird issue here using an ATMega48: ...
1
vote
0answers
54 views

Will this LED clock circuit work?

I am making a LED wall clock with an ATmega328P Xplained Mini board, 64 LEDs (4 is for the "main ticks" 15,30,45,60) around the PCB to show the seconds, and a 7 segment 4 digits display to show the ...
1
vote
1answer
134 views

Regulate an RGB LED via PWM, both in brightness and in hue

I am looking to regulate programmatically an RGB LED both in terms of brightness and in terms of hue. So far I have learned that I can use PWM to do this, but I am unsure as to what the details are. I ...
1
vote
0answers
41 views

Not All I/O Pins Work for Nixie Driver on Arduino MEGA and ATMEGA1284PU

I am tearing my hair out, and help would be immensely appreciated. I am developing a nixie RPN calculator. I am using nixies being driven by K155ID1 nixie drivers, connected to an ATMEGA1284PU. I ...
1
vote
0answers
79 views

Can't manipulate array with atmega8

I am quite new to AVR programming and I am currently having some troubles with arrays. I am trying to write an Arduino code that will be run on a Atmega32u4. The goal is to communicate with a AX12-A ...
1
vote
1answer
487 views

AVR ATMEGA328p Blinking Example

I wanted to test a simple blinking script on my ATMEGA328p. The breadboard setup (tested and works fine). But the LED does not blink. I probed the voltages across the board and they are showing up ...
1
vote
0answers
227 views

Problem with ATmega328P when used with DRV8302 gate driver

I am developing a motor controller for a 48V BLDC motor. For this, I am using the ATmega328P microcontroller in combination with the DRV8302 gate driver from Texas Instruments. It uses a simple ...
1
vote
0answers
224 views

High current draw through DC-DC boost circuit

I currently have a simple circuit below which works fine but I am confused with the readings I am getting for when the Atmega1284P is put to sleep. When it is operating I get a current draw of around ...
1
vote
0answers
127 views

Is there any reason some pins don't not work as GPIO on ATmega?

I got an ATmega8515 and this simple code inside main(): void main(void) { DDRD = 0xFF; PORTD = 0xFF; while(1){} } I expect to see all the pins high, ...
1
vote
1answer
109 views

Shared programming pins

Alright so there is a question that I need to ask. I am designing a PCB and I plan to include a ISP header for programming. Now one of the programming pins (PB3 - MOSI) is connected to a push button ...
1
vote
1answer
1k views

ATmega328p driving RGB LED WS2801

I am using an ATmega328p to control this RGB LED module. The ATmega is on an Arduino Uno, but I am programming it in C, without using the Arduino libraries. To power the RGB module I am also using a ...
1
vote
0answers
237 views

Serial Connection ATMEGA328p

I wrote up a function to connect via UART and print a string for debugging purposes. But my logic does not add up somehow... I see the line "Random Number" printed in the console but blazingly fast... ...
1
vote
0answers
775 views

Programming the Atmel Mega 328P-AU 32 MLF (QFN) using the Arduino ISP

I have successfully managed to program both a (DIP)Mega168A-PU and a (DIP)Mega328PU using another (DIP)Mega328P-PU ISP. This is the configuration that works for both DIP formats (168A-PU & 328P-...
1
vote
1answer
483 views

ATmega16u4 and ATmega32u4 i2c bug in Proteus AVR model?

I am trying to use i2c with ATmega16u4/ATmega32u4 in Proteus (version 8.5 SP1) and in my i2c code the following code line hangs the MCU: ...
1
vote
1answer
230 views

Atmel ATxmega128A identical boards - one fails to enter programming mode

I have two identical boards both equipped with ATxmega128A. I am using Atmel-ICE for programming using PDI Interface. The first board, I can read the device signature without any issues. On the ...
1
vote
0answers
490 views

Receiving and decoding Manchester code X10

Solved: After much debugging I found out that it was the UART that was not working correctly (not sure why yet) and that port I used to turn on LEDs did not work (PORTC). So there were never any ...
1
vote
0answers
1k views

Atmega328P is not responding in avrdude using usbasp

I have a cheap Chinese USBASP clone and it works fine with my ATtiny13A, but I always get this: ...
1
vote
0answers
136 views

ATmega328P SPI fails to transmit

G'day, I am currently experimenting with the an ATmega328P (on an Arduino, but programmed directly in C without the Arduino libraries) and it's SPI bus for communication with no other devices ...
1
vote
0answers
154 views

Very high frequency out of SPI pin in ATmega16A

I was trying to interface ATmega16A with ENC28J60, and I was facing problems with it, so I decided to physically look at the signals b/w the master µC and the Ethernet chip using an oscilloscope. But ...
1
vote
0answers
383 views

Can't display on LCD with Atmega 328

I tried to display hello world on a 20x4 LCD using Atmega328. But I failed to display any character on the screen. I'm not sure where the problem is, either the initialization or the timing order. I ...
1
vote
0answers
510 views

BH1750FVI with I2C won't work

I have the led driver of Adafruit connected to my atmega32. I adjusted their library for the Arduino, so now I just need a µcontroller and not an Arduino. This thing works. Now I want to control the ...
1
vote
0answers
1k views

Atmega32 can't verify after setting correct fuses for external crystal. HELP

I am having trouble with some Atmega32A's purchased off from eBay. The MCU's does not seem to be fake as they are functioning properly. I am experiencig the following problem: I want to use external ...
1
vote
0answers
483 views

Measuring a 2 cell 18650 battery from ATMega328P

I'm using an ATMega 328P (which will be running arduino code) as part of a project (a bicycle lighting system). It runs off of 2 Li-Ion cells, which both are step-up-regulated to 12V for the lighting, ...
1
vote
0answers
886 views

How to debug error of “unknown type name __progmem__”?

I'm using atmel studio 6.1 with a code containing but on compilation conpiler gives error as mentioned above and after googling error,I found that this variable progmem has been depriciated,but no ...
1
vote
0answers
583 views

ArduinoISP not responding

So I'm trying to upload sketches to an ATmega328 chip via my Arduino as an ISP. I've successfully been able to burn the bootloader, but when I try to upload sketches, I'm presented with this error. <...
1
vote
0answers
392 views

Error reading characters over serial on ATmega8 using CVAVR (USART)

I am trying to program ATmega8 for testing purposes using CVAVR as cross compiler and avrdude GUI as burner. Though I am able to burn the program, I think I am missing something in the coding part. It ...
1
vote
0answers
7k views

How to get rid of “Invalid opcode 0x002A at PC=0x004” in ISIS Proteus?

I have used ATmega 8 and have simulated a circuit to use interrupts, when i give an external interrupt i.e. when a push button is pressed all the LEDs connected to PORTB supposed to be lit up, but i ...
1
vote
1answer
365 views

How can I take look at the inside of the atmega1280?

I want take a look at the memory and at the elements inside the atmega1280. I compiled Ardupilot sketch and I uploaded it with an arduino. I started avarice with the following command: ...
1
vote
2answers
3k views

ATMega32 USBasp not programming

I use no Arduino just trying to program a simple ATMega32 using USBASP. Getting this message: ...
0
votes
0answers
49 views

Atmega328p datasheet mistake “OCRA”

I was reading the atmega328p datasheet, and suddenly, i saw that a register is mentioned called "OCRA", on page 108 and page 160, which normally, should be register "OCR0A", which is widely mentioned ...
0
votes
0answers
68 views

What scheduling should I choose for my program on a FreeRTOS system?

Not sure if it's the right place to ask but: I have a project (a 2-player game) made in FreeRTOS. The game has 3 tasks (Game Render, Joystick Task and a PC Serial Communication). Shared resources ...
0
votes
1answer
29 views

Arduino mega 2560 Analog max reference voltage

Each time I power up the Arduino, the max reference voltage which is represented by 1023 changes. I observed this by measuring the voltage from the Aref pin each time. Is there any internal function ...
0
votes
0answers
37 views

MEGA2560 only starts program after pressing RESET button multiple times

I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are ...
0
votes
0answers
33 views

What configuration is needed to use an ATMega328p micro-controller on a breadboard

I previously bought an Arduino Uno that came with a store bought/prebuilt PCB and ATMega328p to program it and use the pins. I also have a second ATMega328p that was bought by itself and I ...
0
votes
0answers
42 views

Cannot Disable AVR ATmega32 Watchdog

I'm writing a code to enable and disable the watchdog timer in ATmega32. I'm using the function in the datasheet that disables the wdt. Also, I'm toggling led in the beginning of the code to know if ...
0
votes
0answers
58 views

using multiple shift registers

I am using Atmega128 and 8 shift registers 6D595 the ser_out of each register is connected to the next shift register's ser_in so they form a chain. There is no issue with the hardware it has been ...
0
votes
0answers
16 views

Modify Hex (or svf) File to set Word in Flash (ATMEGA)

I work as a testengineer and I try to manually add a 16bit Word to the Flash of a Atmega16. We don't have the source of the firmware and I programm the firmware over JTAG with a convertet svf file. ...
0
votes
1answer
144 views

How to control brightness of high power LED with PWM microcontroller (ATMEGA16)

Hi I am entirely new to the PWM concept. I have an AVR based ATMEGA16 microcontroller (https://robokits.co.in/control-boards/rhino-robot-control-board/rhino-robot-control-board-avr-based-with-quick-c-...
0
votes
0answers
29 views

Keypad changing ports for usage of Timers

I want to use timers of ATmega 32 ( PD4 and PD5 ) for pwm mean while i'm using Port D for keypad the available ports for me is PA7 and PC7 i want to know how can i change my code of keypad init. ...
0
votes
0answers
81 views

Microcontroller resets with motor driver (L293D)

I am making a simple robot with 2 BO motors driven by L293D on ATmega328P (took out from Arduino Uno). The robot when tested on Uno works fine. But when I put it on the board that I have designed (as ...
0
votes
0answers
326 views

Simulating a 7-segment 4 digit display in Proteus using Atmega16

I have an issue about simulating a 7 segment display in Proteus. So basically, I am using an ATmega16 microcontroller along with a ULN2803 transistor array. I connect the 7 segments + decimal point ...
0
votes
0answers
41 views

IC enable pin control with Atmega 328p

I want to control the FP6293 ICs enable pin with the Atmega 328p pin PD5 (configured as digital out). The EN pin (active high) on the IC is rated at max 6V with a minimum HIGH voltage of 0.96V. As the ...