Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

nlsa

Member Since 12 Nov 2014
Offline Last Active Oct 22 2017 10:51 AM
-----

Topics I've Started

SPI read/write with registers

25 March 2016 - 11:52 PM

Dear friends,

 

I am trying to communicate with a TI AMC7834 controller chip via SPI, using a NP2 with ver 4.3.1.0 firmware. 

It's not clear to me what sequence of commands the Netduino implementation of SPOT.SPI actually needs. Being a rookie with SPI, I have searched for example code online but I'm still confused.

 

Is the following sufficient for setting a register?

 

            byte[] WriteBuf = new byte[] { (byte)Register_ID, 0x10 };  // writes 0x10 to RegisterID
            MySPI.Write(WriteBuf);

 

Do I need to manipulate the CS pin myself or is this built it?  

 

Is this sufficient for reading two bytes from a register?

 

            byte[] tx_data = new byte[2];
            byte[] rx_data = new byte[2];
            tx_data[0] = (byte)Register_ID;
            tx_data[1] = 0x00 ;                                // Unsure whether this is needed
            MySPI.WriteRead(tx_data, rx_data);    // read two bytes of data into rx_data           

 

Could someone please point me to an example of reading and writing to a device with registers?

 

Thank you -


UDP broadcast example?

13 October 2015 - 12:32 PM

Could someone please point me to a working example of UDP broadcast with Netduino Plus 2 v. 4.2?  I find lots of online discussion from several years ago, mostly centered on bugs.  I'm just looking for how to broadcast UDP packets (receiving UDP is not necessary).  

Thank you -


One InterruptPort, two interrupts?

28 March 2015 - 02:02 PM

Dear friends,

 

I want to detect both ON and OFF states of a GPIO pin by means of interrupts.  Ideally, this would involve one event handler for ON (triggered by InterruptMode.InterruptEdgeLevelHigh) and a separate handler for  OFF (InterruptMode.InterruptEdgeLevelLow).  I looks like Netduino doesn't allow attaching two handlers to one pin.  Port.InterruptMode.InterruptEdgeBoth might work but then how would I know whether the pin went high or low?

 

Suggestions?


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.