Questions tagged [c++]

C++ is a compiled general-purpose programming language that adds object-oriented features and other enhancements to the C language, which it is largely a superset of. It is popular for both embedded and PC software development.

Filter by
Sorted by
Tagged with
5
votes
9answers
1k views

What is the simplest instruction set that has a C++/C compiler to write an emulator for? [closed]

I'm looking into writing a little software emulator that emulates/runs instructions. The easiest would be to invent my own instruction set, but I thought it would be more fun if I write an emulator ...
0
votes
0answers
56 views

stm32 HardFault in keil

a few hours ago , i created C++ project in keil i wrote my code and next i download in to my board. when i went debug it , code directly get to HardFault exception ...
7
votes
6answers
2k views

Concept of the static keyword from the perspective of embedded C

static volatile unsigned char PORTB @ 0x06; This is a line of code in a PIC microcontroller header file. The @ operator is ...
4
votes
1answer
553 views

STM32 crashes when FreeRTOS project is converted to C++

I am experimenting with STM32F303RE Nucleo board on SW4STM32 with FreeRTOS v10.1.1 and I was thinking of parsing NMEA sentences by adding the characters to a buffer using UART interrupt and then ...
0
votes
0answers
34 views

Cannot use SoftwareSerial and RS485 protocol in the same code

Could someone help me ? I want to make 5 nanos communicating through RS485 protocol with my Arduino Uno master. This part is working great by using the code of http://www.gammon.com.au/forum/?id=...
0
votes
0answers
31 views

generate log .txt file on PC for arduino serial terminal log (send and receive commands) [duplicate]

I am trying to generate a .txt file on my Windows 10 PC of Arduino serial terminal data. I am not using SD card on Arduino Mega board just need to send commands to Arduino baord from serial terminal ...
0
votes
0answers
29 views

WS2811 flicker to random colors when trying to turn them all off in a 3x3 array

I am trying to do more, but for starters, I am trying to write code to turn all of my WS2811 off that exist in a 3x3 array. Currently, when I run my Arduino project, they are flickering from red, to ...
0
votes
1answer
83 views

STM32L432 full duplex DMA SPI slave locks up after communication starts

I am continuously sending a substantial amount of data between the STM32L432 and a FPGA using SPI in full-duplex mode. I decided to implement DMA on the L432 in order to increase the transfer rate ...
0
votes
1answer
113 views

Why I can't change variable in it.c?

I have stm32vldiscovery project. I want to use external interrupt by PA0 (user button). When I press the button (PA0), then function EXTI0_IRQHandler must set ldOn equal 0. But ldOn always is 1. ...
1
vote
1answer
104 views

SAM Timer counter / atmel ASF

I'm trying to implement function call after having timeroverflow or comparison of counter registers. Chip: SAM4E ...
0
votes
0answers
113 views

COG PFC2119x driven LCD Display: Add custom characters, can get it to work

Story (skip if you want) Last week I received two malfunctioning DAB radio's from the 'brand' Tesco (type DR1551W) for free and because I cannot fix the problem with these units (missing service ...
0
votes
1answer
83 views

eeprom driver code c++ overlapping

im trying to write driver for EEPROM (24LC64): page size: 32 byte capacity: 8KB (64Kbit) definition code: ...
3
votes
4answers
712 views

UART sometimes missing first few characters on ATmega328P

I wrote some code for the ATmega328P, (Packaged in a module that clones the Arduino Nano). Normally when I send UART data from my computer to these micros, it is received just fine. However I have ...
1
vote
1answer
104 views

Reading byte array in C++ [closed]

I have following code in C++ ...
1
vote
1answer
152 views

Why does making this change to my DHT11 code cause it not to work?

