0
\$\begingroup\$

I'm having problems uploading sketches to my custom arduino uno design. I have a ttl to usb based on the ch340 and at the same time I have a RS485 transcriber both conected to the atmega328 serial port, since I know I can't use both devices at the same time I added a jumper (J11) to enable or disable the RS485 part of the circuit when I want to upload sketches or use the USB port to debug my code, following the arduino uno design I added two 1K resistor in series on the RX and TX (R29 and R30) see https://electronics.stackexchange.com/a/213167/123482 so the RS485 takes preference over the USB when selected with the jumpers.

enter image description here

I have tracked down the issue to my USB part of the design, if R15 and R16 are 320k like on my schematic the arduino IDE can't upload code to the board, avrdude timeouts, if I change the resistor values from 320K to 1K most of the times the upload works as expected but fails when it tries to read back the flash memory, if I remove the resistors it always work as expected. Obviously the problem is there but why?

enter image description here enter image description here

Note: Added 328 pinout

asked Nov 25, 2018 at 20:46
\$\endgroup\$
7
  • \$\begingroup\$ Did you use a programmer and burn the bootloader on the 328? Arduino only works because the stock 328 has a custom bootloader burned on it. \$\endgroup\$ Commented Nov 25, 2018 at 21:19
  • \$\begingroup\$ The LEDs are resistors are masking another issue by forcing the IO lines high or adding excessive loading on them. Remove R15,16 and only add them back after it is working. \$\endgroup\$ Commented Nov 25, 2018 at 21:23
  • \$\begingroup\$ Also a schematic showing the 328 pinout etc. Would be helpful... \$\endgroup\$ Commented Nov 25, 2018 at 21:24
  • 1
    \$\begingroup\$ @MadHatter yes, I used the ISCP to burn the bootloader. Is fully functional as I can upload sketches using the USB port when R15 and R16 are removed \$\endgroup\$ Commented Nov 25, 2018 at 22:47
  • \$\begingroup\$ Measure R15/R16 with a meter, see if they are really 320K. I wouldn't expect that high of a resistance to even let the LEDs turn on. \$\endgroup\$ Commented Nov 26, 2018 at 15:32

1 Answer 1

1
\$\begingroup\$

Add a 10K pullup on Reset also, with a 0.1uF from DTR to Reset. That way the USB chip can cause a software created Reset to kick off the bootloader for an upload.

answered Nov 25, 2018 at 23:34
\$\endgroup\$
1
  • \$\begingroup\$ I already have it in another part of the schematic, anyway it's not related with the R15/R16 probem \$\endgroup\$ Commented Nov 26, 2018 at 7:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.