Unable to program ATMEGA328P

Need help with C, C++, perl, python, etc?

Unable to program ATMEGA328P

Postby makiyoung » 2017-06-07 09:05

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.
makiyoung
 
Posts: 1
Joined: 2017-06-07 09:03

Re: Unable to program ATMEGA328P

Postby pylkko » 2017-06-07 19:06

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.
User avatar
pylkko
 
Posts: 1213
Joined: 2014-11-06 19:02


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable