Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Sends data to arduino via Spi

2 posters

Go down  Message [Page 1 of 1]

1Sends data to arduino via Spi Empty Sends data to arduino via Spi Thu May 27, 2021 9:36 pm

feri



I would like to create a module that sends data to arduino via Spi, in the examples the devices only receive.
You could have an example of sending data.
Thank you very much
Giordano

2Sends data to arduino via Spi Empty Re: Sends data to arduino via Spi Fri May 28, 2021 10:31 pm

feri



I took ili9341 as an example, removed the comment on the Miso pin.
numbered as 4 "m_pin [4] = & m_pinMiso;" created output "eLogicDevice :: createOutput (& m_pinMiso);" but when I try to set it "eLogicDevice :: setOut (4, false);" Simulide crashed.
regards

3Sends data to arduino via Spi Empty Re: Sends data to arduino via Spi Sat May 29, 2021 2:54 pm

arcachofo

arcachofo

when I try to set it "eLogicDevice :: setOut (4, false);" Simulide crashed.
Not sure how is your code, but looks like m_pinMiso has not been created.

4Sends data to arduino via Spi Empty Re: Sends data to arduino via Spi Sat May 29, 2021 10:02 pm

feri



I enclose the code obtained from ILI9341.
regards
Attachments
Sends data to arduino via Spi Attachmentspi.zip
You don't have permission to download attachments.
(3 Kb) Downloaded 2 times

5Sends data to arduino via Spi Empty Re: Sends data to arduino via Spi Sun May 30, 2021 2:06 pm

arcachofo

arcachofo

I enclose the code obtained from ILI9341.
regards
Thanks, now I see.

You have created only one output, so MISO is output number 0
eLogicDevice :: setOut (0, false); // Set MISO to Low

__________________________________________

For several reasons the implementation of logic components is a bit complex and can be confusing.
After the change to new Subcircuits system it is possible to simplify it.
I did a complete refactoring of Logic components in trunk (Rev 311 and related).
So now it is easier and more intuitive to create new components.

For example, now there is no diferentiation betwen Pin and Logic Output, so you can manage states directly in the Pin, something like this:
bool mosiState = m_pinMosi.getInpState();
Or:
m_pinMiso.setOutState( false );

There is also a new SPI module in the making (not finished yet).
It will be used by any component that needs SPI communication in a similar way than current I2C module is currently used.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum