CW2's Content - Netduino Forums - Page 2
   
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-June 23)


By content type

See this member's


Sort by                Order  

#60045 USB power vs. input power

Posted by CW2 on 09 September 2014 - 11:18 AM in Netduino Plus 2 (and Netduino Plus 1)

If I use an external power supply with 5V and connect it through the Micro USB port, will it provide sufficient power to the netduino including all pins (PWM, ...)?


Yes.
 

I can't find any available industrial power supplies with 7.5 - 9V

 

You don't need an industrial grade power supply, a wall adapter is sufficient.

 

I guess I can't use 5V input on the power socket?

 

No, the onboard linear regulator requires at least ~6.5 V input.




#58673 VC0706 Adafruit camera and Netduino Plus 1

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

Ok, thanks for the clarification. This was fixed in .NET Micro Framework 4.3 (see Issue #1388), you can set Convert.UseRFC4648Encoding property in order to get '+' and '/' instead of '!' and '*':
 

System.Convert.UseRFC4648Encoding = true;



#59528 Using Netduino to prototype & program a chip...

Posted by CW2 on 03 August 2014 - 12:27 PM in General Discussion

If I understand it correctly you want a custom board running Netduino firmware? Of course that is possible, as long as it is hardware compatible (e.g. clock frequency, inputs/outputs etc.). However, you'd need to have very good component source deals to make it cheaper (the microcontroller itself in single quantity costs significant part of the retail Netduino price, plus the other parts, PCB, assembly, testing etc.).




#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.




#56639 ND1 - Input is always TRUE

Posted by CW2 on 05 March 2014 - 11:45 AM in Netduino 2 (and Netduino 1)

Quiz question: What return value do you expect from an unconnected input pin?

 

The thing is that you created input pin with ResistorMode.PullUp, which means the pin is in logic high (returns true), unless it is connected to other logic level (logic low, ground). Thus, if you want your input pin Read() method to return false, you have to wire the pin to GND.

 

If you use a port in output mode, its Read() method basically just returns the current state - i.e. the initial state passed via constructor parameter or what was set in the last call of Write() method.




#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).




#60257 Help! I've accidentally bricked my brand-new Netduino 1 when updating...

Posted by CW2 on 27 September 2014 - 09:01 PM in Netduino 2 (and Netduino 1)

What guide are you following? ST tools do not work with Netduino 1, you have to use Atmel SAM-BA.




#57035 Interrupt Port and Input Port Read Values are Wrong on First Interrupt.

Posted by CW2 on 23 March 2014 - 08:44 PM in General Discussion

I have not tried to reproduce the behavior, but there is one fundamental issue with using port.Read() in the interrupt handler: because the interrupts are queued, the handler is executed after a certain period of time, thus port.Read() returns the port state at the time the interrupt handler is being executed, not when the interrupt occurred. This can cause incorrect results, especially when the pulse duration or frequency is close to execution time of the interrupt handler (managed code).

 

I guess a better way is to use two interrupt ports, both set up for falling and rising edge (InterruptEdgeBoth) and use the handler parameters data1 (port number), data2 (port state, 1/0) and timestamp in a state machine (you can reuse one xxx_OnInterrupt handler).




#56666 ND1 - Input is always TRUE

Posted by CW2 on 06 March 2014 - 09:47 AM in Netduino 2 (and Netduino 1)

Because on N2 and N2+ i have connected digital input with 3V then i get tue Value....

 
Hm, does that mean that on N2 and N2+ unconnected input pin created with ResistorMode.PullUp returns false? That does not seem to be right - it's either a bug or you've inadvertently used ResistorMode.PullDown (?)




#59936 Maximum port frequency ...

Posted by CW2 on 29 August 2014 - 01:21 PM in Netduino Go

So, I'm not going to be able to create any kind of radio signal by toggling a port on the Netduino ... at least not in the amateur bands (2 meter band). That would require about 145 MHz.

 

You should have mentioned that in the original post - Shield Base has STM32F205 microcontroller that runs at 120 MHz, Netduino Go STM32F4 at 168 MHz. So, not enough for 145 MHz pin toggling even when done in assembly...




#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).



#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.




#59589 Convert PIC code to run on Netduino

Posted by CW2 on 06 August 2014 - 08:14 PM in General Discussion

Why not use the PIC?

 

There are some issues with the current .NET Micro Framework implementation that limit its usage in such scenarios. I don't know exactly how the PIC drives the H-Bridge, but I can think of

 

1) Bit-banging - it depends on the frequency. Netduino's managed code is interpreted, i.e. slow. IIRC it can produce signal at 10 kHz range - I am not sure how fast you need to drive those power MOSFETs. Also, the code can be disturbed at any time, for example by garbage collector or interrupt handler, so the motor control will be stuck for relatively long time in certain state, which is not something you'd want. There are some techniques to minimize such events, but no guarantees.

 

2) Timers or PWM - there is missing the key feature: synchronized channels. The signals for left and right part of the H-Bridge must have precise relationship, they cannot overlap at certain moments etc. - usually, you configure two channels with opposite polarity, dead time and then start them at the same time. This would require firmware modification (the microcontroler has these features, but they are not accessible from managed code).

 

