Go Down

Topic: SPI woes - Ethernet shield vs. everything else (Read 5030 times) previous topic - next topic

ghlawrence2000

#30
Jun 03, 2016, 02:57 am Last Edit: Jun 03, 2016, 03:02 am by ghlawrence2000
Well I apologise if you feel that way!

John and I asked for your help as a leading contributor to the Arduino world to basically be told don't care, not interested. I am not a newbie asking a stupid question, I am moderately knowledgeable in most things Arduino now, and would not have asked for help if it were not required. I didn't like your attitude. I understand your driving passion to be teensy, but the reason I thought maybe you could help us, was because you clearly have a better understanding of the SPI library with all of your work on transactions.

Sorry we even bothered to think you might be interested in helping!!

Regards,

Graham

PS, regardless what you think of my reaction, I and many others are grateful for all of your efforts!!
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

SurferTim

#31
Jun 03, 2016, 03:14 am Last Edit: Jun 03, 2016, 03:15 am by SurferTim
@ghlawrence2000: Are you still having problems with the w5100 and the SD interface? Mine is working great now, thanks to your input. Is there something else here I am missing?

ghlawrence2000

Tim,

I  need to sleep now, glad I helped with your SdFat issue! 

Will post the  outstanding problem tomorrow if John doesn't beat me to it.

Regards,

Graham

UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

SurferTim

#33
Jun 03, 2016, 03:25 am Last Edit: Jun 03, 2016, 05:03 pm by SurferTim
Ok. Talk to you later. Thanks again for the help. Hope I can return the favor.

edit: After a quick check of the pin mapping for the Due, I noticed both D10 (PA28/SPI-CS0 and PC29/D10) and D4 (PA29/SPI-CS1 and PC26/D4) connect to two pins on the CPU. Do not set either of those pins as OUTPUT. Use digitalWrite to change them to HIGH only. That will disable the SPI on both devices without causing a conflict between the digital pins and the SPI pins on the ARM CPU.
Code: [Select]
void setup()
{
  Serial.begin(115200);

  // disable SPI on both devices
  digitalWrite(4,HIGH);
  digitalWrite(10, HIGH);

  // rest of your setup code

ghlawrence2000

Hi Tim,

I cannot go into glorious detail since I cannot get my newly arrived E2 Sheild (THANKS! John) to work with my TFT shield. The display doesn't seem to like being on the end of wires :(. The situation as I understand from John, is that UDP reads, corrupt UTFT variables.... Since UTFT_GHL relies on those variable, both libraries are corrupted by UDP reads. 

It makes no sense I know, but I cannot explain better than it has been explained to me.

Regards,

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

SurferTim

Can you post the library you are using for that TFT display? What interface does it use? Is it SPI?

ghlawrence2000

It is the standard UTFT library by Henning Karlsen. No, it is not SPI, it is 16 bit parallel.

It makes NO sense.... I know all of that...

There is not enough information I can give you at this point in time to help you try to figure this out, if John wants to elaborate, maybe he can give you more detail about this issue.

The problem I am having right now, as no doubt you are aware, is that the E2 shield is UNO format, and I want to plug in a MEGA/DUE format TFT shield into that, and wiring these two together , the display doesn't work.

Sorry this is only half a story, but I can't do any better right now :(.

Regards,

Graham

UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

SurferTim

I see. The library download appears to be 2MB. I'm not sure I have the time to dig through that much library.

Is it working on the Due without the w5100/SD shield?

ghlawrence2000

#38
Jun 04, 2016, 12:21 am Last Edit: Jun 04, 2016, 12:22 am by ghlawrence2000
Tim, I appreciate your offer and willingness to help, but I would prefer I could give you specifics to work on, which currently I am not able to do.

Yes it works flawlessly on the DUE, with SD card AND Flash SPI chip, the only thing that buggers it up is the Ethernet card which personally I cannot get working yet.

Probably this thread can be closed now, John will read this tomorrow no doubt, if he can give you more detail that would be great, otherwise wait until I have all hardware connected together and we can create another thread.

Thanks again for your help!

Regards,

Graham

+1 by the way
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

johnlinford

Here is an interim update.

With the updates that Graham has already mentioned earlier in this thread I seem now to be able to run WizNet (UDP and TCP/IP) together with SdFat and UTFT_GHL and they all coexist on the SPI bus. I'm not completely sure what I've done to get to this happy state, nor am I fully convinced that it is definitely 100% working. I'm going to need to spend some more time on this over the next day or so but I will write up whatever conclusions I reach, as soon as possible, here.

Regards,

John.

ghlawrence2000

Thanks John and Tim,

All help to resolve these issues is very much appreciated!!

Regards,

Graham

+1 John
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

SurferTim

#41
Jun 04, 2016, 12:51 am Last Edit: Jun 04, 2016, 12:53 am by SurferTim
I've used my Due with the ethernet shield and a 10DOF board (I2C), a Adafruit Ultimate GPS (serial), and a 16 channel servo controller (I2C), and had no problems, even with UDP, which is my favorite protocol. Don't know what to tell you.

ghlawrence2000

#42
Jun 04, 2016, 02:41 pm Last Edit: Jun 04, 2016, 05:27 pm by ghlawrence2000
To summarise what we did to reach this happy state of affairs :-

SdFat with UTFT_GHL works fine as relased, the DMA code used in UTFT_GHL is the same as that used in SdFat, so there is no real surprise this combination works without issue.

UTFT_GHL and Ethernet, not happy, ethernet hangs after access to the Font IC.
SdFat and Ethernet, not happy, ethernet hangs after access to the SD card.

The solution here is to configure SdFat, in SdFatConfig.h change Line 81 to #define SD_SPI_CONFIGURATION 1.

This should fix your problems with Ethernet and SdFat.

To effect the same fix to UTFT_GHL,, in HW_ARM.h (currently line 39) change to #define USE_SAM3X_DMAC 0.


That's the end of the good news unfortunately, the result of these changes is significantly slower SPI performance.

I have an Ethernet R2 card now (THANKS, you know who you are), so this is not the end by any means, if we come up with another solution, it will be posted either in this thread or a new one.

Hope this will save people LOTS of time!!

Regards,

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

johnlinford

Just as a final follow-up to Graham's note, I'm happy to be able to confirm that all three libraries are playing nicely now. My app is running quite large volumes of UDP inbound, rather less outbound, together with regular reads & writes to the SD card and updates to the display. There doesn't seem to be any particular order that's best for initialisation but I am doing it thus:

UTFT_GHL
UTouch
Ethernet
SdFat

The Due is handling inbound UDP traffic at the rate of around 800kbit/s from my LAN without any problem at all, so even though the SPI is running more slowly than it might it seems to be coping well.

My thanks to Graham for his considerable assistance with this rather tricky problem.

John.

Go Up