Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
8 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 ...
0
votes
0answers
36 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
52 views

SPI Interfacing Problem [closed]

My Question is why the SPI Traces got Damaged(Discontinuity) after 3-4 times of Sensor Testing. We using 4-line(MOSI,MISO,CS,SCL) SPI Interface form MEMS Sensor(ADXL345) to Micro-controller(ATmega328p)...
0
votes
1answer
82 views

SPI and UART of atmega32 were not working when atmega32 was interfaced with ad7705

I was trying to read 16bit ADC ad7705 by atmega32 and send the value read through SPI communication of atmega32 to real-term software by using UART of atmega32. I found that there was no transmission ...
1
vote
0answers
35 views

Cases chosen by a number of times a button was pushed [closed]

I'm really new to this thing and I would appreciate some guidance. I have this project using atmega328p I have to test how many times light-bulb was turned on/off but that cycle have tu programmable ...
0
votes
1answer
104 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-...
1
vote
1answer
109 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 ...
0
votes
1answer
67 views

(Noob question) Placing parts of a byte in different (parts of) registers

Background: I'm trying to get a gLCD working with an Atmega328p. I got it to work quite easily, but there was one catch: the library that I found, used portB for the datapins. This was unacceptable, ...
2
votes
0answers
40 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 ...
1
vote
1answer
14 views

atmega16u2 debugwire and usb device

I am writing some firmware for the atmega16u2 and have noticed that the usb device hardware does not work correctly if debugwire is enabled. The usb device does not enumerate. Disabling debugwire ...
1
vote
1answer
412 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 ...
0
votes
1answer
173 views

Atmega32u4 USB 2.0 Routing Check

I am making last minutes changes to USB 2.0 differential pair routing on Atmega32u4 based board. I can't re-route the entire board and/or re-arrange the components. So the picture attached is the best ...
0
votes
0answers
30 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 ...
1
vote
0answers
44 views

AVR SPI stops clocking if the main loop contains a delay

I have a weird issue here using an ATMega48: ...
0
votes
1answer
237 views

ATMEGA328p LED Example not working

I tried to build a test circuit based on the Book "AVR Programming". It is very simple and shown here: The circuit itself is working and the upload of my code as well: ...
2
votes
3answers
8k views

Blinking LED with ATMega8 won't blink

As I'm a complete novice, I thought I'd start with something really simple: making a led blink. According to several websites, this is something everyone should be able to do... Hmmm... In my case, ...
0
votes
1answer
143 views

Strain gauge amplifier - so much noise!

I'd like to use atmega328p to read force with strain gauge. I'm using one 1k strain gauge and 3x 1k ohms dummy resistors. My circuit looks like that: I'm using DAC to remove offset from bridge. As ...
4
votes
4answers
4k views

Two wire vs. three wire serial interface for RTC

I'm looking to choose an RTC for a project I have in mind. I have the following options (linked to datasheet): DS1307 DS1302 The main difference seems to be the communication protocol. The DS1307 ...
0
votes
1answer
39 views

Failing to Program AT90CAN128

I've made a custom board with an AT90CAN128, and I can't get my USBTinyISP to connect to it. I've verified the programmer is good, as it connects to a 328p and a AT90CAN128 on a dev board fine. I ...
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 ...
0
votes
0answers
36 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 ...
1
vote
1answer
229 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
53 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 ...
0
votes
1answer
63 views

How to detect the phase sequence of a 3-phase ac (R-Y-B or R-B-Y) using Atmega32?

I am using an 8-bit AVR microcontroller in my project to detect the phase sequence of a 3-phase AC supply. Which method shall I use to do the work with the least number of components required along ...
0
votes
0answers
56 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 ...
1
vote
1answer
469 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: ...
0
votes
1answer
29 views

ATMega328P Timer Problem in Proteus

I have an ATMega328P microcontroller, and I'm learning how it is programmed. I wrote an example for Timer0 and uploaded it into the microcontroller. It works and a led blinks once a second in while. ...
0
votes
0answers
13 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. ...
4
votes
5answers
16k views

Three UART connections to an ATMega328?

