Go Down

Topic: [SOLVED] USBasp and TFT - MISO/MOSI line interference? (Read 346 times) previous topic - next topic

gimpo

I'm away from my "arduino-laboratory", anyway I'm thinking about what happens while re-programming my Arduino Pro Mini - 3.3V while the TFT is connected and powered. I'm using a cheap 1.44" via adafruit libraries.

Here my simple schematics:


Somebody experienced troubles when trying to re-program Arduino with a similar wiring?

As I know the CS pin of the TFT is the key: it is connected to the SS pin of arduino to indicate whenever the master is sending data (and the slave has to receive them) or viceversa.
What if I put that pin to logic level high (i.e. connecting it to 3v3 by using a wire) when reprogramming arduino with the USBasp dongle?

In fact, it seems that the IDC-10 connector coming from the USBasp board is not using the SS pin at all:


Yes, installing a simple jumper to power off the TFT seems the most logic and easy option, but I have some dozens of PCBs yet designed and printed. So I would not to modify the design/layout of the PCB, as well as to wait a month until they are ready.... :( :( :(
Arduino, what else?

avr_fred

Your schematic does not show the ISP connections, how are you connecting the USBASB?

You need a 10k pull-up resistor on the processor RST pin.

Rhetorical statement: why do people order pc boards of an untested design?

gimpo

#2
May 12, 2018, 07:22 pm Last Edit: May 12, 2018, 07:28 pm by gimpo
Hi avr_fred,

Your schematic does not show the ISP connections, how are you connecting the USBASB?
It's quite straightforward from the image of the IDC-10 connector of the USBasp dongle I posted:
(Please note that the image I posted is for a 5 Volt programmer, I'm using a USBasp @ 3.3 Volt instead)

IDC-10  
Arduino
MOSIMOSI pin (#14)
MISOMISO pin (#15)
SCKSCK pin (#16)
VCC +3.3V    VCC pin (#21)
RESET    Reset pin (#22)
GROUNDGND pin (#23)


You need a 10k pull-up resistor on the processor RST pin.
The reset pin is also connected to the RST pin of the USBasp programmer (see table above). Your proposal will not affect the succes of the programming action?


Rhetorical statement: why do people order pc boards of an untested design?
I don't understand what you mean. I'm using the circuit above with success since 2 years.
Until now I was re-programming my Pro Mini by using an FTDI breakout. Now I want to approach to ISP programmers, that is something new for me.
Arduino, what else?

gimpo

Maybe a 10K pull-up resistor on the SS pin of Arduino (#23 in my schematic) ?  ::)

In this way the TFT should be never be "activated" as a slave and it will not be messed up by the write-operations of the ISP-programmer...
Arduino, what else?

avr_fred

#4
May 13, 2018, 11:23 pm Last Edit: May 13, 2018, 11:26 pm by avr_fred
The SS line or the reset line of the TFT could hang things.

I'd pull both up or down as appropriate. Reset should be what holds the TFT in reset which should float the SPI pins of the TFT. The processor output pin that you're using to control it will be floating hi-z when programming - so what state does that leave the TFT in?




gimpo

Tomorrow I will try to pull-up the RST pin only and see what happens. Then I will try to pull-up the SS and RST pins both.

Just one doubt: the RST pin is in common with the RST line coming the USBasp too. When re-programming an arduino it is normal to have it constantly at high-level?

But maybe the only way is doing some tests. I'm just worry to damage one (or more) TFT in doing that...  :(
Arduino, what else?

DrAzzy

#6
May 14, 2018, 02:14 am Last Edit: May 14, 2018, 02:15 am by DrAzzy
10k pullup on reset is not needed when programming via ISP (though is recommended for noise rejection on reset pin). It is necessary if programming with serial bootloader using DTR reset trick.

You probably do need a pullup on the CS line. Also, check specs/resources/datasheet for the display - some "SPI" devices don't actually tristate MISO when CS is released (making it impossible to have more than one SPI device on the bus) - if that's the case, the standard solution is to connect ISP straight to the pins, but put a resistor between the MISO pin of microcontroller and MISO pin of the poorly-behaved SPI device (screen in this case), so if it and the ISP programmer fight for control of that line, the ISP programmer will win.

Also, is the screen being powered? If not, you'll be "backpowering" it through the SPI pins, and that will drag those pins down - potentially damaging the screen in the process.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

gimpo

#7
May 22, 2018, 10:02 pm Last Edit: May 24, 2018, 04:47 pm by gimpo
Failure...  :smiley-confuse:

1st attempt: detach TFT power - Failed

I have cut the trace on the PCB powering the TFT display. Nevertheless, the display was still weakly powered via the other pins (MISO, SCK, etc.). The luminosity was low, but it was clearly still working.

After uploading the sketch via the USBasp programmer I've got the error during the verification phase: "verification error, first mismatch at byte 0x0000..."


2nd attempt: pull-up the chip-select line - Failed

I have attached a 10K pull-up resistor in order to force the line to the logic HIGH level (see the attached circuit).
After uploading the sketch, the verification phase failed:

avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
      Double check connections and try again, or use -F to override
      this check.

I have detached the arduino from the PCB board and tried to program it alone. Again the same error.
I was no able to re-program the Arduino anymore.  Arduino fried. :smiley-cry:

Any other idea?
BTW, the display is using an ST7735 chip.
Arduino, what else?

gimpo

#8
May 24, 2018, 04:59 pm Last Edit: May 24, 2018, 05:00 pm by gimpo
SOLVED!

I've found the solution by reading a question on StackExchange:



I have added one 10K resistor on the MOSI line, just between the TFT and USBasp programmer. It has worked like a charm.
The MISO line was not used by the TFT at all, so need for a second resistor. Also, the SCK line is used for pure timing, so there is no real need to "silence" that one too.

As I have experienced , there is no real need to remove the resistor after the re-programming is complete. The TFT continue to work normally even with the resistor still in place.

Arduino, what else?

Go Up