embedded

Multithreading using C on PIC18

那年仲夏 提交于 2019-11-30 07:23:31
How does one create threads that run in parallel while programming PIC18 , since there is no OS? Don't use threads, use an event loop. The PIC18 is a small processor and an event loop based style means you don't have to keep many deep stacks hanging around. You need to write your code in terms of the event loop, but that is probably reasonable. If you do have some long running tasks, use timers are different interrupt priority levels to allow higher priority event loops to preempt lower priority event loops, and put appropriate types of work into the appropriate event queue. You could try

Recommendation for Java VM running on embedded system

空扰寡人 提交于 2019-11-30 07:13:52
We are trying to support Java enviroment on our embedded platform (700 MHz MIPS 74K , 128-256 MB memory). After reading this article and googling a bit, I came up with the shorted list: Java ME from Sun Kaffe Jbed Perc HP Chai VM PhoneME  - seems the most promising one IBM WEME (Thanks to Thorbjørn Ravn Andersen) Aplix JBlend (Thanks to QuickRecipesOnSymbian) I was quite new to Java and its runtime enviroment. What do you recommend for a Java VM running on MIPS 74K? You might want to look at this too http://www.sun.com/software/jpe/es/index.xml Oracle offers engineering services for Java ME

Implementation of Goertzel algorithm in C

 ̄綄美尐妖づ 提交于 2019-11-30 06:52:01
I am implementing BFSK frequency hopping communication system on a DSP processor. It was suggested by some of the forum members to use Goertzel algorithm for the demodulation of frequency hopping at specific frequencies. I have tried implementing the goertzel algorithm in C. the code is follows: float goertzel(int numSamples,int TARGET_FREQUENCY,int SAMPLING_RATE, float* data) { int k,i; float floatnumSamples; float omega,sine,cosine,coeff,q0,q1,q2,result,real,imag; floatnumSamples = (float) numSamples; k = (int) (0.5 + ((floatnumSamples * TARGET_FREQUENCY) / SAMPLING_RATE)); omega = (2.0 * M

Lightest Database to be packed with an application

若如初见. 提交于 2019-11-30 06:42:06
I am developing a Java Desktop Application and want a light database that can be used with Hibernate and that can be packed with an application. I was going to use Derby database. It's size is near 2 MB. But before that I wanted to have views of experts on SO. Will it work with Hibernate ? Actually, I am new to Hibernate and was studying that it requires a Dialect for a database so Is Hibernate has dialect for Derby ? Pascal Thivent JavaDB (Sun's supported distribution of the open source Apache Derby), HSQLDB (not very active) and H2 (the successor of HSQLDB ) are all 100% Java embeddable

itte in arm assembly

三世轮回 提交于 2019-11-30 06:36:42
问题 What does the following line do in arm assembly: 000031e6 2916 cmp r1, #22 000031e8 bf1a itte ne I get the first line (comparing r1 to 22) but what about the second line (I've never seen the itte command before and googling returned nothing) 回答1: It is the ARM's IF-THEN-ELSE instruction, which was introduced in the Thumb-2 instruction set. (Based on your specific example above, it would have been helpful if you had shown the next 3 instructions that followed the ITTE instruction, you'll

Writing firmware: assembly or high level?

ε祈祈猫儿з 提交于 2019-11-30 06:19:10
问题 Related to: Testing firmware starting a microcontroller simulator/emulator Interpreting assembly code If you are writing code for a microcontroller is there a real difference if you write in assembly or C or some other high level language? If you wrote C code, how would you compile it? Thanks 回答1: Several comments: 1) Absolutely not assembly unless performance or optimization constraints warrant it. The following metrics go through the roof with assembly: time to code it time to debug it time

Is there a good tiny XML parser for an embedded C project? [closed]

三世轮回 提交于 2019-11-30 06:00:50
I'm after a very tiny XML parser for an embedded project. It needs to compile down to 10-15k, doesn't need to validate, and needs to be simple and portable. karlphillip I was able to tweak the compilation flags of the following XML parser libraries for C, and cut down more than 50% of their size on my Ubuntu machine. Mini-XML is the only one close to what you requested: Mini-XML (36K) Expat (124K) RXP (184K) There's a good discussion here: C XML library for Embedded Systems I was searching for one recently and I found SimpleXML ( http://simplexml.sourceforge.net/ ) and the slightly larger

What are the disadvantages of bit banging SPI/I2C in embedded applications

拈花ヽ惹草 提交于 2019-11-30 05:34:50
问题 I have come to understand that bit banging is horrible practice when it comes to SPI/I2C over GPIO. Why so? 回答1: Bit-banging carries a software overhead consuming CPU cycles that you could otherwise utilise for other purposes. This may have a noticeable effect on system responsiveness to other events, and in a hard real-time system , may significantly impact the systems ability to meet real-time deadlines. If the bit-banged interface is not to have a detrimental effect on real-time

ARM Cortex M3 How do I determine the program counter value before a hard fault?

不羁的心 提交于 2019-11-30 05:27:16
I have an embedded project using a STM32F103 (ARM Cortex M3), it is getting a occasionally getting hard fault in release mode. As part of recovery, I would like to retrieve the PC value from before the hard fault and store it for later debugging in the battery backed region. How would I determine the value of the program counter at the point of the hard fault? Obviously, the PC is now set to its location within the hardfault interrupt. Where should I look? It there an address for the normal mode register bank? Thanks! Cortex-M3 uses a quite different model of exception handling from the

Embedded platform development in (!C)

天大地大妈咪最大 提交于 2019-11-30 04:58:31
I'm curious to see how popular the alternatives to C are in the embedded developer world e.g. Ada... I've only ever used C (with a little bit of assembler), but then my targets have very limited resources. Is there a move else where in this space to something else? What is winning the ware in set top boxes? If !C what was the underlying reason? Compiler support for target Trace \ static analysis tools other... Thanks. Forth is quite popular for embedded development. Also, while Smalltalk is probably not popular in the embedded community, embedded development is definitely popular in the