Questions tagged [c]

C is an imperative (procedural) systems implementation language. It was designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support. C was therefore useful for many applications that had formerly been coded in assembly language. from http://en.wikipedia.org/wiki/C_(programming_language)

128 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
4k views

How can I log information from code in IAR Embedded Workbench to a log file?

I'm trying to develop an application for the NXP LPC1788 microcontroller and I would like to be able to log formatted strings at arbitrary points within the source code to a log file in a way that has ...
3
votes
0answers
236 views

Weird problem on STM32 ADC with Interleaved Mode

I am sampling a signal on the STM32F3 Discovery board (stm32f303vct6) with two ADCs working in interleaved mode. It works great with a 200kHz 1V sine wave. But when I apply 10kHz 100mV sine wave, I ...
3
votes
1answer
74 views

Atmega168 USART RX Interrupt does not trigger

I have been trying to get the USART RX interrupt trigger working on my ATmega168A using the tutorial here (updating my registers as per the datasheet): Tutorials I have setup the system to use a ...
2
votes
1answer
47 views

How to include paths for the C compiler in atmel studio?

I have a folder project and it consists of multiple folder and .c and .h files what is the best way to include them all without including the individual folders?
2
votes
0answers
68 views

Address Sent bit is not set on STM32F4 Disco

I am trying to interface my STM32F4 Discovery board with a sensor that works over i2c, since the sensor required a specialized i2c protocol, I decided to implement my functions using registers. But ...
2
votes
1answer
74 views

PIC32 having multiple PORTB's “high” at the same time

I am trying to set a couple of PORTBbits to "high" (1) at the same time for that I am using the following code: I am using thePIC32MX695F512H ...
2
votes
0answers
144 views

Write to File in Computer running IAR Workbench

I am currently writing and testing an embedded system in which I need to collect data from an accelerometer over a period of time. I already have functions that can read the data at a point in time ...
2
votes
0answers
79 views

nucleo-64 103rb EXTI stays pending

The PC13 EXTI interrupt (EXTI15_10) configured here keeps firing none stop. Most other questions about this same topic indicate that the respective EXTI_PR pending bit needs to be cleared in the ISR. ...
2
votes
0answers
138 views

How to create a Program Log in Readable format

Im looking for a way in which the program can log specific errors/conditions(user-defined) as and when such conditions occur, and while the code is running I can give command to read it and interpret ...
2
votes
0answers
297 views

Strange behaviour using PWM on CortexM3

I have a board with the ATSAM3S2BA-AU, which is a Cortex M3 uC. I need to use 2 PWM channel , here how I've done it : ...
2
votes
0answers
305 views

Float calculations hangs on Kinetis K20 (arm-m4-no-fpu) when PWM interrupt is on

I will use this ARM to control Induction Motor with three-phase inverter. When the program encounters any float operations, like simple plus operation, the system hangs but the pause of debug works ...
1
vote
0answers
61 views

Write protection error on STM32F779II while erasing flash

I'm trying to erase flash for STM32F779II. The start up file starts with that section: ...
1
vote
0answers
70 views

Interfacing touch sensor with stm32f7

I'm having that touch sensor ST IC ST1633i. It's integrated into an LCD. I'm trying to interface with it, but don't know or understand the actual protocol. Here is the protocol So I'm trying to ...
1
vote
1answer
158 views

Programming of ADC in PIC12F675: Not Working Properly

I'm new to embedded systems and I want to program a PIC12F675 for a project. So, the idea is that there is a switch. If the switch is off, the microcontroller normally outputs a clock signal, which ...
1
vote
0answers
63 views

How to properly implement I2C communication between two or more STM32s?

I have a master board with STM32F030R8 and two daughter boards with STM32F030C6. The objective is to communicate parameters between the boards periodically and also on-demand. With some effort I ...
1
vote
0answers
59 views

Go from LPRUN mode to RTC standby in Nucleo L053R8

I want a Nucleo L053R8 to be in standby mode for some time and then wake up to enter low power run mode, execute a routine, and then exit low power mode and go back to standby again. For that, I have ...
1
vote
1answer
71 views

