Can't manage to program 328pb on custom PCB-Board via TTL

Hi!

we are trying to program our Atmel Atmega 328PB on custom Board! We finally managed to Burn to Bootloader -> see Forums Thread about our Bootloader Issue

Now we have a new mistake: We are not able to program the 328pb via TTL (RX & TX).

In my understanding i just connecting:
Programmer TX -> uC RX
Programmer RX -> uC TX
Programmer GND -> PCB-Board GND
Programmer VCC -> PCB-Board Vcc (3,3V)

Everytime i try to programm i get the following errors:

What i tried so far:

  • Restart PC
  • Restart Arduino IDE
  • Replug USB-Cable
  • Checking the connecting between Programmer and 328PB
  • Tried different Programmer (Still Pololu USB AVR Programmer)
  • Disconnect Vcc to PCB-Board (Vcc output is disabled since the PCB-Board has its own Power Source)
  • I also tried different Setting while burning the Bootloader:

    -> Here i tried Bootloader: "No Bootloader" - "Yes (UART0)" and "Yes (UART1 328PB only).

But: For each setting i tried to use TX1/RX1 and TX2/RX2 but the same error occured.

Furthermore i burned the bootloader on a Pololu A-Star 328PB and tried to program it via Serial but there was the same error. I have the feeling that i don't burn the bootloader properly.

While burning the bootloader i receive the following:

avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1\avrdude.conf

         Using Port                    : COM8
         Using Programmer              : stk500
         AVR Part                      : ATmega328PB
         Chip Erase delay              : 10500 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom                 65    20     4    0 no       1024    4      0  3600  3600 0x00 0x00
           flash                  65    10   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           hfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           efuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           lock                    0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: STK500
         Hardware Version: 15
         Firmware Version Controller : 2.10
         Topcard         : Unknown
         Vtarget         : 3.3 V
         SCK period      : 8.7 us
         Varef           : 0.0 V
         Oscillator      : Off
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9516 (probably m328pb)
avrdude: erasing chip

avrdude: processing -U lock:w:0xff:m
avrdude: reading input file 0xff for lock
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lock ...
avrdude: 1 byte of lock written
avrdude: verifying lock memory against 0xff
avrdude: 1 byte of lock verified

avrdude: processing -U efuse:w:0b11110101:m
avrdude: reading input file 0b11110101 for efuse
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte efuse ...
avrdude: 1 byte of efuse written
avrdude: verifying efuse memory against 0b11110101
avrdude: 1 byte of efuse verified

avrdude: processing -U hfuse:w:0xd7:m
avrdude: reading input file 0xd7 for hfuse
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte hfuse ...
avrdude: 1 byte of hfuse written
avrdude: verifying hfuse memory against 0xd7
"C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\tools\avrdude\7.2-arduino.1/bin/avrdude" "-CC:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/avrdude.conf" -v -patmega328pb -cstk500 -P COM8 "-Uflash:w:C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/bootloaders/empty/empty.hex:i" -Ulock:w:0xff:m
avrdude: 1 byte of hfuse verified

avrdude: processing -U lfuse:w:0b11111111:m
avrdude: reading input file 0b11111111 for lfuse
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lfuse ...
avrdude: 1 byte of lfuse written
avrdude: verifying lfuse memory against 0b11111111
avrdude: 1 byte of lfuse verified

avrdude done.  Thank you.


avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1\avrdude.conf

         Using Port                    : COM8
         Using Programmer              : stk500
         AVR Part                      : ATmega328PB
         Chip Erase delay              : 10500 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom                 65    20     4    0 no       1024    4      0  3600  3600 0x00 0x00
           flash                  65    10   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           hfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           efuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           lock                    0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: STK500
         Hardware Version: 15
         Firmware Version Controller : 2.10
         Topcard         : Unknown
         Vtarget         : 3.3 V
         SCK period      : 8.7 us
         Varef           : 0.0 V
         Oscillator      : Off
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9516 (probably m328pb)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.
avrdude: erasing chip

avrdude: processing -U flash:w:C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/bootloaders/empty/empty.hex:i
avrdude: reading input file C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/bootloaders/empty/empty.hex for flash
         with 0 bytes in 0 sections within [0, -1]
         using 0 pages and 0 pad bytes
avrdude: writing 0 bytes flash ...
Writing | ################################################## | 100% 0.00s
avrdude: 0 bytes of flash written
avrdude: verifying flash memory against C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/bootloaders/empty/empty.hex
Reading | ################################################## | 100% 0.00s
avrdude: 0 bytes of flash verified

avrdude: processing -U lock:w:0xff:m
avrdude: reading input file 0xff for lock
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lock ...
avrdude: 1 byte of lock written
avrdude: verifying lock memory against 0xff
avrdude: 1 byte of lock verified

