embedded

Modbus stack for Microchip PIC

…衆ロ難τιáo~ 提交于 2019-11-30 03:58:11
问题 Can someone suggest an open source implementation of a Modbus RTU Slave for a Microchip PIC18 processor? I'm looking for an implementation of Modbus RTU for RS-232/RS-485, but a Modbus TCP/IP implementation would be welcome as well. 回答1: I've implemented a Modbus RTU (and ASCII) slave for PIC18 but using USB instead of RS232/485. It would be very easy to convert to RS232/485 though as the protocol code only requires character transmit and receive functions. I can help you with this if

How do I configure the Linux kernel within Buildroot?

馋奶兔 提交于 2019-11-30 03:46:36
I'm trying to build a rootfs for an x86 target, which is all simple enough. However I can't figure out how I configure the kernel that buildroot produces. The first run through came up with menuconfig, but it's cached the .config since then and I can't see where to change it. ~650MB of kernel modules don't do good things to an embedded target :P Is there an easy way to configure the kernel within buildroot? Something like the uclibc-menuconfig target would be perfect. Aleksandar I always do the following: configure Linux kernel: make linux-menuconfig After leaving menuconfig your configuration

STL in embedded environment

人走茶凉 提交于 2019-11-30 02:49:34
问题 I am a C++ programmer and over the years have been subjected to hearing the notion that STL is not good for use in embedded environments and hence usually prohibited in usage for embedded environment based projects.I believe STL libraries like Boost are far more powerful and provide a much more faster & less error prone means of development(ofcourse the syntax is little intimidating but once past that i think it's a real treasure).Also, I find the claims that STL is heavy and increases final

Simple Debounce Routine

泪湿孤枕 提交于 2019-11-30 02:26:46
Do you have a simple debounce routine handy to deal with a single switch input? This is a simple bare metal system without any OS. I would like to avoid a looping construct with a specific count, as the processor speed might fluctuate. GEOCHET I think you could learn a lot about this here: http://www.ganssle.com/debouncing.pdf Your best bet is always to do this in hardware if possible, but there are some thoughts on software in there as well. Simple example code from TFA: #define CHECK_MSEC 5 // Read hardware every 5 msec #define PRESS_MSEC 10 // Stable time before registering pressed #define

C# for embedded systems? [closed]

浪尽此生 提交于 2019-11-30 01:46:57
"C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions." -- design goals (wikipedia) Although it greatly depends on how embedded is "emebedded", How well do you think C# has reached this goal? Do you consider C# to be just as good if not better tool for the job than C/C++? Well, there is Micro Framework ; I don't hear a lot of noise about it, but I'm not into "embedded". But it would depend on what it was doing... C# is a good general

Is there a standalone implementation of std::function?

自古美人都是妖i 提交于 2019-11-30 01:42:26
问题 I'm working on an embedded system, so code size is an issue. Using the standard library ups my binary size by about 60k, from 40k to 100k. I'd like to use std::function, but I can't justify it for 60k. Is there a standalone implementation that I can use, or something similar? I'm using it to implicitly cast lambdas in member functions with bound variables in c++ 11. 回答1: Here is simple implementation of std::function-like class template without inclusion of any headers. You can customize the

Small libc for embedded systems

血红的双手。 提交于 2019-11-30 01:35:30
I am looking for a small libc for embedded use with freertos on a ARM7 microcontroller. I have looked at newlib, but it is a bit too complex for my needs. Newlib calls malloc() in a number of functions (e.g. printf()), which is not good for small embedded realtime systems. Does anyone know of a small, portable, open source libc implementation that will fit my application? Christoph PDCLib might fit your needs. It's still incomplete [broken link] , though, and probably in need of a lot more real-world testing. Its author goes by DevSolar here on SO. update 2012-11-01: As of 2012-08-14,

Using floats with sprintf() in embedded C

怎甘沉沦 提交于 2019-11-30 01:34:53
Guys, I want to know if float variables can be used in sprintf() function. Like, if we write: sprintf(str,"adc_read = %d \n",adc_read); where adc_read is an integer variable, it will store the string "adc_read = 1023 \n" in str (assuming that adc_read = 1023 ) How can I use a float variable in place of integer? Since you're on an embedded platform, it's quite possible that you don't have the full range of capabilities from the printf() -style functions. Assuming you have floats at all (still not necessarily a given for embedded stuff), you can emulate it with something like: char str[100];

Device misdetected as serial mouse

我们两清 提交于 2019-11-30 01:23:26
I'm working on a device which communicates with a PC through a (virtual) serial port. The problem is that the data we are sending occasionally gets incorrectly identified by Windows as a bus mouse, after which the "Microsoft Serial Ballpoint" driver is loaded and the mouse pointer starts jumping around on the screen and randomly clicking on things. A bit of Googling reveals that is an old and well-known problem with serial devices where the usual work-around is a bit of registry hacking to disable the offending driver. That it is a lot to demand from our users however and I'd rather not have

Checking if a longitude/latitude coordinate resides inside a complex polygon in an embedded device?

半城伤御伤魂 提交于 2019-11-30 01:12:47
I need the user to be able to draw a complex polygon on a map and then have the application check if a given longitude/latitude resides within that polygon. I was only able to find algorithms that were using a simple x/y cartesian coordinate system that doesn't compensate for the curvature of the earth. The user draws the polygon on a PC, where the points are transferred over radio to a embedded device, which then needs to check if the given polygon resides within it's current position (taken from GPS). As this is for an embedded device I am not able to use huge libraries, rather I need the