embedded

How to do Gesture Recognition using Accelerometers

微笑、不失礼 提交于 2019-11-28 16:15:16
My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend? The sun spot is a Java platform to help you make quick prototypes of systems. It is programmed using Java and can relay commands back

Beagleboard bare metal programming

半腔热情 提交于 2019-11-28 15:59:58
I just got my BeagleBoard-Xm and I'm wondering if there is any detailed step by step tutorials on how to get a very simple bare metal software running on the hardware? The reason I ask is I want to deeply understand how the hardware architecture works, everything from the bootloader, linkers, interrupts, exceptions, MMU etc. I figured the best way is to get a simple hello world program to execute on the beagleboard xm without an OS. Nothing advanced, just start up the board and get a "hello world" output on the screen. thats it! The next step would be getting an tiny OS to run, that can

Polling or Interrupt based method

拥有回忆 提交于 2019-11-28 15:59:11
When should one use polling method and when should one use interrupt based method ? Are there scenarios in which both can be used ? If the event of interest is: Asynchronous Urgent Infrequent then an interrupt based handler would make sense. If the event of interest is: Synchronous (i.e. you know when to expect it within a small window) Not Urgent (i.e. a slow polling interval has no ill effects) Frequent (i.e. majority of your polling cycles create a 'hit') then polling might be a better fit. Other considerations include whether you are writing a device driver for an OS or just writing bare

Optimizing member variable order in C++

耗尽温柔 提交于 2019-11-28 15:23:18
I was reading a blog post by a game coder for Introversion and he is busily trying to squeeze every CPU tick he can out of the code. One trick he mentions off-hand is to "re-order the member variables of a class into most used and least used." I'm not familiar with C++, nor with how it compiles, but I was wondering if This statement is accurate? How/Why? Does it apply to other (compiled/scripting) languages? I'm aware that the amount of (CPU) time saved by this trick would be minimal, it's not a deal-breaker. But on the other hand, in most functions it would be fairly easy to identify which

How to run a C program with no OS on the Raspberry Pi?

♀尐吖头ヾ 提交于 2019-11-28 15:19:40
I'd like to experiment using the Raspberry Pi for some different low level embedded applications. The only problem is that, unlike the AVR and PIC microcontroller boards available, Raspberry Pi typically runs an OS (like Raspbian) that distributes CPU time across all running programs and makes it impractical for certain real time applications. I've recently learned that, assuming you have a bootloader like GRUB installed, running a C program on x86 (in the form of a kernel) takes very little actual setup, just an assembly program to call the main function and the actual C code. Is there a way

Unit Testing Embedded Software [closed]

烂漫一生 提交于 2019-11-28 14:59:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What best practices have you used in unit testing embedded software that are peculiar to embedded systems? 回答1: Embedded software may

Include object file or assembler file in C Project?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 14:39:17
I am playing around a bit bit with Microsofts ELL library/compiler to deploy a simple learning algorithm to a micro controller. But my knowledge regarding embedded development has been better in the past. The Problem is the following: ELL creates an LLVM IR file and a C Header file from a CNTK machine learning model (There are no pure c/c++ files). So far so good. Now I can use the IR to tell llc to make an assembler or object file for the desired target from it (ARM Cortex M4 in my case). So I end up with a header file model.h and an assembler file model.s or an object file model.o . Now I

How to reduce the code space for a hexadecimal ASCII chars conversion using a _small_ code space?

ぐ巨炮叔叔 提交于 2019-11-28 13:39:46
How to reduce the code space for a hexadecimal ASCII chars conversion using a small code space? In an embedded application, I have extraordinary limited space (note 1). I need to convert bytes, from serial I/O, with the ASCII values '0' to '9' and 'A' to 'F' to the usual hexadecimal values 0 to 15. Also, all the other 240 combinations, including 'a' to 'f', need to be detected (as an error). Library functions such as scanf(), atoi(), strtol() are far too large to use. Speed is not an issue. Code size is the the limiting factor. My present method re-maps the 256 byte codes into 256 codes such

How to pause a pthread ANY TIME I want?

∥☆過路亽.° 提交于 2019-11-28 12:40:41
recently I set out to port ucos-ii to Ubuntu PC. As we know, it's not possible to simulate the "process" in the ucos-ii by simply adding a flag in "while" loop in the pthread's call-back function to perform pause and resume(like the solution below). Because the "process" in ucos-ii can be paused or resumed at any time! How to sleep or pause a PThread in c on Linux I have found one solution on the web-site below, but it can't be built because it's out of date. It uses the process in Linux to simulate the task(acts like the process in our Linux) in ucos-ii. http://www2.hs-esslingen.de/~zimmerma

Are ARM instructuons SWI and SVC exactly same thing?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 11:57:41
ARM assembly has SWI and SVC instructions for entering into 'supervisor mode'. What confuses me is, why there are two of them? Here it is said that SVC was formerly SWI. Does it mean that basically they changed the mnemonic? Are they the same thing? Can I use them interchangeably? Does one of them exist before an architecture, and other after? Yes, SWI and SVC are same thing, it is just a name change. Previously, the SVC instruction was called SWI, Software Interrupt. The opcode for SVC (and SWI) is partially user defined (bit 0-23 is user defined and is like a parameter to SVC handler). Bits