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
0
votes
0answers
53 views

find the amplitude and phase of the signal

How to write a code to compare the amplitude and phase of these three signal through Arduino?
0
votes
0answers
41 views

Modifying Option Bytes at compile time

I need to modify the option bytes at compile time for STM32L0xx controller and generate the binaries i.e. .hex, .bin. could you please suggest a solution for the same. I amusing STM32Cube IDE for ...
-1
votes
1answer
74 views

Serial Communication between two Arduino not working

I'm trying to perform a simple communication sending two strings in two char arrays from an Arduino Uno to another one. My problem is that after the 5th or 6th iteration the two strings will mix. ...
1
vote
2answers
102 views

RFID reader(125kHz) switching between antennas

My arduino application wants multiple separate cards in multiple separate (nearby) locations to be readable at roughly the same time. I am using a RDM6300 module, with a multiplexer to switch between ...
0
votes
0answers
27 views

Sabertooth 2x12 Independent Analog Mode

I am using an arduino Mega to control 4 DC motors with 2 Sabertooth 2x12 motor controllers. I am using the Sabertooth controllers in independent analog mode (1,2,3,5,6 UP.. 4 down). I have a simple ...
0
votes
3answers
80 views

Binary Manipulation in arduino with 74HC595

I'm doing practice of bit manipulation in arduino with a 74HC595 shift register. I would like to create an algorithm that allows the binary digit to perform this way: 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 ...
0
votes
1answer
125 views

Arduino RFID Multiplexer Antennas

I want to make a electronic chessboard that detects the position of every piece on the chessboard. Every chess piece will have RFID tag. My idea will be to have 2 multiplexers(1*8) one for the rows ...
0
votes
0answers
23 views

Will the following ATSAMD21 series code properly configure SysTick interrupt?

I haven't seen any examples of registering ISRs in Atmel Studio 7, but I've given the following code a go in my IDE. ...
0
votes
1answer
34 views

GSM SIM900 isn't communicating with the Arduino

When I connect my GSM SIM900 module to the Arduino and insert a SIM card, the Netlight and Status light blink for few seconds and then it stops. I am using 5V 1A to power the GSM and pins D7 and D8 ...
0
votes
1answer
161 views

How to implement 32-bit adder logic using two 16-bit adders?

I've been trying to implement a 32-bit adder by instantiating two 16-bit adders. The code is compiling but failing some test cases. I don't know what is going wrong in this. verilog code ...
0
votes
1answer
61 views

PLC Replacement with C++ Embedded System or Application Specific Circuit

I work for a company that uses PLCs in their products, but lately, we have thought about doing away with our PLCs for application-specific circuits, FPGAs, or some other type of system on a chip that ...
0
votes
0answers
85 views

BeagleBone Black Pins Stuck on High

I have written a function in C++ that uses the kernel mmap function to toggle the value of GPIO pins. This works fine for many other pins, but I tried to use it on ...
0
votes
1answer
79 views

Problems with mbed LPC1768 double precision

I have a motion profile generator which calculates a position 1000/sec. During the decelerating portion of the move, the following calculation is used: ...
0
votes
2answers
76 views

NTP Time calculating

I have this code and i use in my device. ...
2
votes
3answers
120 views

Meaning of (*(__IO uint16_t*)PAGE0_BASE_ADDRESS) variable declaration

There is a variable declaration: uint16_t status = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); __IO is the precompiler directive ...
5
votes
9answers
2k 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 ...
9
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
810 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
57 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
60 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
84 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
144 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
161 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
250 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
1answer
132 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
1k 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
158 views

Reading byte array in C++ [closed]

I have following code in C++ ...
1
vote
1answer
321 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
704 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
2k 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
53 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
2k 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 ...
4
votes
3answers
505 views

Difference between __I and __IO and __O in CMSIS core

in core_cm4.h header file defined some thing like this: ...
0
votes
2answers
283 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
418 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
1k 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 ...
4
votes
2answers
5k 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
2k 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
792 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
364 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
769 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
206 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
171 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
386 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
328 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
155 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
429 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
3k 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
417 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
320 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 ...