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's Content

There have been 8 items by nlsa (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#65033 SPI read/write with registers

Posted by nlsa on 25 March 2016 - 11:52 PM in Netduino Plus 2 (and Netduino Plus 1)

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 -




#64404 Netduino Application (Universal) Template: Shows up in VS2013 Express but no...

Posted by nlsa on 29 October 2015 - 09:28 PM in Visual Studio

I'd like to confirm that Ian's problem was not unique.  I experienced the same scenario, Micro Framework appears in VS Express 2013 but not in Community 2013.  As a consequence, Community 2013 can't load Netduino solutions.  Like Ian, I eventually gave up and moved to Community 2015.

MRO




#64308 UDP broadcast example?

Posted by nlsa on 15 October 2015 - 03:56 PM in Netduino Plus 2 (and Netduino Plus 1)

Great, thank you.




#64295 UDP broadcast example?

Posted by nlsa on 13 October 2015 - 12:32 PM in Netduino Plus 2 (and Netduino Plus 1)

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 -




#61969 One InterruptPort, two interrupts?

Posted by nlsa on 28 March 2015 - 09:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Oh, Lord, please let me take back that last post.  




#61968 One InterruptPort, two interrupts?

Posted by nlsa on 28 March 2015 - 09:44 PM in Netduino Plus 2 (and Netduino Plus 1)

As far as I can tell, PinState is not well documented.  Try Googling Netduino PimState and you'll see what I mean.




#61967 One InterruptPort, two interrupts?

Posted by nlsa on 28 March 2015 - 06:03 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks for the quick reply.  I should have thought about reading the pin itself... makes perfect sense.




#61963 One InterruptPort, two interrupts?

Posted by nlsa on 28 March 2015 - 02:02 PM in Netduino Plus 2 (and Netduino Plus 1)

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.