Author Topic: Moteino and SPI  (Read 16962 times)

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Moteino and SPI
« Reply #30 on: January 07, 2015, 09:14:23 PM »
@Scott216, can you tell us how much memory you're consuming with this application using the Ethernet library?

Kiwi and I are both interested, but I'm concerned about consuming all of RAM to support Ethernet on a AtMega328P.

Tom
By the way, I looked at the code, the TextFinder library looks pretty sweet for HTTP clients...

I'm compiling with IDE 1.0.5, but I want to try it with 1.5.8.  Compiling my sketch uses 29,780 bytes (of a 32,256 byte maximum).  At the end of my setup function, I get the free RAM which is 445 bytes. 

I did purchase a MoteinoMega and want to try that and see if it's more stable.
Since you're down to that 'risky' level of available RAM, have you already moved your debug strings to Flash memory?  Look on adafruit for F() macro - this helps a lot!   I suppose I shouldn't be surprised that you're consuming 29K of memory, but, wow... I would have thought that the Ethernet library would over consume RAM rather than Flash storage.  The good news is that using up Flash doesn't create 'instabilities' while not having quite enough RAM certainly does!

Thanks for the info.  The MoteinoMega might not be a bad idea.  ;)
I'd use that too if I wasn't so invested in squeezing every possible bit of function out of the smallest possible device.  :D

Tom

pedro.albuquerque

  • NewMember
  • *
  • Posts: 19
  • Country: pt
Re: Moteino and SPI
« Reply #31 on: June 13, 2016, 07:02:17 PM »
Hello,

I'm trying to use a TFT display on Motion MEGA Lora, using SPI .
When I configure the TFT (Adafruit 2.2" ILI9340 or ITEAD ITDB02) to use hardware SPI it is way faster, but as soon as I get Motion to receive info from another Motion, the display and sketch "hangs".

All work fine as long as :
1- no packets are sent form remote motion
2- or use software SPI on receiving Moteino

I have two question if anyone can help:

a) reading this thread I understand this is not uncommon, and eventually a resistor on MISO may solve the problem. is this applicable i this case? any experience with OLED displays/SPI based displays?

b) how does one library know that the other one is not using the SPI lines ? how does it know that SS on the other divide is not active? Moteino is using interrupts for the library to be aware that data is coming and initiate a SPI read right ? If I'm sending data to the display will it not interrupt the display communication ?
How is this potencial conflict avoided ?