Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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)

3
votes
1answer
28 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
2answers
41 views

Proportional Control Balance Beam

Bit of an unorthodox question I'm sure, but I'm making a balance beam (two rotors on either end of a see saw) with proportional control, and I can't seem to get it to balance at 0. The proportional ...
1
vote
1answer
32 views

Unexpected results when measuring MPU6050 sample rate with RaspberryPi

MPU6050 datasheet says that maximum accelerometer data output is 1Khz, so in theory when measuring time it takes to receive 1000 data samples through I2C, so I should receive all data in no less than ...
-1
votes
0answers
23 views

Read internal temperature sensor value from raw register address [on hold]

I'm trying to read the internal temperature sensor in a stm32f2 microcrontoller, in our project we are using libopencm3 and using this you should make an adc setup ...
0
votes
1answer
31 views

MSP microcontroller Watchdog timer

I am new to programming microcontroller. what does the following like of code do: WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD i have looked at the technical ...
1
vote
1answer
77 views

USB Strange behavior

I am porting the USB driver from the STM32F4 device to STM32L4 device. It almost works. During the enumeration it sends and receives the information, but the data is not exactly the same as from the "...
1
vote
1answer
60 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 ...
0
votes
1answer
48 views

AVR NRF24L01+ No Communication, No IRQ Activity

I've been scratching my head for a few days over getting the NRF24L01+ modules to work on AVRs (ATMega328/p). I followed Gizmosnack's tutorial, not changing very much at all from his code. I've also ...
0
votes
0answers
47 views

PWM output with Teensy 32. Atmega32u4 failing when printing values to terminal

I am implementing PID control and have developed code that reads analog potentiometer inputs, converts it to discrete counts, and outputs a PWM response to a DC motor based on the angular displacement ...
0
votes
2answers
105 views

Using Arduino Mega as Atmega2560 AVR development board with Atmel Studio 7

(updates at end) Qualifier: I am posting this here and not on the Arduino Stack Exchange because my question is about firmware development and not Arduino development. Project: I am designing a PCB ...
2
votes
0answers
52 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 ...
0
votes
1answer
50 views

MPLAB X __delay_ms() hangs on PIC16F77A

I'm trying to use the __delay_ms() function to make an LED blink on the PIC16F77A. The reason I think it stalls on the __delay_ms() function is because whatever I set RB0 to before the delay ...
2
votes
1answer
55 views

ARM Cortex-M3 Interrupts and Interrupt service routine &interrupt handler

I am trying to understand arm architecture and i got stuck with one concept, i.e, INTERRUPT SERVICE ROUTINE. I had gone NVIC structure for HARDWARE & SOFTWARE interrupts. But at some point i got ...
1
vote
3answers
88 views

Circular buffer in flash

I have been facing following problem. I have implemented a datalogger i.e. software running on a MCU which creates periodic snapshots of a system state (values of some quantities of the system). ...
3
votes
3answers
222 views

