CW2's Content - Netduino Forums
   
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.

CW2's Content

There have been 148 items by CW2 (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#61685 I2C on original netduino not reading multiple bytes

Posted by CW2 on 21 February 2015 - 07:58 PM in Netduino 2 (and Netduino 1)

You'd need special I2C methods that support repeated-start condition, as described in http://forums.netdui...rt-bit-support/




#61573 How to compile the firmware without networking support (plus 2)

Posted by CW2 on 09 February 2015 - 11:42 AM in Netduino Plus 2 (and Netduino Plus 1)

Alternatively, you could simply build and flash Netduino 2 firmware on your Netduino Plus 2 board.




#61509 Help me out with SPI Please.

Posted by CW2 on 04 February 2015 - 10:06 AM in Netduino 2 (and Netduino 1)

I don't know what else I must do to get the lcd working on this hardware.

 

Could you post a photo of the actual wiring?




#61398 Native code interop

Posted by CW2 on 28 January 2015 - 07:21 AM in Netduino Plus 2 (and Netduino Plus 1)

... C# is interpreted but I'll write that down to a language barrier :-)

 

 

That is correct, in the current implementation of .NET Micro Framework, managed code (CIL) is interpreted (there is no JIT).




#61168 Non-Voliatile Storage - NVRAM

Posted by CW2 on 05 January 2015 - 06:54 PM in Netduino Plus 2 (and Netduino Plus 1)

Well, building NETMF firmware requires some effort - it is certainly not on the same comfort level as F7/Ctrl+B in Visual Studio, but I can ensure you it is still a piece of cake in comparison to other [embedded] projects I've had a chance to work with. And the real fun comes much later, when you need to F10 in native code  :P
 

Still waiting on detailed notes .......

 
Please have a look at Netduino 2 Firmware v4.3.1 with GCC support. There are similar topics and wiki articles (by other community members) for basically all Netduino firmware variants.

 

Regarding Netduino Plus, technically it was possible to build the firmware with GCC, but due to the size of its C Runtime libraries and flash memory consumed by networking code, either some of the features had to be removed or the flash region dedicated to user application had to be significantly reduced. After release of newlib-nano - an optimized C Runtime, a part of GNU Tools for ARM Embedded Processors - in December 2012, the code produced by GCC is on par with Keil MDK (formerly ARM RVDS) output, in fact I was able to get even smaller output in certain cases (optimized compiler and linker switches for Cortex-M Thumb code generation).

 

The other issue with GCC was that after introduction of Cortex-M port, there were wrong build settings and interrupt-related code that did not work correctly for Thumb instruction set - this was fixed and published in 2012 (unfortunately, the repository has been deleted, but the code is included in newer releases).

 

Hope this helps.




#61164 Non-Voliatile Storage - NVRAM

Posted by CW2 on 05 January 2015 - 03:43 PM in Netduino Plus 2 (and Netduino Plus 1)

I am betting you need something like the DDK for doing this or hack this. I find it hard to believe that it does not exist already as an assembly or namespace

 

You just need to call one function to update the flash memory contents (it requires a few steps to initialize certain registers and properly aligned and timed access, a little bit different than direct peek/poke). The NETMF itself uses that, e.g. during deployment, no need to implement anything but a simple wrapper to expose it. There is already such functionality implemented in Valkyrie-MT's settings feature, see his repo.




#61163 Non-Voliatile Storage - NVRAM

Posted by CW2 on 05 January 2015 - 03:36 PM in Netduino Plus 2 (and Netduino Plus 1)

I want to see anyone build the firmware without a $6000 tool chain.  Be sure to take notes and share.

 

Well, it is possible to build the firmware with GCC, I have been doing that for years, and so were others. The only challenge is Netduino Plus firmware, due to the size of default C runtime libraries (newlib) - it now can be solved with newlib-nano from GCC Tools For ARM Embedded Processors - yes, it requires rebuilding the toolchain, to enable support for 64-bit integers, but it is trivial change in the configuration script and only a few hours wait...




#60758 DateTime in NativeEventHandler()

Posted by CW2 on 19 November 2014 - 03:06 PM in Netduino Plus 2 (and Netduino Plus 1)

I will assume that by resolution of 1µs, you also mean accuracy of 1 µs.


Unfortunately, I don't know the accuracy.




#60753 DateTime in NativeEventHandler()

Posted by CW2 on 19 November 2014 - 07:44 AM in Netduino Plus 2 (and Netduino Plus 1)

The time resolution on gen 2 Netduinos is 1 µs.

 

The microcontroller has many timers with multiple capture/compare channels, unfortunately this functionality is not exposed in the current implementation of .NET Micro Framework. For precise measurements you'd need to add the functionality to the firmware or abuse any of the existing hardware modules (UART, SPI?).




#60744 Netduino Plus 2 SPI Possible Speeds?

Posted by CW2 on 18 November 2014 - 02:48 PM in Netduino Plus 2 (and Netduino Plus 1)

Yes, you should be able to lower peripheral clock speed by adjusting the bus clocks frequencies. But, when you start playing with PLL settings, keep in mind that the USB FS module requires 48 MHz clock to operate properly.




#60743 Custom building a smaller Netduino 2

Posted by CW2 on 18 November 2014 - 02:45 PM in Project Showcase

Very nice board !

 

Although, on the photo it seems that there are parts and traces very close to the mounting holes, maybe so close that the screw head could touch them or even cause some damage (?)




#60712 Problem with Pete Brown's post

Posted by CW2 on 14 November 2014 - 10:48 AM in General Discussion

It happens for me too, database error.




#60711 Netduino Plus 2 SPI Possible Speeds?

Posted by CW2 on 14 November 2014 - 10:46 AM in Netduino Plus 2 (and Netduino Plus 1)

The prescaler values are just for the SPI modules, SPI_CR1 register bits BR0..BR2.




#60696 Netduino Plus 2 SPI Possible Speeds?

Posted by CW2 on 12 November 2014 - 04:20 PM in Netduino Plus 2 (and Netduino Plus 1)

There are three SPI modules on Netduino Plus 2 microcontroller connected to two system busses: SPI1 on APB2, SPI2 and SPI3 on APB1. The bus frequencies are 42 MHz and 84 MHz and 3 bit prescaler is /2, /4, ... /256, which gives the following clock speeds:
Prescaler APB1      APB2
          42000000  84000000
    2     21000000  42000000 
    4     10500000  21000000
    8      5250000  10500000
   16      2625000   5250000
   32      1312500   2625000
   64       656250   1312500
  128       328125    656250
  256       164062    328125
I guess the firmware selects speed closest to the above values, the actual code is
    UINT32 clock = SYSTEM_APB2_CLOCK_HZ / 2000; // SPI1 on APB2
    if (Configuration.SPI_mod != 1) clock = SYSTEM_APB1_CLOCK_HZ / 2000; // SPI2/3 on APB1
    if (clock > Configuration.Clock_RateKHz << 3) {
        clock >>= 4;
        cr1 |= SPI_CR1_BR_2;
    }
    if (clock > Configuration.Clock_RateKHz << 1) {
        clock >>= 2;
        cr1 |= SPI_CR1_BR_1;
    }
    if (clock > Configuration.Clock_RateKHz) {
        cr1 |= SPI_CR1_BR_0;
    }
    spi->CR1 = cr1;
where SPI_CR_BR_0..2 are prescaler bits (or-ed to give 0..7).



#60658 Controlling 2WD Chassis using Motor Driver 1A Dual TB6612FNG

Posted by CW2 on 07 November 2014 - 02:57 PM in Netduino Plus 2 (and Netduino Plus 1)

I have checked the datasheet again and I think there is a problem with control signal voltage levels: if you power the motor control board by 5 - 6 V, the Netduino 3.3V outputs do not have high enough voltage (VIH = 0.7*VCC = 0.7*5 = 3.5V).

 

So, connect VCC to Netduino 3.3V, STBY to 3.3V, VM to 5-6V.

 

To manually test the motors, connect PWM to 3.3V and then either IN1 or IN2 to 3.3V. 




#60653 Controlling 2WD Chassis using Motor Driver 1A Dual TB6612FNG

Posted by CW2 on 07 November 2014 - 11:57 AM in Netduino Plus 2 (and Netduino Plus 1)

Can you share the photo of the actual wiring?




#60652 Controlling 2WD Chassis using Motor Driver 1A Dual TB6612FNG

Posted by CW2 on 07 November 2014 - 11:56 AM in Netduino Plus 2 (and Netduino Plus 1)

Well, it does not seem right to have VM = 3V for 4 AA batteries, it should be around 6V (4*1.5V) for regular alkaline or 4.8 (4*1.2V) for NiMH cells. Where have you soldered the wire on the battery holder? 3V would mean you are using only two batteries, i.e. wrong terminal.




#60637 Controlling 2WD Chassis using Motor Driver 1A Dual TB6612FNG

Posted by CW2 on 05 November 2014 - 12:57 PM in Netduino Plus 2 (and Netduino Plus 1)

The motor driver IC has separate power supply for motors (VM) and logic (VCC). You can use the batteries to power both Netduino and motors (if it is a standard AA battery holder, you should be able to insert a wire between battery and the positive contact lead and solder it to motor board VM input).




#60635 Controlling 2WD Chassis using Motor Driver 1A Dual TB6612FNG

Posted by CW2 on 05 November 2014 - 12:24 PM in Netduino Plus 2 (and Netduino Plus 1)

There is no power supply for the motors - VM is not connected (?)




#60572 74hc595 Shift Register and PWM

Posted by CW2 on 29 October 2014 - 05:30 PM in Netduino 2 (and Netduino 1)

You have to toggle the individual shift register outputs on and off periodically. In a trivial example, consider the following pseudocode:
 

while(true)
{                            // Output state
  shiftRegister.Write(0x03); // #0 = on,  #1 = on
  shiftRegister.Write(0x02); // #0 = off, #1 = on
  shiftRegister.Write(0x00); // #0 = off, #1 = off
  shiftRegister.Write(0x00); // #0 = off, #1 = off, 
}

The output #0 (least significant bit) is on for 1/4 of the cycle (loop), which translates to 25% PWM. The output #1 is on for 1/2 cycle -> 50% PWM. The other outputs are zero during the whole cycle -> 0% PWM.

 

The cycle (period) is divided into four parts, which allows only very coarse control (0 - 25 - 50 - 75 - 100%).

 

 

So, to produce PWM signal through shift register, you have to select a specific period, divide it into certain number of parts (finer division means finer PWM, e.g. 256 levels), and then toggle the outputs to produce pulses of a desired width. There are various ways how to implement it, a particularly clever one is called Binary Code Modulation.




#60476 Receiving Junk from Serial Port

Posted by CW2 on 20 October 2014 - 04:03 PM in Netduino Plus 2 (and Netduino Plus 1)

the voltage to the reader is supplied by an external power source and its the correct voltage, If I take the reader and connect a DB9 pin on it, connect to my pc and present my tag to it, it will spit out the correct values in HyperTerminal.

 
I think there is still some misunderstanding - the external power source does not directly relate to RS-232 (serial) line signal levels. If the reader works when directly plugged into PC (DB9), this means it uses ±10-15 V signals and that is why it does not work with Netduino, which requires 0/3.3..5V ("TTL UART").
 
Technical note: RS-232 transceivers usually have voltage boosting 'charge pumps' to convert supply voltage, e.g. 5V to +10..15V and -10..-15V required by the transmission line.

 

On a side note, If I purchase this reader (Link below) Can I connect this directly to netduino and read my tag code ?
http://netram.co.za/...odule-uart.html

 
Most likely yes, there is "UART TTL interface" in the feature list.




#60472 Receiving Junk from Serial Port

Posted by CW2 on 20 October 2014 - 07:54 AM in Netduino Plus 2 (and Netduino Plus 1)

What card reader are you using?

Most RS-232 devices that you simply plug into PC serial port do not work with microcontroller boards such as Netduino, due to different voltage on RX and TX lines, they require a special circuitry called 'level shifter', for example based on MAX232 or its numerous variants.

 

Basically, there are three major reasons for invalid/garbled data on the serial line: missing level shifter, switched TX/RX lines or incompatible baudrate settings (the latter two require repeated verification, even in case you are thousand percent sure they are correct and you've already checked it a dozen times ;).




#60469 Receiving Junk from Serial Port

Posted by CW2 on 20 October 2014 - 06:24 AM in Netduino Plus 2 (and Netduino Plus 1)

I am connecting my serial rs232 device to the netduino plus 2, D0 and D1 and GND. The device is a card reader.

 
Is the card reader designed to be plugged directly into PC serial port? If yes, then you are missing a level shifter (standard RS232 voltages are around ±10 .. 15V, while Netduino requires 3.3 .. 5V).




#60406 Tic Toc

Posted by CW2 on 13 October 2014 - 04:48 PM in General Discussion

I have seen it in the other forum. Impressive, to say the least! Hats off to the electronics team  :P




#60313 wait on interrupt

Posted by CW2 on 01 October 2014 - 09:26 AM in Netduino Plus 2 (and Netduino Plus 1)

I have to re-read the original post to understand what you are trying to do, but a few notes regarding the code:

  • You should specify pull-up resistor in the interrupt constructor, to prevent spurious events (use pull-up for low/falling edge, pull-down for high/rising edge),
  • If you really must disable interrupts, it is easier to set InterruptMode to InterruptNone. Disposing is rather costly and events can be missed (no event handler when disposed). Alternatively, you can use boolean variable checked in the interrupt handler
static bool buttonsDisabled = false;

static void DisableButtons()
{
  buttonsDisabled = true;
}

static void SW_OnInterrupt(uint data1, uint data2, DateTime time)
{
  if(buttonsDisabled)
    return;
  ...
}

Also, I would recommend you not to use threads initially - perhaps create a new project just to play with the button interrupts, experiment with different scenarios. Once you understand how it works, continue adding the functionality, implement threads only when really necessary/beneficial. In many cases, it is enough to use "Super-Loop" - the core/processing code is wrapped in while(true) loop implemented in Main() method, occasionally checking various state variables set by interrupt handlers.





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.