Can i write my own firmware for a scanning device in vb.net? - vb.net

i was wondering if it was possible to write my own firmware that will run on a device im making. This device is very similar to the price portable price checkers you see in grocery stores. it scans the barcode which returns an id number. More information about my device and about the big project im working on can be found here:
My Idea For A New Type Of WCP (Wireless Connection Protocol)
I'd like to write this firmware in VB.net because im Very Familiar with it, however if another language would be better please specify which one and where i should start.
An example of what i want the scanning firmware to be like is the iphone/ipod touch application called Qrafter. it allows you to scan any QR code and depending on what its value is, act accordingly.
Firmware Spec Requirements:
Essentially, i want this firmware to get the value of the QR code that the scanner reads, and compare the value to the ID that is stored as a variable in the firmware itself. when i make more devices ill assign each one a unique device ID that corresponds with a QR code to match.

The device you are making surely is using some type of microcontroller. You will need to write the firmware in the language the microcontroller supports.
If you are still in the vaporplanning stages, you can start looking at Netduino microcontrollers that uses the .NET Micro Framework
Some blog posts on Netduino:
http://www.hanselman.com/blog/TheNETMicroFrameworkHardwareForSoftwarePeople.aspx
http://10rem.net/blog/2010/09/02/first-experiences-with-netduino-and-the-net-micro-framework

Related

Assistance with TI cc2541 replacement of existing code with custom functions

I have a small bluetooth device that uses the cc 2541 to control a toy. I am trying to build a proof of concept artefact, and have found the exact hardware i need, but it has functions already installed that don't suit me. Is there a way to replace the existing functions with new features and write them back to the device.
The current device has 10 different features, and are written into the controller.
Any advice will be appreciated

USB MSC with STM32Cube

I'm using STM32Cube to generate simple USB MSC project. I'm using STM32F417VG.
So I'm selecting USB_OTG_FS - Device_only and USB_DEVICE - Class For FS IP - Mass Storage Class.
Then I'm generating source code, compile it and download to board, put it's USB cable to PC and nothing happens.
What am I doing wrong?
The STM32Cube application helps you get started on developing an application, but does not do the work for you. The generated code will include all the libraries necessary and initialize the hardware so that all the functions you selected are available and ready to go, and then begin an empty infinite loop. It will not show any outward behavior or respond to any external stimulus.
You will need to add some of your own code for the microcontroller to actually do anything.
If you are unsure what you need to do to make the USB functions work, take a look at the example projects that come with STM32Cube and the documentation comments in the library files it included in your project.
However, even a "simple" USB project can be relatively complex, and an unresponsive microcontroller can be mystifying. You may want to get your bearings with very simple GPIO-type projects. Making an LED blink is a microcontroller's "Hello World".

C two platform compiling

I want to run some C code targeted to run on a unique PIC micro based hardware setup in a PC windows environment as well. The objective is to emulate multiple instances of the hardware without the actual hardware. I expect to have to write the code upfront to account for this and to create low level functions in C or C# that emulate each of the PIC functions.
Does anyone know an environment that can support this?
What you're looking for is a microcontroller simulator. The simulator will run on the PC and execute the PIC code. In order to e.g. generate interrupts / simulate serial data / whatever you'll need to either configure the simulator settings or write a few custom function.
Your target code (for the PIC itself) shouldn't need to be aware of what environment it's running on.
Here's a few links, but you're best off searching for some variant of "PIC microcontroller simulator" or "microchip PIC simulator".
http://sourceforge.net/projects/gpsim/
http://sourceforge.net/projects/picsim/
I'm not sure that this question is about an instruction simulator. It seems to me that it is simply about the technique called "dual targeting". I've asked a similar question on StackOverflow before, please see: Prototyping and simulating embedded software on Windows . Recently, I've also made a blog post about dual targeting and rapid prototyping on Windows here: http://embeddedgurus.com/state-space/2013/04/dual-targeting-and-agile-prototyping-of-embedded-software-on-windows/ .
So, while the links should provide the answer to the original question, I'd like to add that the 8-bit PIC is probably no programmable in C++. In fact, it is so baroque that even C compilers for this "architecture" must cut many corners.

Making my own application for my USB MIDI device