How to define 14-bit lookup table for PIC/XC8 (if it's possible to do without assembly)?

I'm writing the firmware for a simple testing device that would need to store a very large lookup table (I need 13500 entries with values 0..100 decimal). The target PIC MCU is PIC16F1829 (8K words of ...
0
votes
0answers
69 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. ...
0
votes
0answers
11 views

AVR Qtouch Composer project failed to compile

I have the latest Studio 7 + Qtouch library. After creating a project (tried both attiny44 & atmega168) I get an error touch_aip.h is not found and indeed I can not find this file on my HD. Any ...
0
votes
1answer
55 views

Can STM32F4 USART be used as UART?

There are 4/2 USART/UART ports in STM32F407 (Page 15) MCUs as shown in the image. I need 4 UART ports in an application. I wonder if its possible to use 2+2 (UASRT+UART) ports for my purpose in this ...
1
vote
3answers
159 views

Error handling in embedded systems development

I am developing a Firmware and I am using 3 layers: Driver, Platform and Application. In order to handle the communication between these layers, I am using an approach where each function will return ...
0
votes
1answer
57 views

Is it possible to install `tcpdump` on an Arduino 101?

Currently architecting a side-project idea I have that requires tcpdump on an Arduino 101. This will be my first project and just wondering if this is possible or ...
0
votes
3answers
140 views

PIC16f88 not debugging

Disclaimer, i am more or a hardware designer and not so much a coder, i can code but i'm not the most proficient at it. I have a project I'm working on that has a portion of the code that appears to ...
1
vote
1answer
47 views

SAM Timer counter / atmel ASF

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

How to use the BeagleBone's PRU with a modern kernel?

I am trying to implement a basic LED blinking program on the PRU. Up till now what I found are guidelines for old kernel versions (old in the sense 3.8 to 4.4 kernel version). Details of my ...
0
votes
2answers
47 views

STM32F407 fallback to Internal Osc

I wonder if it is possible at run time to detect that an external Oscillator has gone bad and the application now falls back to internal Oscillator.. specially for the case of STM32F407 MCU?
0
votes
2answers
86 views

STM32F407VG Pin Assignment

I am new to the STM32 world. I am using [STM32F407VG]1 (100 Pins pkg). I have to select an 8-bit port for connecting 8 digital inputs to the MCU.. but the datasheet shows so many alternate as well as ...
0
votes
1answer
70 views

Fingerprint scanning repeatedly

I am using 2 fingerprint module to make an attendance machine. Normally i have seen the attendance machines just need the user to put his/her finger on the scanner and it is scanned.. then next ...
0
votes
0answers
62 views

STM32F4 Discovery + ILI9341 SPI + STemwin

as the Question says, I'm trying to run STemWin into STM32F4 Discovery board. It compiles well, but does not show anything. I think the LCD initializes, but after that, It does not work anymore. I'm ...
0
votes
0answers
42 views

ENC28J60: Controller loses it's configuration after a while

I have written my own driver for the ENC28J60 Ethernet controller from Microchip for education purpose. But the Controller lose it's configuration (register ...
2
votes
3answers
47 views

Does the addresses of an arbitrary peripheral register can be used to store data randomly during code execution?

I need to make sure of the concept of volatile qualifier in C-language. so volatile is used when we don't want the compiler to optimize the variable being identified as a volatile or in other words ...
1
vote
1answer
78 views

Is it possible to replace STM32F407 Internal Bootloader

I am new to the STM32 world. I know that all STM32 MCUs come with an internal bootloader. Is it possible to replace it with custom boatloader?
0
votes
1answer
52 views

TrueSTUDIO look and feel

I have used Keil uVision and Microchip MPLABX IDE's a lot for various MCUs. Now starting to use Atollic TrueSTUDIO for STM32 MCUs. But even after spending many weeks on trueSTUDIO and building many ...
0
votes
1answer
76 views

eeprom driver code c++ overlapping

im trying to write driver for EEPROM (24LC64): page size: 32 byte capacity: 8KB (64Kbit) definition code: ...
0
votes
1answer
22 views

Built-in Timer Module HCS12

Why is it preferable to use the built-in timer module rather than using assembly language coding to create delay loops? I've gone through the entire "HCS12 Microcontroller and Embedded Systems" book,...
0
votes
0answers
24 views

AuCM350 UART interrupt

i am using ADuCM350EBZ evaluation board,i want to enable UART interrupt, like when i enter any button from keyboard then interrupt will occur. i am using one example given in this board here uart is ...
0
votes
0answers
64 views

STM32F4 CubeMX SysTick timer rate

I am using CubeMX to generate initialization code for STM32F407 MCU. I wonder where can i see the SysTick timer rate in CubeMX or its generated code? I am using 8 MHz external crystal and set SYSCLK ...
0
votes
3answers
102 views

STM32 HAL driver for register value update

I am new to HAL drivers and STM32 MCUs. Can anyone tell me how to use HAL drivers to update register values of STM32F407 MCU? I have to programatically update the values of ARR and CCR registers of ...
1
vote
1answer
77 views

How to send multiple command without using delay to serial port?

I am writing a serial communication program on LINUX to send command to PIC32 MCU. When I am sending two command one after another as given in program MCU will perform action on first one only and if ...
1
vote
1answer
36 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 ...
0
votes
1answer
53 views

difference between CMSIS and ASF

im trying to make c++ project using atmel asf. the compiler have: ...
0
votes
0answers
97 views

Bus fault when accessing mcu internal peripheral

I am struggling with a bus fault error on my samg55 µC based on arm cortex m4 architecture. The issue occurs sporadically and is not 100% reproductible. Let me give some details. Application code ...
0
votes
1answer
41 views

AVR Bootloader write: How to write a bootloader page address and execute SPM instruction in C code

I want to write bootloader for avr atmega328p in C language. I want to perfom a page erase: So I have to write the address of the z pointer. // Don't know how to implement in c code; Then make SPMEN ...
0
votes
1answer
78 views

Unable to interface BeagleBone Green with MCP3008 ADC using SPI

I am unable to interface MCP3008 with BeagleBone Green. I am trying to set communication in mode 0 (CPOL=0 CPHA=0), the built in frequency in dts is set to 1MHz. Things I have tried: Enable device ...
0
votes
2answers
74 views

Problem designing a PIC to just print on the LCD hello world

I have programmed a PIC before. The function of this PIC was to display Temperature based on an NTC, my little cousin yesterday messed with the wires and now it is not printing anything on the screen, ...
1
vote
1answer
40 views

can't read push button value in dsPIC33

This is the first time I work with a PIC microcontroller. I am using the Clicker 2 for dsPIC33 board (dsPIC33EP512MU810), and so far I am trying to implement a basic programme for testing the board. ...
3
votes
3answers
232 views

STM32 CAN bus receive interrupt is sometimes not fired, and CAN transmit sometimes times out

I have two STM32 boards connected via a CAN bus. They periodically transmit a message to each other. For some transmissions however, HAL_CAN_Transmit returns with ...
0
votes
0answers
37 views

Translate from AVR pgm_read_byte to normal C array manipulation in STM8

I am trying to translate a couple of lines of code from AVR space data to STM8 normal C data manipulation. As you should know, AVR has a program space which can storage data for read only operation, ...
0
votes
2answers
77 views

PIC simple LED ON not working

I have been trying really hard to just get a PIC to turn on an LED, i know its super simple but for some reason i just cant figure out, its not turning ON! I am using an old fashion PIC16F877, I am ...
0
votes
1answer
74 views

How to write more than one page at once in Winbond W25Q32JV

I am using Eclipse IDE for firmware development. I am using Quectel MC60 module with Winbond W25Q32JV (4 MB memory). The thing is that I am able to read/write single page. I am facing issue with ...
0
votes
1answer
139 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 ...
2
votes
2answers
83 views

Just read a Register

I am using a STM32F103CBT6 as I2C Master. After sending the I2C Adress of the Slave I need to clear the Addr bit in the SR1 register. The Datasheet states: "ADDR: Address sent (master mode)/matched (...