Main Site Documentation

Namespace to reference to utilize the serial tx/rx (Digital I/O Pin 0 and 1)


#1

I’m trying to write something that will utilize the Di0 and Di1 pins as serial tx/rx. Is there a class in the GHIElectronics namespace that wraps the low level details and allows this? Or do I have to write something that explicitly manipulates those pins?


#2

Do you mean as a UART? If so, check out the eBook (download at the top of the Wiki page) for explanation and example.
Or do you want to do something else?


#3

Here ya go: http://wiki.tinyclr.com/index.php?title=Serial_Interfaces#UART


#4

Sorry, I should have specified. I’m looking for UART communication. Thanks for the link, by the way. This really helps me understand. The code example in that article shows a class called SerialPort being used. The example also only shows three namespaces imported, but when I do the same, I cannot find the SerialPort class at all. What namespace does the SerialPort class belong to? The documentation says it’s in Microsoft.SPOT.Hardware, but even through the object browser, I don’t see the SerialPort class.


#5

I just found an article on COM port changes in NetMF 4. Seems it resides in its own assembly, Microsoft.SPOT.Hardware.SerialPort.dll. But I don’t even see that assembly to add it to my project.

Here’s the article:
http://www.netmf.com/TechnicalResource/Articles/10-04-20/COM_Port_Changes_in_NET_Micro_Framework_4_0.aspx?id=620c782c-60ef-499f-a99d-3e75aac51d81

Like I said, I couldnt find it even with the object browser, but did find it in the NetMF assemblies folder located at: C:\Program Files\Microsoft .NET Micro Framework\v4.0\Assemblies\Microsoft.SPOT.Hardware.SerialPort.dll


#6

You just have to add Microsoft.SPOT.Hardware.SerialPort as a reference in your projects.


#7

Yeah, the problem was finding it. For some reason, VS wouldnt show it in the Add References dialog. Had to navigate to it manually.

Thanks, guys…


#8

Turn off/disable Productivity Power Tools if you have it installed. It does not deal with MF refs right.


#9

You hit the nail right on the head. I use VS2010 for my day job and Productivity Power Tools is indeed installed. Guess I’ll have to disable it each time I switch over to doing MF work.

Thanks for the tip!