New to surface mount and minicore

Just started recently in getting on surface mount. Was wondering if I could get some assistance.

I bought a

Fincos 43.2 35.6mm TQFP32 QFP32 LQFP32 to DIP28 Adapter Socket Support ATMEGA8 ATMEGA8A ATMEGA328 AVR MCU TL866A TL866CS

So I could program the atmega328pb on a bread board. I found out that I need minicore to program it.

So far I have minicore installed.

What I am trying to do is just load a boatloader, and load the blinking pin 13 led code to get it to work.

What I don't understand is how to do the pin out.

Can I use the minimal circuit to do the bootloader arduinos minimal circuit ?

From the minicore site it looks like I need 4, 18 to vcc, 5,21,33 to gnd. 4 and 5 need a capacitor.

How do I hook up the arduino ISP ?

Also for the atmega328pb-u the smd package only has 32 pins i though. The dot is the 32pin on top of it and to the left of it is the 1st pin ?

Could use some help sorting this out

Any input would help!

xzarida:
Can I use the minimal circuit to do the bootloader arduinos minimal circuit ?

Yes.

xzarida:
How do I hook up the arduino ISP ?

Make these connections:

Arduino as ISP | ATmega328PB (physical pin #)

MISO | 16 (MISO)
MOSI | 15 (MOSI)
SCK | 17 (SCK)
10 | 29 (RESET)

xzarida:
Also for the atmega328pb-u the smd package only has 32 pins i though.

Correct. Is there something that makes you doubt this?

xzarida:
The dot is the 32pin on top of it and to the left of it is the 1st pin ?

Correct.

A TQFP-32 to DIP-28 adapter will have to do something about the extra 4 pins that the TQFP version has.

You should examine the board and figure out what it does with these pins, and make sure that it's acceptable. It may be that (since they mention a bunch of ATmega parts in the description) it is specifically meant for atmega328 and similar, and that they connect the extra pair of Vcc/Gnd pins that the TQFP package has to existing Vcc/Gnd pins, and leave the other two unconnected. Except that on the 328PB, those pins are I/O pins, not Vcc/Gnd - meaning that those pins won't be usable, and if you tried to use them as outputs, you could damage the chip.

A breakout board which broke out ALL of the pins, instead of just 28 of them, would be a better choice.

xzarida:
So I could program the atmega328pb on a bread board. I found out that I need minicore to program it.

It can sometimes be handy to program a bootloader before soldering an SMT part in place, but as this is your first foray into the world of SMT, you would be strongly recommended to use a board (where the SMT device is going to be soldered) that has a ISP header in place, see the 6 pin one found on UNO\Mega Arduino boards. No need for an adapter then.

Also for checking pinouts etc, keep a copy of the device datasheet handy, its quicker check that than have to wait for an answer on here ..................

pert:
Correct. Is there something that makes you doubt this?

The minicore site says to hook the 33 pin to gnd. Kind of confused where it is.

DrAzzy:
A TQFP-32 to DIP-28 adapter will have to do something about the extra 4 pins that the TQFP version has.

You should examine the board and figure out what it does with these pins, and make sure that it's acceptable. It may be that (since they mention a bunch of ATmega parts in the description) it is specifically meant for atmega328 and similar, and that they connect the extra pair of Vcc/Gnd pins that the TQFP package has to existing Vcc/Gnd pins, and leave the other two unconnected. Except that on the 328PB, those pins are I/O pins, not Vcc/Gnd - meaning that those pins won't be usable, and if you tried to use them as outputs, you could damage the chip.

A breakout board which broke out ALL of the pins, instead of just 28 of them, would be a better choice.

Is there a recommended breakout board? I kind of want to surface mount solder it, but i am afraid of putting a port on to program it. I think it's called a uart port. I guess i should do some research maybe it would be better that way.

srnet:
It can sometimes be handy to program a bootloader before soldering an SMT part in place, but as this is your first foray into the world of SMT, you would be strongly recommended to use a board (where the SMT device is going to be soldered) that has a ISP header in place, see the 6 pin one found on UNO\Mega Arduino boards. No need for an adapter then.

Also for checking pinouts etc, keep a copy of the device datasheet handy, its quicker check that than have to wait for an answer on here ..................

Are those isp headers expensive ? and will that allow me to program them more than once ? I was kind of curious about something like that.

Side question how do I know how the pins correlate to the digital pins like pin d7 and d8 are they like pin 19 etc? It shows the diagram on minicore but it doesn't make sense to me.

xzarida:
Are those icsp headers expensive ? and will that allow me to program them more than once ? I was kind of curious about something like that.

As expensive as 6 pins of 0.1" pin headers are, Google for a picture of an Arduino Uno to see.

Side question how do I know how the pins correlate to the digital pins like pin d7 and d8 are they like pin 19 etc? It shows the diagram on minicore but it doesn't make sense to me.

You need to understand the diagram .........

Arduino pin D7 is pin 11 on the TQPF32 package.

I don't even mount the 6-pin ISP header on the board (they cost pennies - you just take a piece of 40x2 0.1" pin header and cut to length, Like 10 cents or so from china if you want the one with the plastic housing and keying so it's impossible to insert backwards), I just leave the holes for it, and stick a piece of 2x3 header into the connector on my ISP programmer, stick it in the holes, and apply gentle pressure at an angle to make sure it makes contact. This worked fine for me (though since I scored a few 6-pin pogo pin adapters, I've been using those instead - they're an absolute joy to work with)

