embedded

Fast Hypotenuse Algorithm for Embedded Processor?

半世苍凉 提交于 2019-12-29 05:55:34
问题 Is there a clever/efficient algorithm for determining the hypotenuse of an angle (i.e. sqrt(a² + b²) ), using fixed point math on an embedded processor without hardware multiply? 回答1: Unless you're doing this at >1kHz, multiply even on a MCU without hardware MUL isn't terrible. What's much worse is the sqrt . I would try to modify my application so it doesn't need to calculate it at all. Standard libraries would probably be best if you actually need it, but you could look at using Newton's

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

大憨熊 提交于 2019-12-29 02:24:04
问题 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

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

送分小仙女□ 提交于 2019-12-29 01:38:13
问题 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.

Sqlite on an embedded system

做~自己de王妃 提交于 2019-12-28 13:36:01
问题 I have a database file that is generated on a PC using Sqlite. This file is then transferred to an ARM7 based embedded system without an operating system. The embedded system must access this database, but does not need to update it. I have been trying to get sqlite3 small enough for the embedded system, but so far I cannot get the application size under 256 Kbytes (my limit). Has anyone been able to get sqlite3 down to this size? Is there other software that I can use to read this database?

undefined reference to “only some math.h” functions

孤者浪人 提交于 2019-12-28 06:22:06
问题 I am having a strange problem. The math libraries has been added to my makefile. # include standard C library LDFLAGS += -lc # include standard math library LDFLAGS += -lm and in the output file (.map) I can see that everything has been linked properly: LOAD c:/gnu/powerpc-eabi/3pp.ronetix.powerpc-eabi/bin/../lib/gcc/powerpc-eabi/4.3.3/nof\libgcc.a LOAD c:/gnu/powerpc-eabi/3pp.ronetix.powerpc-eabi/bin/../lib/gcc/powerpc-eabi/4.3.3/../../../../powerpc-eabi/lib/nof\libc.a LOAD c:/gnu/powerpc

C++ on Small-Footprint Microcontrollers

时光毁灭记忆、已成空白 提交于 2019-12-28 05:14:16
问题 It seems to me people consistently shy away from, or rather vehemently oppose the use of, C++ on microcontrollers, but I can't for the life of me figure out why. If you stay away from large C++ libraries (e.g. STL) and you don't try to use complicated features like RTTI or exception handling, is there really any noticeable difference between C vs C++? Does virtual inheritance have a huge impact on complexity or footprint? I would think it'd be a little extra memory, but most of the complexity

How to store constants in ROM (Atmel)

我只是一个虾纸丫 提交于 2019-12-25 18:36:43
问题 Good Day, I am writing firmware for an ATMega645A using AtmelStudio 7. I am starting a localization project and need to display messages on a 16x2 character display in 3 different languages. The existing (English messages) are stored in SRAM, but I will end up overflowing this data memory space if I have to triple the number of messages. SO, I am trying to store the messages in ROM where space is a-plenty. Problem is, Atmel app notes are either (a) wrong or (b) incomplete because I have tried

Loop back mode enabling?

做~自己de王妃 提交于 2019-12-25 16:44:17
问题 I want the software loop back to be tested using my application code for uart4 instance of omap-4460.I am using the default driver. How will I do it using ioctl?or any other way. Please find the driver code here omap-serial.c. Please share any reference code. 来源: https://stackoverflow.com/questions/23243494/loop-back-mode-enabling

Off the shelf programmable USB

可紊 提交于 2019-12-25 12:42:28
问题 Is there a way to create a programmable USB just using off the shelf USB dongles? This question: Programmable USB dongles has answers relating getting "programmable" USBs. But I just want to use an off the shelf USB. It's like this: http://www.pololu.com/product/1336 but just using off the shelf USB device. Preferably, once the USB is plugged in, an "app" can be ran off it which can be cross platform. This app can be a GUI app, but I'm fine with it being a CLI app. Would this question be

CAN bus arbitration backoff time

丶灬走出姿态 提交于 2019-12-25 09:38:06
问题 I am aware of the way CAN bus does its arbitration. In a nutshell the CAN node ID having more '0' 's in its indentifier wins the rite to transmit on the bus and the rest of contending nodes back off. But i dont find any details of how long the backed out node waits before re-trying to win the bus back. I consulted a few sources but still cant find the answer. Any experimental evidence for this ? Bosch CAN Introduction to the Controller Area Network 回答1: It is free to try again after the