I want to try and make my own application for my Novation Nocturn, which is a USB DJ controller surface. The application software interacts with it to send out MIDI messages to software like Traktor, Ableton and Cubase.
I'm aware of libusb, but that's as far as I've got. I've successfully installed it to interact with my device but stopped there.
I'm after some suitable reading material basically. USB specs, MIDI specs and such. If I'm honest the full USB 2.0 spec looks like it holds loads of stuff I don't need.
Just looking for something interesting to do now that I've finished my degree (Computer Science). My current programming knowledge is C++ and mainly C#.
Could do with some direction on how to get stuck into this task.
edit:
Update to include some info from the Device Manager on the Nocturn.
Hardware IDs:
USB\VID_1235&PID_000A&REV_0009
USB\VID_1235&PID_000A
Compatible IDs:
USB\Class_FF&SubClass_00&Prot_00
USB\Class_FF&SubClass_00
USB\Class_FF
Device Class:
MEDIA
USB MIDI is probably one abstraction layer lower than you want to deal with. I'd suggest finding a good MIDI framework and interacting with the device via MIDI instead.
For C++, Juce is probably the way to go, as you didn't mention a target platform or any other specific requirements.
If you want to go the .NET route, the easiest way to get started is with the C# MIDI Toolkit code:
http://www.codeproject.com/KB/audio-video/MIDIToolkit.aspx
In there, you'll find all the basics for opening an device, reading input, and writing output. Alternatively, NAudio has some MIDI classes, but they are somewhat incomplete.
As you develop, you'll want a reference for the MIDI spec handy.
A tool that you will find invaluable is MIDI-OX. In fact, I suggest that before you start coding, you fire up MIDI-OX and use it to sniff the messages coming from the Novation. It will give you a good idea of what the Novation sends. You can use it in conjunction with MIDI Yoke (a configurable virtual MIDI port) to insert itself between the Novation, and Ableton Live (or whatever software you normally use with your Novation) so you can see all of the messages in normal use.
Done... Kidding, but I've started on this in Python - I personally want linux support. I am teaching myself python, but I only dabble in programming.
You can see basic functionality at https://github.com/dewert/nocturn-linux-midi. The guy who reverse engineered it (i.e. the leap I wouldn't have been able to make myself) doesn't seem to be doing any more with it. His code is at https://github.com/timoahummel/nocturn-game
I am using PyPortMIDI and PyUSB, both of which I believe are wrappers for the C equivalents. I think this is all ok on Windows, but haven't tried.
What is currently on my github is crap, but it is proof-of-concept. I'm working on doing it properly now, with threading and proper configuration options.
The driver for the Nocturn makes it appear to system as a MIDI device, even though it isn't a USB MIDI device at the hardware level. The Automap software works entirely at the MIDI level, receiving MIDI instructions and sending different instructions in response - it is separate from the driver and not neccesary.
Alternatively, look at https://github.com/timoahummel/nocturn-game for an example of talking to it directly over USB from Python. You can probably port this to another language with libusb bindings.
Old thread, but I've just recently started looking into this.
I had a look at the Python application that dewert has written. Interestingly, it turns out that the data that the Nocturn emits is in fact MIDI, although it doesn't register itself as a USB MIDI device.
But looking at the actual data coming from the device, it actually emits control change messages (0xB0 controller value) for everything. Also the control commands that are sent to it are also control change messages, albeit only the data bytes, as the Nocturn seems to support MIDI running status (i.e. when sending multiple control change messages, it is not necessary to repeat the data byte).
Indeed, the looking at the magical initialization data it is actually just a bunch of control changes: it starts with 0xb0 and from there on the data comes in twos. For instance the last two bytes in the init string are 0x7f 0x00 which simply turn off the LED for the rightmost forward button. (There is something subtle happening as a result of the initialization being sent though, as the Nocturn sometimes emits some messages which appear to be some form of timeout events, and that behavior changes depending on whether the initialization string has been sent or not.)
Using MIDI-like messages makes sense, as Novation would be well aware of the MIDI protocol, so it would be easiest for them to use it for the communication even if the device is not strictly a MIDI device.
Note though that the incrementors just send the values 1 or 127, i.e. +1 or -1 step, so even with some trivial mapping software it's not really useful as it is. (Actually, if turned quickly, one can get 3 or 125 for instance, with the 125 corresponding to -3.) The only controller which sends a continuous value is the slider, which emits an 8 bit value when moved.
I suppose you'll want to know about USB classes in general and USB MIDI class in particular. The latter is the best what you can hope for in case you don't posess documentation for some proprietary protocol (whether it's used there instead).

What do I need to have to be ready to write a Compact Framework application communicating with GPS?

Simply I am asked to write an application for a smart device (smart cell phone), which will get the GPS coordinates from the device itself.
I have no smart device at all. And I am kind of lost among questions like how can I check if the device have a gps by using the code, if it has how can I obtain them in a "standard" way, do I need to be using frameworks like GeoFrameWork?
So, may somebody list the must or most required things I need to have ready?
Geoframeworks GPS.NET is free these days and it's pretty comprehensive so there's no point reinventing the wheel. It's also friendly to beginners which helps. I strongly recommend downloading it and playing with some of the sample apps. It's a bit tricky if you don't have a physical device to play around with but it does have GPS emulation classes that you can use.
All you need is a copy of VS2008 Pro with the Smart Device SDK installed.