The prescaler values are just for the SPI modules, SPI_CR1 register bits BR0..BR2.
- Netduino Forums
- → CW2's Content
CW2's Content
There have been 148 items by CW2 (Search limited from 16-July 24)
#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)
#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)
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 328125I 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).
#58640 Questions for a long term MIDI project.
Posted by
CW2
on 08 June 2014 - 06:23 PM
in
Netduino Go
CW2, even though MIDI is so slow (in comparison to modern stuff anyways, I mean MIDI is as slow as an old modem) there could be problem with Managed code?
You should perform some tests to see how fast the serial communication routing in managed code really is. In the current version of .NET Micro Framework the managed code is interpreted, which means the execution is orders of magnitude slower than "native" code - think Basic interpreter vs. C/C++ compiler. I guess raw reading from one serial port and writing to another would not be significant slowdown, but it does take some time, and if you want to do some more processing (e.g. checking for whole messages, real-time clock synchronization etc.) the time will add up and the latency increases. While the MIDI transmission is not really that fast, latency in audio signal is something people can notice - so you should probably make some tests to see how much latency is introduced in your system, especially when routing the same input through multiple paths with different number of software nodes, if that is functionality you want to have at the end. A millisecond here or there should not be a problem, but tens of milliseconds could be noticeable (especially when you can hear the original sound). Another problem with audio processing is jitter - how much the latency varies. .NET Micro Framework is not real-time operating system, so there are no timing guarantees, interrupts are queued, the execution of managed code can be interrupted at any time for any reason, for example by garbage collecting. You'd have to program carefully to minimize such events.
#58624 Questions for a long term MIDI project.
Posted by
CW2
on 07 June 2014 - 07:23 PM
in
Netduino Go
I am not a MIDI expert, but I am afraid software routing implemented in .NET Micro Framework would not work very well due to the latency caused by slow (interpreted) execution of the manged code.
How about hardware routing, i.e. some kind of switch matrix, which would be controlled by Netduino?
#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).
#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 .
#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...
#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
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.
#59190 Netduino Plus 2 : double.ToString failing on home built firmware 4.2.2
Posted by
CW2
on 13 July 2014 - 11:15 AM
in
Netduino Plus 2 (and Netduino Plus 1)
If I remember it correctly, Yagarto comes with libraries that do not have support for double (and 64-bit integers, so long.ToString() does not work correctly either). You'd need to build custom toolchain with newlib configuration options --enable-newlib-io-long-long and --enable-newlib-io-long-double.
Alternatively, you can use GCC Tools for ARM.
#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...
#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.
#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?
#59387 Netduino Unique ID
Posted by
CW2
on 25 July 2014 - 12:13 PM
in
Netduino 2 (and Netduino 1)
Yes, MAC address can be changed.
The Netduino 2/Plus 2 microcontroller has unique ID feature, unfortunately it is not available in the current firmware, mostly due to privacy concerns (it has been already discussed several times on this forum). You can modify the firmware or you can use another device to store unique ID, such as EEPROM (small memory chip, interfaced from Netduino through SPI or I2C).
#59368 Netduino Unique ID
Posted by
CW2
on 24 July 2014 - 01:49 PM
in
Netduino 2 (and Netduino 1)
What scope of uniqueness are you referring to?
The SKU determines the Netduino model:
- 0x1000 (4096) ... Netduino,
- 0x1001 (4097) ... Netduino Plus,
- 0x1002 (4098) ... Netduino Mini,
- 0x1003 (4099) ... Netduino Go,
- 0x1004 (4100) ... Netduino Shield Base,
- 0x1005 (4101) ... Netduino 2,
- 0x1006 (4102) ... Netduino Plus 2.
The number is stored in the flash memory and the current firmware does not expose flash memory routines to user application, so in this context it cannot be changed programmatically. Technically, it is possible to customize the firmware to enable access to flash memory routines from the user application (managed code) and there are other programs that can be used to modify flash memory contents, such as MFDeploy, JTAG/SWD programmer etc.
Firmware update does not change SKU, unless you deliberately flash firmware for different SKU - e.g. it is possible to have Netduino firmware running on Netduino Plus (of course Plus-specific features do not work).
#59395 Netduino Unique ID
Posted by
CW2
on 25 July 2014 - 02:04 PM
in
Netduino 2 (and Netduino 1)
Yes, that's right - the EEPROM can be changed that way. There is no exact equivalent of the microcontroller Unique ID feature (which cannot be changed, because it is in ROM), so you'd have to use modified firmware.
#59351 Serial Issues
Posted by
CW2
on 23 July 2014 - 01:48 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Are you sure the RS232 port on your PC is 5V? Usually, they are standard ±12V; and "5V" RS232 can also mean ±5V (and not 0 - 5V). Netduino has 3.3V logic (inputs in digital mode are 5V tolerant), so you'd need a level converter to connect it to PC.
#59349 Serial Issues
Posted by
CW2
on 23 July 2014 - 01:32 PM
in
Netduino Plus 2 (and Netduino Plus 1)
What cable do you use to connect Netduino Plus 2 to the PC? Could it be faulty (e.g. cheap USB converter)?
Also, does the data table in your original message mean that Netduino receives character with ASCII value 6 for the original '0' character, ASCII 103 for '1' etc.? If not, what data are you sending?
#57969 Commercial Product using Netduino - not competitive
Posted by
CW2
on 06 May 2014 - 04:31 PM
in
General Discussion
Well, you cannot really compare a $5 PIC with a STM32F Cortex microcontroller - which costs ~$10 - $20 in single quantities, depending on the model and variant. So, you'd need to select an appropriate microcontroller, there are many of them even in STM families and then reduce cost by mass production - but we are talking hundred of thousands here and even then you'd probably have hard time to meet your $10 goal. For example, Netduino 2's STM32F205RFT6 costs ~$7 in 1000 quantity, plus crystal, passives, other components, PCB, assembly, testing etc...
#57989 Commercial Product using Netduino - not competitive
Posted by
CW2
on 07 May 2014 - 11:01 AM
in
General Discussion
You might also want to check out this interesting alternative to STM micros: 32-bit ARM MCUs by Spansion, .NET MF port on CodePlex (via GHI forums). Not sure about the availability, though.
#57991 Commercial Product using Netduino - not competitive
Posted by
CW2
on 07 May 2014 - 11:35 AM
in
General Discussion
I think after funding $1M+ to Secret Labs there will be no alternatives to STM32 in NETMF
The AGENT watch does not use ST micro, but Atmel (SAM4S, and a secondary tinyAVR)
#58774 .NET MF v4.Next
Posted by
CW2
on 19 June 2014 - 06:19 AM
in
General Discussion
Support for VS2013 is under development. We'll have some more details and a test build shortly. The general goal is to not require firmware updates (which makes things tricky due to how the current build does version numbering for everything on mass) Furthermore, the current setup is designed to support only one version of VS at a time. While this was mostly acceptable when VS relased on a cadence on the order of ~3years, now that they are on an apparently annual cadence that's not going to fly. So we are seperating out the core reference libraries, build infrastructure etc... from the VS integration. For the VS integration we'll be going to VSX extensions in the gallery (Same for samples). Thus, the experience becomes much more consistent with other platforms that VS targets. While enabling VS2012 AND VS2013 support. (ditto for VS14 CTP and beyond)
#58795 .NET MF v4.Next
Posted by
CW2
on 20 June 2014 - 06:30 AM
in
General Discussion
For me, the most interesting is the separation of Visual Studio integration component, which is probably the only thing anyone else will not be able to do (only Microsoft signed extensions allowed in Express SKUs). If they do it right, say it allows to completely replace the core assemblies, I will be very happy...
#58769 .NET MF v4.Next
Posted by
CW2
on 18 June 2014 - 09:31 PM
in
General Discussion
ACCESS PERMISSIONS UPDATE:
2014 Jun 16
In preparation for the longer term future of .NET MF we are in the process of some changes to the use of CodePlex. (Including switching to a GIT repository model to make things easier for a true OSS development process). As part of this transition everyone's permissions were reset to "editor" status, thus denying check-in permissions on the TFS tree. Fear not! This isn't a permanent change. We'll have more details on the results of the changes and the process for contributing into the official repositories in the very near future so stay tuned.
-Steve Maillet
Senior Architect .NET Micro Framework
Planned release .NET MF v4.Next
Now only if anyone know what "very near future" means - is it sooner or later than [the usual] "soon"

- Netduino Forums
- → CW2's Content
- Privacy Policy