The goal of my open-source calculator is to provide C# APIs for reading the button matrix, output to the LCD (graphical, uses SPI), read text/xml files off microSD card, and talk over Bluetooth serial port with a PC, I will then implement a basic calculator, then the user is expected to implement their own behaviour using C#. I would like to port .NMFW to include only what is needed for these functions (as the final product will not have GPIOs available anyways).
I have downloaded and explored the source code for Netduino's firmware and read the documentation provided by the .NMFW Porting Kit, and I see how AnalogInput was implemented. That example is a great starting point for me. However, I am confused by how System.IO is able to access an SD card, but I can't find the file that handles the low-level communication between the processor and card, all I can find are a few stubs with configuration information. I also can't seem to find anything that resembles low-level access to the UART module but apparently System.IO.Ports.SerialPort still works.
What exactly is already provided by .NMFW? Did Microsoft build low-level UART, SPI, SD card functions into .NMFW for AT91SAM7X512 but forget about AnalogInput?
![Photo](http://www.gravatar.com/avatar/4265f841ad761870eb028ad364c3e11b?s=100&d=http%3A%2F%2Fforums.netduino.com%2Fpublic%2Fstyle_images%2Fmaster%2Fprofile%2Fdefault_large.png)
net micro framework porting questions
Started by Frank26080115, Dec 04 2010 06:39 AM
4 replies to this topic
#1
Posted 04 December 2010 - 06:39 AM
#2
Posted 04 December 2010 - 06:46 AM
Hi Frank,
Microsoft built the core .NET Micro Framework platform. Atmel and other companies (along with engineers at Microsoft) created "hardware abstraction layer" ports for their microcontrollers.
The base .NET Micro Framework does not have features such as AnalogInputs (ADC) or PWM. So we wrote these. Additionally, we've expanded on the base Atmel port with features like variable-bit SPI, Wiznet TCP/IP chip support, etc. Community members are contributing a lot of code to the project too--the first of which you'll be seeing in the v4.1.1 firmware.
All of the low-level code for FAT file system access (via block storage) is in the .NET Micro Framework porting kit. But it's in layers. It may take a while to understand where everything is. In our case, we usually break into the code from a high-end RVICE JTAG debugger to trace execution paths.
Chris
#3
Posted 04 December 2010 - 08:19 PM
I see, I found the low level code I was looking for inside the .NMFW source code, and I think I found the SD card access code as well, although it seems to use SPI, does this mean that even if LPC is targeted, it would not utilize their special built-in 4-bit SD card mode?
How can I tell if a feature has been implemented? Where is this information documented?
How can I tell what kind of resources that .NMFW occupies? For example, I'd like my keyboard input to measure the length of a button press, would I be able to safely use a timer without causing issues with .NET features such as thread sleep, datetime, timer, or timespan? Is it possible to vary my CPU clock speed during runtime to conserve power and not affect debugging and the timing functions in .NET?
I see a list of C++ equivalent datatypes for C# datatypes but did not find one for "Decimal", being able to write fast math function using the precise decimal datatype would be awesome for a calculator, is there no such equivalent in C++?
(and can you make the text have more contrast on this website? gray on gray is really hard to read, such as where the forum topics are listed)
#4
Posted 10 December 2010 - 01:11 PM
+1 on the colour scheme point!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users