srnet:
As expensive as 6 pins of 0.1" pin headers are, Google for a picture of an Arduino Uno to see.

You need to understand the diagram .........

Arduino pin D7 is pin 11 on the TQPF32 package.


for the minicore example.

It says arduino pin 7 is pin 11 on the 32pin.

So I guess here sis what i get from this.

On the 32 pin

pin 1 = digital 3
pin 2 = digital 4
pin 3 = PE0 what does that mean ?
pin 4 = vcc
pin 5 = gnd
pin 6 = PE1 not sure what that means
pin 7 = pb6 not sure
pin 8 = pb7 not sure
pin 9 = digital 5
pin 10 = digital 6
pin 11 = digital 7
pin 12 = pb0 ports

So not sure what the PC1 port, PE ports or PB ports.

Does the data sheet have this info ?

The minicore diagram says that

PE1 is arduino pin 24 I believe thats A1 port ? So does that mean that the Es are analog ?

xzarida:
So not sure what the PC1 port, PE ports or PB ports.

Does the data sheet have this info ?

Why not take a look ?

Lots of useful stuff in device datasheets.

xzarida:
The minicore site says to hook the 33 pin to gnd. Kind of confused where it is.

My guess is pin 33 on that schematic is referring to the ground pad on the bottom of the QFN package version of the IC.

DrAzzy:
Like 10 cents or so from china if you want the one with the plastic housing and keying so it's impossible to insert backwards

I put those on a couple of my boards but decided I'm not a fan because they don't leave much of the female connector to grab onto so it's slow and frustrating to remove the programmer cable. That said, I've definitely connected my programmer upside down or even one row of pins over on the header a few times so there is something to be said for the keyed shroud.

xzarida:
pin 3 = PE0 what does that mean ?

It means bit 0 of port E. This is the pin notation you use if you are writing or reading the registers directly. Arduino assigns arbitrary numbers to each IO pin to make the code easier for beginners and also portable to any microcontroller. Arduino pin numbers are used with the Arduino core IO functions like pinMode, digitalWrite, digitalRead, etc. You should be aware that the use of the Arduino pin numbers does make these functions significantly slower than working directly with the registers. However, in most cases it doesn't matter and the benefits of using a standardized API greatly outweigh the overhead. MiniCore actually comes with some examples that demonstrate how to use the registers. You can find them at File > Examples > AVR C code examples when you have a MiniCore board selected from the Tools > Board menu. More information here:
https://playground.arduino.cc/Learning/PortManipulation/

xzarida:
PE1 is arduino pin 24 I believe thats A1 port ?

There is no such thing as an "A1 port". There is an A1 Arduino pin, but that's PC1.

xzarida:
So does that mean that the Es are analog ?

No. The pins marked with the An pin numbers are the Arduino analog input pins. Two of those are on port E. The rest are on port C.

