embedded

ARM Assembler - How do I use CMP, BLT and BGT?

∥☆過路亽.° 提交于 2019-12-03 08:13:24
Quick question for you guys, in my loop I need to use CMP , BLT and BGT to compare some values. How would use said instructions in the following loop? I'm trying to use BGT , BLT and CMP as I need them to make my application work. The trouble is I have no idea how to use them. If I wanted to use CMP to compare r6, with r4 and put the difference into r7, how would I do this? The same question if I wanted to use BLT if r7 is less than 0, how would I do this? BGT ??????? ; branch if greater than 5 CMP ???????? ; compare r6 with r4 , put difference into r7 BLT ???????? ;branch if r7 is less than 0

Difference between ISR and Function Call?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 07:46:16
问题 I want to understand difference between ISR (Interrupt Service Routine) and Function call. I feel both the function call and ISR are the same from the hardware perspective. Please Correct me if I am wrong. All I could found about ISR and Function call is as follows: ISR: Asynchronous event that can occur any time during the execution of the program Saves the PC, Flags and registers on the stack and disables all the interrupts and loads the address of the ISR ISR cannot have arguments that can

A way to convert byte stream to packet stream in C89 on an embedded device [closed]

谁说胖子不能爱 提交于 2019-12-03 07:28:17
问题 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 6 years ago . I’m working on with an embedded device that is connected to PC using rs232 (rs232 over USB). I’m thinking about developing my own

Whats the best resource to learn Assembly language for PIC microcontroller's [closed]

孤者浪人 提交于 2019-12-03 07:21:49
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. I'm going to start working on a project where I need to have a decent understanding of Assembly language for the PIC microcontroller's. I'm intimately familiar with C/C++, so I know how to code for the most part, and I have done many projects for the PIC

GCC MIPS-32 Calling Conventions / Stack Frame Definition

拟墨画扇 提交于 2019-12-03 07:19:27
There appears to be no definitive standardized stack frame and C language calling conventions (register usage and such) for the MIPS-32 Processor Architecture. That is, it appears to be completely up to the assembler/compiler tool chain to define their own stack frame and calling conventions. I've struggled to find a definitive reference of what conventions the GCC compiler uses for MIPS-32 instruction set. I'm specially using GCC cross-compiler on Cygwin that targets a MIPS-32 core being used in an embedded environment on the eCos open source kernel. Any references to definitive documentation

How to look up sine of different frequencies from a fixed sized lookup table?

爷,独闯天下 提交于 2019-12-03 07:08:11
I am sampling a sine wave at 48 kHz, the frequency range of my sine wave can vary from 0 to 20000 Hz with a step of about 100 Hz. I am using a lookup table approach. So I generate 4096 samples for a sine wave for 4096 different phases. I think the general idea behind this to increment the step size and use different step sizes for different frequncy. So I do the following (pseudo code). But I am not sure how the step size is going to be related to the frequency I want to generate the samples of the sine wave of? For example if my frequency is 15000 Hz what would be the step size that I have to

Volatile and its harmful implications

旧城冷巷雨未停 提交于 2019-12-03 07:05:56
I am a embedded developer and use volatile keyword when working with I/O ports. But my Project manager suggested using volatile keyword is harmful and has lot of draw backs, But i find in most of the cases volatile is useful in embedded programming, As per my knowledge volatile is harmful in kernel code as the changes to our code will become unpredictable. There are any drawbacks using volatile in Embedded Systems also? No, volatile is not harmful. In any situation. Ever. There is no possible well-formed piece of code that will break with the addition of volatile to an object (and pointers to

Is it safe to build with -fsigned-char with Android NDK?

筅森魡賤 提交于 2019-12-03 07:03:41
For consistency with other platforms, I need to use signed char in some native code I'm working on. But by default on Android NDK char type is unsigned . I have tried to explicitly use signed char type but it generates too many warnings differ in signedness when string constant/library functions are involved, so I'm looking to build my code with -fsigned-char . I'm now trying to anticipate problems regarding Android ARM ABI and API when -fsigned-char is used, but I can't find any problem yet. In Procedure Call Standard for the ARM Architecture ABI (AAPCS) , 7.1.1 Arithmetic Types, and C

Is there a programmatic way to check stack corruption

浪子不回头ぞ 提交于 2019-12-03 06:30:28
I am working with a multithreaded embedded application. Each thread is allocated stack sizes based on its functionality. Recently we found that one of the thread corrupted the stack by defining a array of local variables that was more than the stack size. The OS is uItron. My solution, I registered a timer for 10 mS, and this timer will check for stack corruption. Stack corruption checking method, 1. Initialize the stack memory with some unique pattern (I use 0x5A5A5A5A) 2. Check from the time if top of the stack memory is still 0x5A5A5A5A My question, Is there a better way to check this type

Lightweight regex parser

坚强是说给别人听的谎言 提交于 2019-12-03 06:29:33
I'd like to use a Regex parser to aid in some string processing in a C application. I'm ideally looking for something lightweight and open-source. The target platform is an embedded system so we're looking to save as much as possible with memory consumption in particular. I've found a number of options online but was wondering if anyone can make additional suggestions that may help in this particular context. Many thanks, Scintilla , an open source text editor component, uses Ozan S. Yigit's RE engine It was chosen because it is in the public domain (so no encumbering license) and very