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.

emence

Member Since 15 Jun 2012
Offline Last Active Oct 05 2012 12:28 PM
-----

Topics I've Started

specific memory access to sd - ovverride SPI

29 August 2012 - 01:28 PM

Hello!

Is there a way to reconfigure the SPI pins for the onboard microSd?
I want to use the sd card as external flash storage without using a very slow filestrem.

I need to allocate memory on the sd and then write to it without creating a file.

can i use
SPI.Configuration x = new SPI.Configuration(....

and how can i access the PA21/PGMD9 Pin that is used for Chipselect?
or would it be easier to configure the register of the µC to setup the SPI?
Do i need to modify the firmware?

Thanks!

writting to sd card - losing serialdata!

09 August 2012 - 02:05 PM

Hello!

I'm receiving serialdata via the eventHandler
static void camera_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            lock(serialBuffer){
                int bytesReceived = serial.BytesToRead;
                //Debug.Print("" + bytesReceived);
                if (bytesReceived > 0)
                {
                    serial.Read(serialBuffer, 0, bytesReceived);
                    bufferLength += bytesReceived;
                }
            }
        }

works fine until i try to write the incomming data to the sd card.

            while (watchdog.ElapsedMilliseconds <= timeout && bytesWritten < size60)
            {
              
                fs.Write(serialBuffer, 0, bufferLength); //write received bytes to sd
                bytesWritten += bufferLength;
                Debug.Print("written: " + bytesWritten);
                bufferLength = 0;
               
            }
            fs.Close();

I'm receiving a picture from a camera.
if i lose the line
fs.Write(serialBuffer, 0, bufferLength);
I receive all the bytes of the picture.
When i write the bytes from buffer to SD, i lose some bytes.
I guess the write routine takes to long, and therefore the incoming serial-data can't be written to the buffer.

How can i buffer the incoming data without any loss?

Thanks in advance!

Bitmap functions and image editing

08 July 2012 - 08:36 PM

Hello! I saved an image onto the SD card via a camera. I would like to use the re-size and rotate functions from the Bitmap Class, instead of writing them myself doing it line for line... I understand it's not included in the microFramework because it also includes GUI functions that are useless on a netduino(right so far?) - Are there any substitutes for the Bitmap class? - Would it be more efficient and faster to write the code myself? - How can I create a Bitmap file out of my raw image... any ideas? Thanks in advance!

Can't deploy. before and after firmware update

27 June 2012 - 02:31 PM

Hello there.

Yesterday everything worked properly. deployed a hundred times testing a camera communication, whatever..
Today I couldn't deploy anymore:

An error has occurred: please check your hardware.



After checking all options and successfully Pinging the Netduino via MFDeploy, I decided to update to the newest firmware 4.2RC5... couse why not.
used this guide:
http://wiki.netduino...ep-by-step.ashx

everything worked like charm.

BUT: I still can't deploy!

Deployment: via USB Device NetduinoPlus_NetduinoPlus
Target framework: .Net Micro Framework 4.2
error: An error has occurred: please check your hardware.
And its properly listed in the device manager....

Any Ideas?

Thanks in Advance!

SerialPort as given parameter?

19 June 2012 - 04:07 PM

Hi!

I'm trying to use SerialPort as a parameter for my other classes constructor:

serial1 = new SerialPort(SerialPorts.COM1, Constants.baud_cam, Parity.None, 8, StopBits.One);
serial1.DataReceived += new SerialDataReceivedEventHandler(camera_DataReceived);
serial1.Open();
Ucamttl camera = new Ucamttl(serial1);

Ucamttl class:
SerialPort serial;

    public Ucamttl(SerialPort sp)
    {
        serial = sp;
    }

I can't seem to use the serialPort in my Ucamttl class. It works well in the main routine though.
The error occurs when the ucamttl class tries to write to the serial ( serial.Write(_command,0,Constants.CMD_SIZE); )

    #### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (1) ####
    #### Message: 
    #### Thermocam.Program::SyncCam [IP: 0007] ####
    #### Thermocam.Program::Main [IP: 008d] ####

Since I'm a noob there are a lot of questions..
- In which class do i need to open the port?
- In which class do i need to implement the event handlers?
- and if, then how, and why?

Thanks for helping! :blink:

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.