Personally, I would go with the PIC(s) - you've already got proven working (?) design, it is much better for real-time control, and also significantly cheaper. You can use Netduino to control them, if you must... ;)




#57392 Adding to Cpu.Pin enumeration

Posted by CW2 on 07 April 2014 - 06:46 AM in Netduino 2 (and Netduino 1)

You can access those pins via Cpu.Pin enumeration - the ports are treated as consecutive array of pins, so PA is 0 .. 15, PB 16 .. 31, PC 32 .. 47 etc.:

var pa4 = (Cpu.Pin)( 0 + 4);
var pb1 = (Cpu.Pin)(16 + 1);
var pc0 = (Cpu.Pin)(16 + 0);
var pc8 = (Cpu.Pin)(32 + 8);



#57051 Analog Output

Posted by CW2 on 24 March 2014 - 07:51 AM in Netduino Plus 2 (and Netduino Plus 1)

In addition to what Nevyn said, you could use PWM with low-pass RC filter as cheap D/A converter.




#58426 Netduino alternative development options

Posted by CW2 on 27 May 2014 - 01:40 PM in Netduino 2 (and Netduino 1)

I am not sure what exactly you are asking... you kind of answered your own question in the last sentence in the original article.

 

It is certainly possible to program Netduino boards in C/C++, using toolchains you mentioned above. I am not familiar with ARM DS-5, but if you are looking for IDE then there are for example free/evaluation version of commecial products like Keil MDK Lite,  IAR EWARM, CrossWorks for ARM, free CooCox CoIDE etc. Usually, they come with a few sample applications and sometimes even with higher level libraries...

 

You can use any RTOS, as long as the appropriate microcontroller port is available, using supported toolchain/IDE - you'd have to check the particular RTOS documentation, based on what exactly you need/want to do.




#58430 Netduino alternative development options

Posted by CW2 on 27 May 2014 - 02:39 PM in Netduino 2 (and Netduino 1)

For STM32F-based Netduinos (gen 2), you can use DfuSe utility to upload firmware when the device is in USB bootloader mode. During development, it is better to use JTAG or SWD in-circuit debugger/programmer, such as ST-LINK/V2.

 

Usually, the IDE supports at least one such debugger, so it is relatively easy to deploy the compiled binaries, place breakpoints and step through the code...




#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 (?)




#59233 Multiple InterruptPorts being fired?

Posted by CW2 on 15 July 2014 - 02:32 PM in Netduino Plus 2 (and Netduino Plus 1)

I guess the output of toggling switch UP is affected by DisableInterrupt() and EnableInterrupt() calls in the event handler - it most likely causes the other interrupts to be ignored/missed.

 

I would recommend you to remove those Disable/EnableInterrupt() calls; and also change the interrupt trigger to InterruptEdgeHigh, so the button release event is not generated (you can add it back again later, if you need it). Also, apparently the switch bounces, so you'd need to implement either hardware or software debouncing (or both).

 

You can make the circuit a little bit simpler by switching to pull-up resistors, because you can enable the built-in ones (in the InterruptPort constructor); then you'd need to use InterruptEdgeLow instead.




#59591 Convert PIC code to run on Netduino

Posted by CW2 on 06 August 2014 - 08:37 PM in General Discussion

This is going to be the speed controller for a robot's drive train.

 

If the main project objective is NOT building a motor controller, I would consider one of the many motor controller modules or specialized driver ICs... just for inspiration Pololu controllers...




#59786 ISR in interop

Posted by CW2 on 19 August 2014 - 06:29 AM in Netduino Plus 2 (and Netduino Plus 1)

You should be able to hit a breakpoint in an ISR handler - if you can't, it can indicate it is never called (do you actually activate/enable it in your code?).

 

What version of Netduino do you have? Are you developing a port for a new microcontroller? There is already USART ISR handler implemented in the firmware - you can use it as a reference for things needed to get it work (e.g. configure pins, enable peripheral clock, activate interrupt, setup USART module, use locks etc.).




#59789 ISR in interop

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

But my code is confirmed in native project(Keil), now I'm finding the problem.

 

When you use your ISR handler, have you disabled/removed the one in the firmware? There will be a conflict - .NET Micro Framework does not have any support for hardware resource sharing/management, so one must be a little bit careful when adding custom functionality.

 

Also, there are some things you have to add to your native code (which works in Keil) to make it work correctly in .NET Micro Framework - such as properly reserve the pins, use lock macros, etc.




#59790 ISR in interop

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

Default PK use GPIO ISR handler for checking out the stream on usart. I will test and share results.

 
Well, not really - STM32F4 firmware uses USART interrupt handlers, see STM32_usart_functions.cpp:

CPU_INTC_ActivateInterrupt(g_STM32_UART_Irq[uartNum], STM32_USART_Interrupt0, 0);

GPIO ISR is used in STM32_GPIO_functions.cpp to handle pin interrupts, does not do anything with USART.




#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.





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.