Note: This might not be a programming question. If it turns out that it is, I will close it. I am using an ESP8266 to build some air quality web servers. One of the sensors I am using is the DHT11 (...
0
votes
1answer
300 views

Call member function from interrupt in STM32 [closed]

I have created a new STM32 project using cube. I have changed main.c to main.cpp and enabled ...
1
vote
2answers
845 views

Combine C and C++ in STM32 application development [closed]

Generally, developing embedded systems applications is based on abstraction. We expose some functions from lower layers that can be used in the application layer. My question is: Can I develop the ...
0
votes
0answers
37 views

BLE Nano I2C on P0_10

I have a project where an nRF51822 (BLE Nano v1.5) is an I2C master and communicates with an Atmega328. I have communication working over I2C just fine using various pins. However, when attempting to ...
2
votes
2answers
893 views

How to read data from this sensor?

I am using the MLX90393 Magnetometer IC from Melexis. More specifically, I am using the breakout board by Sparkfun. I am still a beginner when it comes to programming, and this is my first time trying ...
0
votes
2answers
112 views

Map file analysis

I have been writing a software for an embedded controller in C++. I have noticed that I have some problems with ram memory (I have probably run out of the available memory). I have decided to inspect ...
3
votes
3answers
276 views

C to C++ How do I make h/w initialization look neat? [closed]

Doing an experimental conversion of some firmware from C to C++ to try and get a better structure in it, since the C code "evolved" in line with experiments across a 2 year period. The question is ...
0
votes
1answer
439 views

MCP23017 with NODEMCU v3 (lolin) i2c doesn't work

I want to use NodeMCU v3 with MCP23017 that has MAX6675 at the end. Everything is on circuit please see the image. MAX6675 (U3) doesn't want to work with MCP23017. First MAX6675 (U4) works perfectly ...
5
votes
2answers
4k views

MCU programming - C++ O2 optimization breaks while loop

I know people says code optimization should only bring out the hidden bug in the program, but hear me out. I am staying on a screen, until some input via an interrupt is met. Here is what I see in ...
-1
votes
1answer
1k views

How to post multiple values to ThingSpeak?

I am able to store and access data in internal memory of RTC ESP8266 thing dev board. Now I am trying to loop the data stored in internal memory and post data to ThingSpeak. However, I am only able to ...
0
votes
1answer
325 views

How to fix the error “Response code 0” to get “Response code 202” to bulk update a thingspeak channel?

I am using this example: https://www.mathworks.com/help/thingspeak/continuously-collect-data-and-bulk-update-a-thingspeak-channel-using-an-arduino-mkr1000-board-or-an-esp8266-board.html According to ...
2
votes
2answers
274 views

How fast is mbed Digital Out

I need to output 8-bit integers via parallel (i.e. using 8 pins on the same port) at 1024hz. From what I can see, I have two options: 1) Write to each pin individually using DigitalOut. 2) Avoid the ...
0
votes
1answer
309 views

C++ RTOS Options [closed]

What are some off the open source, popular choices for a C++ compatible RTOS (besides mbed)? I've heard that FreeRTOS doesn't provide official support for C++ compilation and it's a nightmare getting ...
0
votes
0answers
152 views

Using C++ objects within FreeRTOS Tasks

I'd like to make use of object-oriented practises inside a FreeRTOS application. Is this as simple renaming files with task functions as .CPP, and instantiating objects, etc. inside the function, ...
0
votes
2answers
120 views

Microcontroller support strings or other libraries [closed]

I heard some microcontrollers have a poor (or no) support for <string>s as a data type of C/C++ when programming. How to know if a microcontroller supports <...
1
vote
3answers
232 views

Is “new” acceptable when using C++ objects in a FreeRTOS application?

I've read that malloc() should be avoided when designing FreeRTOS applications. Does the same apply when using "new"? E.g.: TestObject* test = new TestObject(); ...
1
vote
1answer
259 views

STM32F3 CAN Hardware not Entering Init Mode

I'm trying to write a bare metal driver for the STM32F302 on a Nucleo-64 board. I'm having trouble getting past the very first steps and getting the hardware to set the Initialization Acknowledgment. ...
1
vote
2answers
143 views

Estimating the frequency at which your microcontroller is running

I have recently started programming an ATtiny85 microcontroller, which as per the datasheet runs at 10Mhz given 3v3 supply. So, to experiment, I have created a small program, as shown below. ...
1
vote
1answer
376 views

hamming burst error detection [closed]

I want to use Multiple Bit Error Detection and I have read a lot of sites but no one shows how to implement it using code and how the receiver performs the error correction to the received data. The ...
1
vote
1answer
1k views

SIM800L AT+CSQ return 0,0 when SIM is inserted and 20~40 when I insert the sim