avrdude done.  Thank you.

Hi @alxwhter328pb. You must reset the microcontroller in order to activate the bootloader.

I see that board has the special "auto reset" circuit that will cause the microcontroller to be reset automatically at just the right time during the upload operation. So the only thing required is to connect the DTR or RTS pin of your USB to serial adapter module to pin 6 of the J3 header on your board.

If your USB to serial adapter doesn't have a DTR or RTS pin, or if there is some other reason why using the auto reset is not feasible, you can manually reset the microcontroller when the upload process starts. Note that Arduino IDE compiles your sketch before starting the upload process, so you must wait until you see that avrdude command printed in the "Output" panel of Arduino IDE before you reset the microcontroller.

If you do that then you won't be able to upload via the UART interface. This option is used when you will only ever be uploading via an ISP programmer.

So if you had the "No bootloader" option selected the last time you performed a "Burn Bootloader" operation, then you must select the appropriate UART option from that menu and then do another "Burn Bootloader" operation before you will be able to upload via the UART interface.

Hi @ptillisch

first of all: Thanks for your answer.

I burned a new bootloader and connected the way you described it:
Still the same error :neutral_face:

I tried the same for a Pololu A-Star 328PB Board and i also had the same error.
The schematic on the Pololu-Board should be ok, because it worked before. As soon as i burned my own bootloader its not working anymore :slightly_smiling_face:

Do you have more ideas?

Which setting did you have selected from the Tools > Bootloader menu when you did that?

Which header on the board is the RX and TX pins of your USB to serial adapter connected to?

I'm going to ask you to post the full verbose output from an upload attempt.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to fail.
  7. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block icon on toolbar
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.


I saw from the other thread you said:

Did you ever solder the oscillator?

Were you using MiniCore? If so, please tell me what you had selected from the following Arduino IDE menus:

  • Tools > Bootloader
  • Tools > Clock

Hi @ptillisch ,

maybe its a little bit confusing: I have two PCB-Boards with the 328PB. One custom selfmade Board (see other Forum Article) and one Pololu 328PB-Board.

For the custom Board:

  • Which setting did you have selected from the Tools > Bootloader menu when you did that?

UART0

  • Which header on the board is the RX and TX pins of your USB to serial adapter connected to?

I used RX and TX from J1 on our Board. They are connected to Pin 30 and 31 on the 328PB -> so RXD0 and TXD0. Thats why i used UART0 while burning the bootloader

I also connected the DTR to the J3 like mentioned before.

The Error Message is

Sketch uses 506 bytes (1%) of program storage space. Maximum is 32384 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\tools\avrdude\7.2-arduino.1/bin/avrdude" "-CC:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/avrdude.conf" -v -V -patmega328pb -curclock -PCOM7 -b115200 -D -xnometadata "-Ueeprom:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\94BC2B03E8EBB85C6F5DDABFEFC96F61/sketch_jan16a.ino.eep:i" "-Uflash:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\94BC2B03E8EBB85C6F5DDABFEFC96F61/sketch_jan16a.ino.hex:i"

avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1\avrdude.conf

         Using Port                    : COM7
         Using Programmer              : urclock
         Overriding Baud Rate          : 115200
avrdude urclock_getsync() warning: attempt 1 of 10: not in sync
avrdude urclock_getsync() warning: attempt 2 of 10: not in sync
avrdude urclock_getsync() warning: attempt 3 of 10: not in sync
avrdude urclock_getsync() warning: attempt 4 of 10: not in sync
avrdude urclock_getsync() warning: attempt 5 of 10: not in sync
avrdude urclock_getsync() warning: attempt 6 of 10: not in sync
avrdude urclock_getsync() warning: attempt 7 of 10: not in sync
avrdude urclock_getsync() warning: attempt 8 of 10: not in sync
avrdude urclock_getsync() warning: attempt 9 of 10: not in sync
avrdude urclock_getsync() warning: attempt 10 of 10: not in sync
avrdude urclock_recv() warning: programmer is not responding; try -xstrict and/or vary -xdelay=100
avrdude main() error: unable to open programmer urclock on port COM7

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

About the oscillator: At the moment the oscillator is soldered. While burning the bootloader is used the setting for clock "External 8 MHz"

For the Pololu 328PB Board:

For burning the Bootloader is used "UART0" (because i use TXD0 and RXD0) and Clock "External 12 MHz" (the board has a 12 MHz oscillator). While trying to serial program it get the same error message:

Sketch uses 490 bytes (1%) of program storage space. Maximum is 32384 bytes.
Global variables use 6 bytes (0%) of dynamic memory, leaving 2042 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\tools\avrdude\7.2-arduino.1/bin/avrdude" "-CC:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/avrdude.conf" -v -V -patmega328pb -curclock -PCOM7 -b115200 -D -xnometadata "-Ueeprom:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\94BC2B03E8EBB85C6F5DDABFEFC96F61/sketch_jan16a.ino.eep:i" "-Uflash:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\94BC2B03E8EBB85C6F5DDABFEFC96F61/sketch_jan16a.ino.hex:i"

avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1\avrdude.conf

         Using Port                    : COM7
         Using Programmer              : urclock
         Overriding Baud Rate          : 115200
avrdude urclock_getsync() warning: attempt 1 of 10: not in sync
avrdude urclock_getsync() warning: attempt 2 of 10: not in sync
avrdude urclock_getsync() warning: attempt 3 of 10: not in sync
avrdude urclock_getsync() warning: attempt 4 of 10: not in sync
avrdude urclock_getsync() warning: attempt 5 of 10: not in sync
avrdude urclock_getsync() warning: attempt 6 of 10: not in sync
avrdude urclock_getsync() warning: attempt 7 of 10: not in sync
avrdude urclock_getsync() warning: attempt 8 of 10: not in sync
avrdude urclock_getsync() warning: attempt 9 of 10: not in sync
avrdude urclock_getsync() warning: attempt 10 of 10: not in sync
avrdude urclock_recv() warning: programmer is not responding; try -xstrict and/or vary -xdelay=100
avrdude main() error: unable to open programmer urclock on port COM7

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

Thats confusing me a lot why it doesn't work on the Pololu 328PB. With the original bootloader it worked before, but as soon as i burned my "own" bootloader its not possible to programm the 328PB via UART :neutral_face:

I replicated your system with my own ATmega328PB-based board, 8 MHz external oscillator, and all the same IDE settings. I also encountered this error when uploading.

I then selected Tools > Baud rate > Default from the Arduino IDE menus and tried uploading again (it is not necessary to do another "Burn Bootloader" operation after changing this setting). With that menu configuration the upload was successful.

I didn't investigate this, but I would suggest trying another upload with the Tools > Baud rate > Default setting. It might be that the 115200 baud is not compatible with a 12 MHz clock, as I found to be the case with the 8 MHz clock during my experiment.

Good Idea @ptillisch

mhhh i still receive the same error :upside_down_face:

I tried 57600, 115200 and Default (also 57600) for both boards. I am still getting the same error.

I also tried 9600 for our own PCB-Board for Fun -> also error.

If my 328PB would been broken i would not be able to burn the bootloader right?

That all looks correct to me.

That is unfortunate. I'm afraid I'm out of ideas.

As I mentioned in my previous reply, I replicated your system myself and everything worked perfectly once I made that "Baud rate" menu adjustment. This tells us that there isn't anything fundamentally broken about the MiniCore support for this configuration. I was using the same version 3.0.1 of MiniCore as you.

Hopefully one of the other forum helpers with more knowledge on this subject matter will be able to provide better assistance than I have been able to.

If you get desperate, you could try using the Arduino IDE Boards Manager to downgrade MiniCore to version 2.2.2 and then repeat the "Burn Bootloader" operation and upload attempt once more. The reason I suggest this is that MiniCore migrated from the traditional Optiboot bootloader to a new bootloader named Urboot. Urboot is working fine for me and I know MCUdude has tested it extensively before making this migration, but it is a newer bootloader whereas Optiboot has a development history that spans around two decades and has provided reliable uploads for millions of Arduino boards.

There are differing degrees of "broken", so not necessarily.

When i used MiniCore Version 2.2.2 i was atleast able to programm the Pololu 328PB via TTL, but only once! Atleast something :partying_face: :partying_face: :partying_face:

When i tried to programm the uC a second time a get the same error again. For my own PCB-Board it wasn't possible. I am still on it. I also started threads in different Forums.

"Can only upload once" might be a symptom of the auto-reset circuit not working. After you do a "Burn Bootloader" operation, the board is left in a state where the bootloader runs constantly, so a reset is not required to activate the bootloader on the first upload after that.

To test this, you could see whether uploads work after a manual reset. The tricky thing is that when you press the "Upload" button in Arduino IDE, it first compiles your sketch before starting the actual upload. If you reset the microcontroller immediately after pushing the button, the bootloader will have timed out by the time the upload actually starts. The way to get the timing right is:

  1. Select Sketch > Upload from the Arduino IDE menus to start an upload (or click the upload button or whatever you prefer).
  2. Watch the black console window at the bottom of the Arduino IDE window until you see something like this:
    Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. 
    Maximum is 2048 bytes.
    
  3. Immediately press and release the reset button. The upload should now finish successfully.

Hello alxwhter
I have faced the same problem and after two days of hard struggle fixed it by just cross-wiring RX and TX. the FTDI Rx should go to TX of your Microcontroller and TX should go to RX (i am using ATMega32A).

You are welcome!

