EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: trilerian on November 17, 2023, 05:32:39 pm

Title: 328PB mcu question
Post by: trilerian on November 17, 2023, 05:32:39 pm
I have a couple of designs using the 328p in the tqfp package.  I bought some 328PB by mistake.  After trying to burn the bootloader to them I realized what I did, and edited the config file to be able to burn them as 328P.  I tried burning the bootloader as a 328PB, but never could get it to work.  So the other day I actually pulled up the data sheet on the 328PB and did notice a few pin changes from the 328P.  Aside from a couple of extra timers, which will be useful, we lose a vcc and a ground pin.    However, my current pcb designs have decoupling capacitors on those pins that are no longer vcc and ground.  What will be ramifications of this?  Basically I am pulling one pin low to ground with no resistor and one pin high with no resistor.  But the pins are not being used?  I can just not use the capacitors and peel up the traces to vcc pin, but for some reason cutting a new pcb doesn't sit well with me.  I don't think pulling an unused pin to ground will hurt anything.   

Does burning the bootloader as a 328P make any difference to those pins?  My assumption is to be able to use the extra pins in a future design, I need to burn the bootloader as 328PB.  Realistically speaking, the 328PB is cheaper, so I would prefer to go that direction.  Any future designs I make will take that into account.
Title: Re: 328PB mcu question
Post by: wraper on November 17, 2023, 05:47:01 pm
Quote
My assumption is to be able to use the extra pins in a future design, I need to burn the bootloader as 328PB
No.
Quote
Basically I am pulling one pin low to ground with no resistor and one pin high with no resistor. 
As long as you don't configure them as outputs, should be fine. Enabled pull-ups on the port will increase current consumption a little bit through former GND pin.
Title: Re: 328PB mcu question
Post by: coromonadalix on November 17, 2023, 06:30:48 pm
in my case : you had / have to find in arduino the 328pb  librairies ...   i have some of theses and it did not worked well ...

even avrdude avrdudess had some problems ...

had to switch to the P variant ...
Title: Re: 328PB mcu question
Post by: Faranight on November 17, 2023, 07:13:46 pm
I too was initially using ATmega328P, but later switched to using the ATmega328PB variant in my projects. While not pin-compatible, I very much liked the two extra 16-bit timers. Now I've switched to AVR32DB32.
Title: Re: 328PB mcu question
Post by: trilerian on November 17, 2023, 07:14:11 pm
Quote
My assumption is to be able to use the extra pins in a future design, I need to burn the bootloader as 328PB
No.
Quote
Basically I am pulling one pin low to ground with no resistor and one pin high with no resistor. 
As long as you don't configure them as outputs, should be fine. Enabled pull-ups on the port will increase current consumption a little bit through former GND pin.

Great!

in my case : you had / have to find in arduino the 328pb  librairies ...   i have some of theses and it did not worked well ...

even avrdude avrdudess had some problems ...

had to switch to the P variant ...


Yeah, I downloaded the support for the 328PB, and there is a config file for it in the bootloader, but it still doesn't work.  But, I was also applying 5v to one of the pins that is no longer VCC while trying to burn the bootloader. 
Title: Re: 328PB mcu question
Post by: trilerian on November 17, 2023, 07:28:13 pm
I too was initially using ATmega328P, but later switched to using the ATmega328PB variant in my projects. While not pin-compatible, I very much liked the two extra 16-bit timers. Now I've switched to AVR32DB32.

One day I'll get away from the 328P!

How is the internal vref on the AVR32? 
Looks like with a 12 bit ADC and an internal vref of 4.096 I could save quite a bit of money moving to that design over using a precession voltage reference and an external adc for my 328P.

I was going to try to port some stuff to the ESP32, but then found out how awful the ADC is.
Title: Re: 328PB mcu question
Post by: Faranight on November 17, 2023, 07:45:58 pm
How is the internal vref on the AVR32?
You have actually three separately configurable Vref's - one for ADC, one for DAC and one for AC's.
I think some analog peripherals should even have an additional 8-bit resistor ladder that lets you divide the selected reference voltage even further.
EDIT: There are also up to three (depending on model) signal-conditioning opamps inside the MCU.