I have SIM800L module, when I try AT+CSQ it returns 0,0 when I tried to remove the sim and try again it returns number, 0 (25,0) and I cannot register to a network so AT+CREG? returns 0,2 should ...
0
votes
1answer
342 views

C++ - Help Interpreting the instructions of a CRC error-checking programming assignment

This is unconventional, based on what I've seen, but I can't get a hold of my professor's aides to clarify this assignment. I hope this is still ok to post here. I would greatly appreciate some help ...
0
votes
0answers
229 views

libmodbus modbus_read_bits() returns illegal function

It is all okay when it comes to read registers with: modbus_read_registers(ctx,0,32,destination); It gives me values of 32 different registers. But when it comes ...
1
vote
0answers
675 views

STM32F407VG DISCOVERY BOARD micro controller CAN messages

I am wondering if anyone is familiar with any STM32f407VG micro-controllers? If so, I am having some problems configuring a CAN driver. I can run the demo code, which is set to a loop-back mode, but ...
0
votes
2answers
839 views

Serial bi-directional (one-wire half-duplex) digispark device works however answers itselfs

I followed this guide to create an one wire bi-directional (debug) device for a Digispark (Attiny85): https://digistump.com/wiki/digispark/tutorials/debugging (see section Bi-directional Serial ...
0
votes
1answer
66 views

Esp8266 header file code interpreat

Currently I am working in a project on esp8266 and before getting into the project I started to read the library and in a section I found something which has no meaning to me. I need help on that <...
0
votes
1answer
49 views

Cypress FX3 CyU3PToolChainInit Understanding help

I don't understand the purpose of the CyU3PToolChainInit function that is written in assembly source code for the FXE. As for as I know it clears the BSS area and enters the main function, but how is ...
4
votes
3answers
432 views

smt32 f10x invalid characters over uart

I'm currently working on a quadcopter using the STM32F103. Instead of using the provided Std Periph Driver which is big I'm creating my own Periph Driver which is object oriented which also helps me ...
0
votes
1answer
2k views

How to correct Warning : array subscript has type 'char' [-Wchar-subscripts] [closed]

Hi I write a function to reset a Character Array in Atmel studio as below: ...
0
votes
2answers
180 views

24 tooth input to simulate 36 output

Can someone please help me with code? I have a 24 teeth trigger wheel. Every tooth is registered by hall sensor and I need that Arduino simulate 36 pulse output of that corresponding 24 pulse input. ...
1
vote
1answer
124 views

Porting Arduino library to msp430

I am working on a project that uses msp430G2553 as the main microcontroller. I bought an LCD from here https://www.adafruit.com/product/2088 but its libraries are all written for Arduino. Has anyone ...
0
votes
1answer
33 views

Help Led matix isn't lighting up correctly Is it a Hardware or software issue? [duplicate]

I am trying to reverse engineer the project from this video: https://youtu.be/zc1zbwheyE0?t=50s. From the video a visible 10 wires are going from the LEDs to the Arduino mega, i am assuming that they ...
6
votes
1answer
855 views

Arduino - Writing to a 3½ floppy disk

I found some old, still working 3½ floppy drives using the 34-pin IDC interface, that will take a 1.44 MB disk. I had a project in mind, using these floppy disk as an "access key" for a door. In order ...
1
vote
0answers
2k views

Cannot send SMS with SIM900 GSM module

I have a little problem using GSM SIM900 module connected to the Arduino the call is working alright but it doesn't send me SMS I don't know why. This is my code: ...
0
votes
0answers
45 views

XBee | Ubuntu (C/C++) | Android

I am looking for guidance of wireless communication between Ubuntu (code written in C/C++) with an Android device. Since the desired range is about 1 mile (~1.5 km), I assume that XBee Pro would be a ...
11
votes
2answers
2k views

Version control of schematics and source code

I am developing an electronic device which has two parts: hardware (Eagle schematics) and firmware (C++ source code). I would like to track changes in both source code and schematics, but there are ...
1
vote
1answer
2k views

Confusion about ADR in ARM (assembly code)

I'm confused on what's happening with ADR R14,cnt1. Is cnt1 signifying the end of the program? And if so how will ...