microcontroller

Java based Microcontrollers? [closed]

二次信任 提交于 2020-07-17 06:16:47
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last month . Improve this question I have been looking into micro-controllers and was wondering if the majority of them are C/C++ based? I am quite proficient in java and want to ask you guys if anyone knows of a good cost efficient, java-based micro-controller I could look into. All answers are

GCC: How to disable heap usage entirely on an MCU?

早过忘川 提交于 2020-06-24 22:42:24
问题 I have an application that runs on an ARM Cortex-M based MCU and is written in C and C++. I use gcc and g++ to compile it and would like to completely disable any heap usage. In the MCU startup file the heap size is already set to 0. In addition to that, I would also like to disallow any accidental heap use in the code. In other words, I would like the linker (and/or the compiler) to give me an error when the malloc , calloc , free functions or the new , new[] , delete , delete[] operators

How can I capture microcontroller input clicks faster?

旧巷老猫 提交于 2020-06-09 05:38:46
问题 I'm currently testing a microcontroller (azure sphere) that captures clicks 1/20th of a second but there are clicks in between that are missed when clicking very fast. I want to capture the clicks at half the time. How can I improve this code to capture each and every click? Here is part of the code. const struct timespec sleepTime = { 0, 100000000}; while (true) { GPIO_Value_Type value; GPIO_GetValue(button_A_fd, &value); Log_Debug( "Button value (%d)\n", value); // Processing the button. /

RMS calculation DC offset

﹥>﹥吖頭↗ 提交于 2020-05-17 08:49:19
问题 I need to implement an RMS calculations of sine wave in MCU (microcontroller, resource constrained). MCU lacks FPU (floating point unit), so I would prefer to stay in integer realm. Captures are discrete via 10 bit ADC. Looking for a solution, I've found this great solution here by Edgar Bonet: https://stackoverflow.com/a/28812301/8264292 Seems like it completely suits my needs. But I have some questions. Input are mains 230 VAC, 50 Hz. It's transformed & offset by hardware means to become 0

Why does iostream take so much flash space on an MCU?

时间秒杀一切 提交于 2020-01-24 19:34:06
问题 I use GCC 5.2.0 to compile code for an EFM32 MCU (based on a Cortex-M core). I notice an awful increase in code size when I want to #include <iostream> . For example, let's compile the following code for an EFM32WG "Wonder Gecko" chip: #include "em_device.h" #include "em_chip.h" #include <iostream> int main(void) { CHIP_Init(); while (1) { } } This code will result in 172048 bytes of code, whereas without #include <iostream> it is only 1440 bytes. I usually just use cout for debug output (by

How to make Timer1 more accurate as a real time clock?

不想你离开。 提交于 2020-01-24 19:03:27
问题 I have PIC18F87J11 with 8 MHz oscillator and I am using timer1 as real time clock. At this moment I have it toggle an LED every 1 minute. I noticed it does work perfect fine the first few times but slowly it starts toggling the LED every 59 seconds. Then every few minutes it keeps going down to 58, 57, etc. I don't know if its impossible to get an accurate clock using internal oscillator or if I need external oscillator. My settings look right for timer1, I just hope I can resolve this issue