Count your DIL pins... it says D28 but I counted 32 on the Amazon listing: https://www.amazon.com/Fincos-Adapter-Support-ATMEGA8A-ATMEGA328/dp/B07RTRYJG6

You may have to probe a bit to figure out what's connected to which pin.

srnet:
Why not take a look ?

Lots of useful stuff in device datasheets.

I couldn't find arduino pin references on the datasheet sadly. Am I missing something?

wolframore:
Count your DIL pins... it says D28 but I counted 32 on the Amazon listing: https://www.amazon.com/Fincos-Adapter-Support-ATMEGA8A-ATMEGA328/dp/B07RTRYJG6

You may have to probe a bit to figure out what's connected to which pin.

There are 32 pins! 16 on each side.

pert:
Arduino Playground - PortManipulation

Ty! This is exactly what I need. I mean the ports on this should be the same as the port on the the 328pb correct?

"arduino pin references on the datasheet"
They are not listed there.

Look at the Promini schematic to see the ohysical pin mappings used.

Port D0 is IDE-D0 no matter what physical pin it comes from on the Uno vs the Promini for example.
Arduino-Pro-Mini_328-v11.pdf (41.7 KB)

Arduino-Pro-Mini_328-v11.pdf (41.7 KB)

The Pro Mini schematic is OK, but there is an excellent pin mapping diagram provided right there on the MiniCore readme, which xzarida has already been using. I don't understand why they are looking elsewhere for this information. It's better to use the MiniCore diagram because this has information specific to MiniCore, such as PC6 being mapped to Arduino pin 22 if you program the RSTDSBL fuse, and ATmega328PB-specific information that will not be shown in the Pro Mini schematic.

pert:
The Pro Mini schematic is OK, but there is an excellent pin mapping diagram provided right there on the MiniCore readme, which xzarida has already been using. I don't understand why they are looking elsewhere for this information. It's better to use the MiniCore diagram because this has information specific to MiniCore, such as PC6 being mapped to Arduino pin 22 if you program the RSTDSBL fuse, and ATmega328PB-specific information that will not be shown in the Pro Mini schematic.

Yeah been using this schematic, just wasn't sure what the ports mean.

Just final question and I think I am okay to test some board stuff.

The arduino pin manipulation is the same as the minicore schematic correct? so the analog ports digital ports code wise for the digital writes and reads should be the same as long as I use the same ports as the the port manipulation diagram?

xzarida:
Yeah been using this schematic, just wasn't sure what the ports mean.

I think I already answered that.

xzarida:
The arduino pin manipulation is the same as the minicore schematic correct? so the analog ports digital ports code wise for the digital writes and reads should be the same as long as I use the same ports as the the port manipulation diagram?

That question makes absolutely no sense to me. Please try again.

xzarida:
I couldn't find arduino pin references on the datasheet sadly. Am I missing something?

Yes you did, I did not say you should look in the Atmel datasheet for Arduino pin mappings, best to quote my post in full;

Quote from: xzarida on Jul 17, 2019, 10:39 pm

So not sure what the PC1 port, PE ports or PB ports.

Does the data sheet have this info ?

Why not take a look ?

Lots of useful stuff in device datasheets.

You will find the refernces to PC1, PE ports and PB ports in the Atmel datasheet.

pert:
I think I already answered that.
That question makes absolutely no sense to me. Please try again.

On the Atmega 168 arduino pin mapping

(https://www.arduino.cc/en/Hacking/Atmega168Hardware)

PD0, PD1, PD2 are all digital pins(Digital 0 -2)

PC5, PC4, PC3 are analog pins (Analog 5-3)

Does the atmega328p have the same setup for the ports using the minicore example

Does PD0, PD1, PD2 are they Digital 0-2 in the arduino code ?

and similarily-

are PC5. PC4, PC3 the analog pins in the arduino code ?

(https://camo.githubusercontent.com/1158321594ca3f9ba348093edabc9fb3791a311c/68747470733a2f2f692e696d6775722e636f6d2f6e6177657145362e6a7067)

Just look at the MiniCore diagram. It clearly shows all the Arduino pins in the blue ovals.