Hi everyone. I'm very new to adruino and programming, and would appreciate if someone can help.
I've a sketch that originally was made for atmega 328PB. I've made a scheme utilizing 328P and it didn't work for me. Upon invistigation, I've revealed that there are difference in pin out, and this was a reason why it didn't work on 328p.
Can someone adjust the sketch for 328p micro controller?
You don't need to attach a file, in fact it is better to post your sketch here to avoid the need for it to be downloaded from an external site
Please post your full sketch, using code tags when you do. This prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
The PB has dual Serial. Pins 15 & 16 are TXD1 & RXD1 - pins 30 & 31 are TXD0 and RXD0, same as for P (PD0 & PD1 for both). Those MCUs were not designed to be directly pin compatible replacements.
Thanks for getting back to me on this. You are correct. I belive by correcting the sketch and indicating the correct pins should solve the problem.
I'm not the owner of this sketch and I'm not aware how to make any correction in the sketch, that is why I'm asking her for help.
My dear friend, I've 0 knowledge in making correction in the sketch. I've managed to download it to the MCU, and because it didn't work, I've started to troubleshoot and revealed this difference. I don't have any programs either to read a sketch or to edit. It will take me a long time to figure out how to make the adjustment, that is why I'm asking for help.
PB1 pin out for both MCUs is the same and it's giving me 5v as it was suppose to do. The only change here is the tx and rx.
You might be right, I'm not sure myself, that is why trying to get some help here.