What is the right order for 16bit data on 8bit 8080 data bus

I'm trying to create a program to drive a TFT LCD with an ILI9486 in 8bit but I don't know if I must send the configuration data and commands MSB or LSB first. The color data for the pixels in 16bits ...
1
vote
1answer
59 views

msp430FR6989 board code problem

Working on a school project and I am stuck on my last bit of code. Let’s say S1 is held down and the red LED is on. If, in the meanwhile, S2 is pushed, the green LED remains off and the red LED ...
1
vote
0answers
78 views

Problem with SPI communication with MAX31855K from STM8S103F3

I am trying to read temperature data from MAX31855K over SPI, using STM8S103F3 on a breakout board. Development set up is STVD, STVP and Consmic compiler. And using STM8S Standard Peripheral library. ...
1
vote
0answers
146 views

Controlling DAC161S997 via SPI

I am using msp-exp432p4111 devalopment board and trying to use DAC161S997 with it.The main goal is creating a ...
1
vote
0answers
149 views

Why more codes do not work with PIC microcontroller when RAM and ROM have free spaces

I code for reading EEPROM and edit those EEPROM data and work with those data. Normally I am coding something and upload to PIC and check that code. When I am code more than some point it is not ...
1
vote
0answers
2k views

UART interrupt handling using FreeRTOS

I have two threads: 1. ReadFromUART(): It reads from UART (RX), parses the message and put a command on the messageQueue 2. CommandHandler(): If a message is present in the messageQueue, It execute ...
1
vote
0answers
140 views

FreeRtos problems in ADC task and Streaming Task

I have an ADC task that uses 4 channels and uses the DMA for transfer. I also have a streaming client which streams the ADC data through the TCP socket. I made the ADS Task lower priority than the ...
1
vote
0answers
89 views

CCP PWM Strange behavior - Brief failing

I am trying generate a PWM using CCP and change its frequency on the fly, going from 1.15KHz to 3.28kHz in 180ms. I am using: PIC: 16F887 Frequency: 4MHz (internal) Compiler: CCS PCM C ...
1
vote
0answers
43 views

Torque Sensor Project

My group and I have been working on a Torque Sensor project using the PIC18F2431 chip, and we managed to write the code for each individual aspect on MPLAB for the Quadrature, ADC and LCD. Our concern ...
1
vote
1answer
390 views

Stm32 C - Stepper motor start after 1 minute

I wrote a stepper motor driver with the use of DMA and TIM1. I accelerate the signal using the so-called Ramps. I calculate the times and load them into the DMA table and pass them to the TIM PERIOD ...
1
vote
1answer
323 views

Interfacing keypad with 8051 microcontroller in Proteus

I am trying to simulate this project in Proteus using keil C. We are basically interfacing 4x4 keypad with 8051 microcontroller. This is the code for the project: ...
1
vote
1answer
70 views

Consecutive PWM signals with different prescaler settings

My ATtiny85 circuit generates signals like this one on PB1 (OC0B) using fast PWM (preamble, 16 bit data, stop pulse): I have trouble with the leftmost longer pulse. At the moment i use simple ...
1
vote
0answers
700 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 ...
1
vote
0answers
140 views

Debugger hangs when reaching to Float or Delay

When I run this code, the debugger hangs once it reaches to a Float (in this case the variable 'Distance') or Delay, I mean it seems like it's processing, however it never goes through, and I have to ...
1
vote
0answers
276 views

Serial Connection ATMEGA328p

I wrote up a function to connect via UART and print a string for debugging purposes. But my logic does not add up somehow... I see the line "Random Number" printed in the console but blazingly fast... ...
1
vote
0answers
618 views

How to use functions from math library in Keil uVision MDK ARM?

I want to use log() function (natural logarithm) in one of my calculation of Temperature using the Stein Hart Equation. Microcontroller used is STM32L476 . ...
1
vote
0answers
580 views

ESP8266 and ATmega328 UART communication, gets() function

I'm trying to get an ATmega328 and an ESP8266 to talk to each other over UART. In the attached minimal example, I have an LED on pin 16 (B2) that should start on and do a slow blink to show data was ...
1
vote
0answers
828 views

