Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Unable to program ATMEGA328P

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
makiyoung
Posts: 1
Joined: 2017-06-07 09:03

Unable to program ATMEGA328P

#1 Post by makiyoung »

I have etched a PCB to program a ATMEGA328P. Currently, it consists of this (note: the capacitor at top right is part of a 3.3V regulator circuit). I have used some spare pins to route certain nets (RESET, 3.3V, GND) to different places easier for components I will add later.

Here is ATMEGA328P datesheet.

I am unable to program the MCU. I am using a usbtinyisp programmer, and it gives an error code stating that rc=-1 (unable to read device ID).

I have checked the pins with an oscilloscope, and all of the programming pins appear to be working.

Does anyone know what the problem could be? Is it necessary to tie all the GND pins together on the device? Or can I just connect one and use the others for reference?

edit: I should mention that this MCU has an internal 8 MHz oscillator.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Unable to program ATMEGA328P

#2 Post by pylkko »

makiyoung wrote:I have etched a PCB to program a ATMEGA328P.

I am unable to program the MCU. I am using a usbtinyisp programmer, and it gives an error code stating that rc=-1 (unable to read device ID).

Does anyone know what the problem could be? Is it necessary to tie all the GND pins together on the device? Or can I just connect one and use the others for reference?
My first guess - in the case that avrdude gives "no permissions" errors of any kind, and you are using over USB - would be that the user does not have permission/is not in the group that has access to the USB device by the kernel. Does it work with root? You might try adding the user to dialout or plugdev, and creating a udev rule for the device. If you plug in the apparatus, does the kernel recognize it and give it a device? I guess it does as you get some kind of error message at all....

If the device is recognized, has a /dev and you can see it in dmesg, and you have the correct permissions, then you need to check your connections. I have used ICSP to program AVR's (in order to not have to have a USB-apparatus) on Debian. But I have noticed that if using USB-to-TTL-serial cable (for example) that some machines need to have the permissions adjusted (Linux is picky about USB access). An interesting problem is that different Linux OS's have different rules and groups. You should maybe produce the entire commmand and output that you are using/getting.

Post Reply