Hi @sagarsaini. Thanks for sharing your findings!

https://www.hackster.io/sainisagar7294/arduino-ch340g-troubleshooting-fixing-errors-and-drivers-4f5eaf#toc-solving-troubleshooting-after-installing-drivers--software-troubleshooting-1

So, I tried to upload sketch again and failed. After searching more in datasheets and web pages the same thing is given as before.

After some days, I got an idea to burn Arduino Uno bootloader in NANO. So, I connected Nano with my Arduino UNO using this schematic and burn bootloader. And this thing solved my problem, Here I am using Arduino UNO bootloader in NANO. I am very happy and curious to know why this thing is not work with NANO board directly.

The classic Nano (as well as its 3rd party derivatives) have been manufactured with two different types of bootloader installed. Originally a bootloader named "ATmegaBOOT" was used. There is a bug in this bootloader that causes it to go into an endless reset loop after a watchdog reset. So in 2018 Arduino switched to installing the excellent Optiboot bootloader (which had already been in use on the Uno boards for years) when manufacturing the official Nano boards. The two bootloader have different configurations so the upload parameters that work for one don't work for another. For this reason, Arduino added a ATmega328P (Old Bootloader) item to Arduino IDE's Tools > Processor menu for the Arduino Nano board definition. Those using a board with the "ATmegaBOOT" bootloader must select Tools > Processor > ATmega328P (Old Bootloader) from the menu and those using a board with the Optiboot bootloader must select Tools > Processor > ATmega328P (the default value).

Even though it has now been 6.5 years since the bootloader change, some of the manufacturers of the cheap Chinese derivatives like your "Nano" never bothered to make the change and so still ship boards with the "ATmegaBOOT" bootloader installed. My guess is that you got one of those boards and the upload failed because you had Tools > Processor > ATmega328P selected from the Arduino IDE menus.

So you could have fixed the problem very easily by selecting Tools > Processor > ATmega328P (Old Bootloader).

I wouldn't recommend your solution to the average beginner because they tend to find it very challenging to accomplish a successful "Burn Bootloader" operation, and they often don't have the required hardware on hand.

However, you pulled it off and definitely are better off for it in the end. Optiboot is a superior bootloader. In addition you reaped even greater benefits by selecting Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus before performing the "Burn Bootloader" operation. Unlike "ATmegaBOOT", which requires a 2 kB boot section be reserved in the microcontroller's flash memory, Optiboot fits in a 0.5 kB boot section. The "Arduino Uno" board board definition was correctly configured to only reserve a 0.5 kB section](ArduinoCore-avr/boards.txt at 1.8.6 · arduino/ArduinoCore-avr · GitHub). However, the Nano board definition was configured to unnecessarily reserve 2 kB. This means that using the configuration from the "Arduino Uno" board definition gives you an extra 1.5 kB of precious flash memory for your sketch program!

https://www.hackster.io/sainisagar7294/arduino-ch340g-troubleshooting-fixing-errors-and-drivers-4f5eaf#toc-solving-troubleshooting-after-installing-drivers--software-troubleshooting-1:~:text=limit%20the%20use%20of%202%20analog%20pins%20i.e%20A6%20and%20A7

Using UNO bootloader inside NANO board will limit the use of 2 analog pins i.e A6 and A7. Because smd package of 328P MCU has 2 extra analog pins.

This is false information. The bootloader doesn't have anything to do with the ADC capabilities of the board. In fact you can use A6 and A7 without any problems at all. Please correct this misinformation in your hackster.io project.

There is one difference. When you compile with Tools > Board > Arduino AVR Boards > Arduino Uno selected from the Arduino IDE menus, the NUM_ANALOG_INPUTS macro is set to 6:

When you compile with Tools > Board > Arduino AVR Boards > Arduino Nano selected from the Arduino IDE menus, the macro is set to 8:

However NUM_ANALOG_INPUTS is not used anywhere in the core or any of the official Arduino libraries and I have found almost no usage of it in 3rd party projects. So it is unlikely you would ever experience any problems caused by it being set to 6.

https://www.hackster.io/sainisagar7294/arduino-ch340g-troubleshooting-fixing-errors-and-drivers-4f5eaf#toc-my-own-usb-to-serial-programmer-4

I searched for the schematics of ch340 and made my own Usb to serial programmer.

I strongly recommend you redesign your PCB to use the standard "FTDI header" pinout:

  • DTR or RTS
  • RX
  • TX
  • VCC
  • CTS
  • GND

That will allow you to plug the adapter right in to boards that use this standard pinout such as the Arduino Pro Mini:

📷

51eec3b1ce395f4b4b000000.png by SparkFun - CC BY-SA 4.0

Adapters that use non-standard pinout force the users to use a mess of jumper wires to adapt it to the standard pinout.