Low-pass digital filter for 0-10 V, 4-20 mA input

I'm looking for a little direction or recommendations in how to select and implement a low-pass filter in software as my background in signals and systems is quite weak. In particular, I'm interfacing ...
1
vote
0answers
395 views

Error sending SMS to SIM900 in PIC

I am trying to interface SIM900 with PIC18F2520. I need to send SMS to a particular cell number. According to AT commands, ...
1
vote
0answers
420 views

UART baudrate steps

I'm trying to connect 2 devices to each other based on the UART peripheral. First one support up to 1.875 Mb/s & the other one up to 1228.8 KBd. Both work correctly on the 115200 but I need more ...
1
vote
0answers
96 views

Difference between sectors used for Flash and IAP?

Here is a picture of sectors on on-chip 512kb Flash memory on LPC 1788, and the question is what's the difference between sectors 0 to 19 and 20 to 29. Can 0 to 19 be used in IAP or not and vice-versa?...
1
vote
0answers
885 views

CRC32 on SAM D20 (Cortex M0+)

I've been having a hard time debugging the DSU module on a SAM D20 (datasheet). I mean to utilize it to calculate CRC32 for a program I'm uploading through a custom bootloader (bootloader not mine). ...
1
vote
0answers
1k views

PHY device not responding to MDIO

Update: I have read more about this and what I can conclude is that the phy IC is not initialized correctly. Still no able to figure out how to initialize phy device. Please go through the code and ...
1
vote
0answers
520 views

BH1750FVI with I2C won't work

I have the led driver of Adafruit connected to my atmega32. I adjusted their library for the Arduino, so now I just need a µcontroller and not an Arduino. This thing works. Now I want to control the ...
1
vote
0answers
113 views

Problem with the code of GLCD128x64

...
1
vote
0answers
7k views

How to get rid of “Invalid opcode 0x002A at PC=0x004” in ISIS Proteus?

I have used ATmega 8 and have simulated a circuit to use interrupts, when i give an external interrupt i.e. when a push button is pressed all the LEDs connected to PORTB supposed to be lit up, but i ...
1
vote
0answers
5k views

How to correctly use prinft in code composer?

I am using CCS 5.x on Windows 7. The TI board is LM4f232. The following code performs A to D conversion of the on-board accelerometer. I am trying to use printf to see my variable values, but it is ...
1
vote
0answers
903 views

PIC32 read feedback from UART

I'm using a PIC32MX795F512H to set up a Roving RN-131 wifi module using UART. I can communicate with the device but I want some feedback whether my commands are processed or not. I basically need to ...
1
vote
2answers
216 views

UART frame inversion

I have a problem when I send some character from an hyperterminal through an uart frame, I receive the wrong character. I use a PIC 18F46K80. In some test I did, I got these results : Test 1 : ...
0
votes
1answer
43 views

STM32 TIM2 PWM and TIM 5 basic mode simultaneous output issues

Using an stm32f411re I want to generate a PWM of 20% Duty Cycle with a period of 200uS and simultaneously I want a basic timer to be ticking in the background that sends an interrupt every 70uS (that ...
0
votes
0answers
27 views

DSPIC33 - Simple Code for SPI

Unsuccessful, we have been trying to: Using our DSPIC33, set up the SPI slave device which expects mode 0 (clock polarity = 0 and clock phase = 1. Remember that microchip devices let you set clock ...
0
votes
0answers
40 views

Proteus failing to load .elf file for arduino simulation?

I've been writing code for an alarm clock based on the Arduino Uno, and then uploading it to a simulation in Proteus to test it out. Everything was working perfectly until I decided to try changing ...
0
votes
0answers
27 views

PIC16F7X I2C Issues With 24AA01/24LC01B EEPROM

I have an existing PCB that is no longer supported by the manufacturer and has been plagued with software issues for years. So i don't have much control over how the board is laid out and what ...
0
votes
0answers
33 views

bio-impedance with AD5933

I want to measure the human tissue impedance in vitro by using AD5933. According to circuit given in application note by analog devices https://www.analog.com/media/en/technical-documentation/...