328P datasheet

NMNeil

Oct 3, 2014
111
Joined
Oct 3, 2014
Messages
111
Due to ignorance and not taking sufficient time I've managed to brick an Atmega328, well a couple of them actually.
Of course there are various commercial and DIY fuse doctor programmers on the web, but just copying and pasting Arduino code doesn't help me learn anything. So I decided to write my own program for the ATTiny 2313. Simply because I have plenty and it would be a great C programming learning experience.
Looking at the 328P datasheet for high voltage parallel programming, page 300 gives a nice diagram of how to physically wire the 328p up.
Now my question.
Is the data pinout read right to left, or left to right. By that I mean the sheet says PC(1:0) : PB(5:0)
So are the data pins read as PC0(0), PC1(1), PB0(2) to PB5(7).
or is it PB0(0) to PB5(5) then PC0(6), PC1(7)?
It's got me stumped.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,273
Joined
Nov 17, 2011
Messages
14,273
Which datasheet do you refer to? This one clearly shows the location of each pin starting on page 14.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Find a programmer that interfaces via the 6 pin connector on the arduino (or the 6 pins if you're using a bare chip) and most of your bucking problems will go away.

It is always possible to set it up so you need high voltage programming, but unless you're careless the in circuit programming will work even if you've broken the boot loader.
 

NMNeil

Oct 3, 2014
111
Joined
Oct 3, 2014
Messages
111
Which datasheet do you refer to? This one clearly shows the location of each pin starting on page 14.

It's not the pin position that I'm having trouble with.
Page 300 of the full datasheet shows the data pins used for HV parallel programming being
PC(1:0) : (PB(5:0)
My question is that as they are sharing port B and port C to give the data byte, is bit 0 on PC0 and bit 7 on PB5, or is bit 0 on PB0 and bit 7 on PC1?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,273
Joined
Nov 17, 2011
Messages
14,273
It seems you are referring to another datasheet than I do. Please post a link to your version, so we can have a look at it.
 

NMNeil

Oct 3, 2014
111
Joined
Oct 3, 2014
Messages
111
Thank you so much.
I'm getting the hang of reading the bits right to left and beginning the count with 0, but when they share a byte between 2 registers, that one had me stumped.
 
Top