I'm looking at the ATMega328p data sheet, and an Arduino Pin diagram, trying to determine if the chip can support three UART connections. I see that PD0 and PD1 are "USART" In and Out. So does that ...
2
votes
1answer
39 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 ...
6
votes
2answers
205 views

ATmega328p sine wave generator, frequency capping at 1200Hz

I'm currently implementing sinewave generator on ATmega328p (16MHz). My project is mostly based on this article https://makezine.com/projects/make-35/advanced-arduino-sound-synthesis/. In brief, I ...
0
votes
2answers
57 views

Is my simple atmega2560 based product exempt from EMC testing?

I have designed a product that is essentially a USB HID device for a computer game. It consists of several on off switches and 5v servos run by an atmega2560, all sealed and enclosed in a plastic case....
0
votes
1answer
69 views

ATMEGA328p-AU BootLoader

I have ATMEGA328P-AU chip, to burn the bootloader I used ARDUINO Uno Board as "ARDUINO as ISP" with setup Board: Nanno. I'm getting the following error. While looking for the solution I got ...
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
1answer
53 views

Visualise a bit pattern

My objective is to send a bit pattern of 1000 bits from one microcontroller (PIC or Atmel) to another one using the SPI method. How can I visualize the bit pattern so I can find the errors of ...
0
votes
2answers
157 views

Using Arduino Mega as Atmega2560 AVR development board with Atmel Studio 7

(updates at end) Qualifier: I am posting this here and not on the Arduino Stack Exchange because my question is about firmware development and not Arduino development. Project: I am designing a PCB ...
2
votes
0answers
95 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'...
0
votes
1answer
100 views

Atmega168 interrupts not working

I am trying some simple programs to test my microcontroller, but I am having trouble with the first test program: blinking an LED using interrupts. I'm using an Atmega168A-PU. Here is my program: ...
2
votes
1answer
217 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 ...
1
vote
1answer
109 views

Voltage detected across Micro USB cable shielding

I designed a Keyboard PCB using an ATmega32U4 with the data lines wired up to a Micro-USB B Receptacle. Brand: Molex; part number: 1050170001. The USB ground is directly connected to the Micro-USB B ...
0
votes
1answer
89 views

How read -8v to +2v using ADC ? which ADC i can use?

input signal is from +2v to -8v whose time stabilization is 3-8 Sec and frequency is varying from 60 Hz to 100 Hz. How i can read that signal, and which ADC i can use ?
0
votes
3answers
91 views

Disable RC oscillator in ATmega328 for FCC compliance

With respect to the topic below, I was trying to find where in the AVR documentation does it say the 8 MHz RC internal oscillator is "disabled" when CKSEL is selected to a different source? I am ...
1
vote
2answers
68 views

SPI between ATmega32 and ATmega328 is not working

I have been trying to accomplish connecting ATmega32 and ATmega328 using SPI Hardware connections: ...
1
vote
1answer
102 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 ...
0
votes
0answers
68 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
2answers
121 views

External influences with ADC

I use atmega328p. I'm trying to read data from a variable resistor using an ADC. The microcontroller also has LEDs connected. If I ignite them, the data from the ADC increases noticeably. ...
0
votes
1answer
114 views

Powering Atmega, DAC and Bluetooth in Car

I'm looking for a proper power supply schematic which would fit my needs and would have all required protections (overcurrent, overvoltage, reverse current, etc) for use in car. I want to power Atmega ...
0
votes
2answers
7k views

LCD 16 x 2 1602A Interfacing

I have bought a 16 x 2 LCD which I want to interface to a ATMEGA 324 microcontroller. The problem is that the vendor didn't give me a good enough datasheet. It does not contain any information ...
0
votes
1answer
154 views

Can ATMEGA JTAG be disabled and enabled just with JTAG?

I am currently developing a schematic based on the ATmega32U4. I need to be able to program the embedded chip, so with ISP or JTAG (preferably). The problem is, I also need the analogs functions of ...
3
votes
1answer
449 views

Using Atmel Studio 7 to program Arduino Uno

I will like to use AS7 IDE to program the Arduino board, for start Im using Arduino UNO with ATMEGA328P-PU chip. Im using Windows 10 professional First I used the Arduino IDE in order to run/...