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 ...

learn more… | top users | synonyms

0
votes
1answer
51 views

Attiny85 water plant with mini water pump

I`m new to electrical engineering, so it's probably a newbie problem. I'm using a wall power supply(5V-2A) to power the DC Motor and the Attiny85. A C1 470uF to make the power more stable. I don't ...
0
votes
1answer
33 views

SD Card Reader with LPC43xx

I am trying to implement an sd card reader on lpc43xx devices. For this I can make use of the LPCopen examples that use the ROM based drivers. However for some reason the ROM based driver example ...
1
vote
1answer
69 views

CAN- Rx Data Rate faster than Polling rate

I'm working on a safety critical SIL 4 system and so interrupts have to be kept to a bare minimum(hence using only timer interrupt). CAN is used in polling mode. Suppose a data arrives at a CAN node ...
-4
votes
1answer
47 views

Can't transmit char on msp430f54

Trying to send a character with UART but it just refuses to work. my code: ...
-1
votes
0answers
60 views

Check the value of character variable [migrated]

I'm writing some code for Arduino and I'm not sure if I'm checking the value of this character variable correctly. Can you please tell me if this is correct: ...
0
votes
2answers
115 views

Error initiating microSD card in SPI mode

I am trying to interface a 32 GB microSD card with PIC32MX795F512L using SPI communication. SPI communication is working fine as I have tested it by shorting the Data Input and Output line and ...
-4
votes
2answers
78 views

How do I get a value of a RAM by given address? [closed]

I think I know how RAM works, but I have an exercise where I have to read at the address 0x????. Furthermore, I am only interested what value get returned after the reading command. For example: ...
0
votes
1answer
100 views

Writing large volume of data to SD card

I'm planning to make a data logger project with 3-axis sensor and SD card. I would like to store 3200 samples per every second on SD card. Currently I could able to store only 630 samples per second. ...
0
votes
1answer
42 views

Why event flag related functions does not work correctly outside of tasks in keil rtx?

As you know event flags are very useful (e.g. let task running),but unfortunately their control functions (os_evt_clr/set/wait) does not work outside of tasks bodies correctly(e.g. in interrupt ...
3
votes
2answers
115 views

I2C slave not acknowledging

So the setup I am using is a K22FN512 (Arm Cortex M4) along with a AGM01(9DOF sensor board, gyro/accel/mag). The board containing the sensors has an I2C interface to communicate with the two chips ...
0
votes
1answer
60 views

Programming Atmel SAM MCU using SAM-BA

I'm completely new to Atmel ARM microcontrollers and beyond a single class a couple of years ago and some arduino tinkering, new to "proper" mcu's in general. So therefore I am having trouble with ...
1
vote
1answer
32 views

How to distinguish between a read and a write in a Harmony USART BufferEventHandler?

I would like to use the Harmony USART driver on a PIC32MX695F512H using interrupts and with buffer support. After setting the appropriate settings in the MPLAB Harmony Configurator, the system has ...
4
votes
2answers
99 views

Force xc32-ld to place all application code in kseg0_boot_mem

I have written a PIC32MX bootloader application. I would like to tell the linker to put it completely in the boot memory, so that all program space is kept for the final application. Currently, the ...
0
votes
0answers
23 views

Few questions related to microcontrollers programming [migrated]

I'm learning Arduino (I don't have previous knowledge about microcontrollers). I have few questions: What is difference between programming microcontroller in C and programming in Arduino? Is it ...
3
votes
2answers
71 views

SYSTEMConfigPerformance not executing in PIC32

I have PIC32MX795F512L MCU and I am working on its UART communication. I have made the program and its working fine. I was ...
0
votes
2answers
59 views

Unable to set time for PIC32 timers

I am using PIC32MX795F512L. Using Peripheral library to generate timer interrupt. Following is the code I am using: ...
3
votes
3answers
162 views

Why float data type is not accurate on a STM32?

I'm using STM32F103C8T6 and my compiler is KEIL 5. I have written a simple program to check something but I found out an interesting point. When I download the program to the MCU, ...
1
vote
2answers
76 views

How to simplify UART interrupt handlers on Tiva TM4C with SIMcom 900

UARTIntHandler0 interfaces to the USB UART for debugging. UARTIntHandler1 interfaces to the SIM900 GSM module. The purpose of ...
0
votes
3answers
129 views

UART communication not working with higher baud rate values?

I have a PIC32MX795F512L which is connected to 8MHZ crystal. UART program is working with ...
1
vote
3answers
73 views

Issue with performing I2C read operation from ds1307 to pic18F

As advised by my fellow stackers in my previous post, I tested the "Write_to_slave" function in Proteus as well in real time, by sending bytes to the RTC and the slave is responding appropriately with ...
0
votes
2answers
63 views

UART is acting weird

I programmed UART3 peripheral on LPC4088 to send a single unsigned character posiljka over Tx line. This is done by continuously copying this character into the ...
0
votes
2answers
64 views

RTC_DS1307 + PIC18F458 displaying time and date as zeroes

I am trying to get the RTCDS1307 + PIC hardware to work in order to display the appropriate data and time. But the problem is that, its displaying the time and date as 00:00:00 and 00/00/2000 as ...
0
votes
0answers
26 views

Measuring with HC-SR04 and ATMEGA168

I am trying to measure distances by using a HC-SR04 (Ultrasonic sensor) together with my ATMEGA168A. Management summary: I need to set the trigger high for at least 10us and wait for an echo reply ...
-1
votes
1answer
52 views

Delay function in c for 8051 micrcontroller

I have seen function like this in one of the 8051 tutorials ...
0
votes
1answer
77 views

“error #28: expression must have a constant value” - with nRF51822 app_twi

I have been attempting to copy the nRF51822 app_twi example for own application in order to get a better understanding of how the HAL works. However, now I have an error now that I don't understand ...
0
votes
1answer
27 views

ATMega2560 timer not increasing again after overflow

I want to generate waveform with f = 196 Hz using only normal mode. Here is the code I use. Whenever the timer overflows TOV1 is set and PIND0 will toggle. TOV1 is cleared after that and I wait for ...
0
votes
1answer
35 views

Can I generate pulse with timer1 in normal mode in ATmega 2560 using TOV flag?

Timer have CTC and PWN for generating pulse. However if I want to generate pulse when timer reach its max level then using CTC or PWN is somehow not needed when the TOV is set whenever timer ...
0
votes
1answer
62 views

i2c communication with pic 18f452

I am new to pic coding. I am trying to turn motor according to change of accelerometer in x direction. I am using Pic18f452 and adxl345. But I couldnt figure it out how to communicate with adxl345 ...
0
votes
1answer
33 views

How to control multiple servo motors using two timers?

How can I control several servo motors using 2 timers in an ATmega16? I have searched for "servo bit banging" but no coherent post explains it fully. I found some code but I don't thoroughly ...
1
vote
3answers
440 views

How do I use the printf function on STM32?

I am trying to figure out how to use the printf function to print to the serial port. My current setup is STM32CubeMX generated code and SystemWorkbench32 with the STM32F407 discovery board. I see ...
0
votes
1answer
76 views

Getting a stable value from sensor?

I am working with Omron Pressure sensor D6F-PH . When i try to read the pressure value i am unable to get a stable value. I tried averaging but even that doesn't help. Could somebody suggest me a ...
1
vote
3answers
98 views

Audio PWM on atmega644

I'm trying to generate audio through a 3.5mm jack using an atmega644. I tried following this tutorial, but even with the sampling provided, I only get a high-pitched whine. I did a lot of reading in ...
-2
votes
3answers
87 views

Should HDL languages be taught before software languages? [closed]

I'm a Computer Engineering student and learned the basic sequential programming languages (C/assembly/Java) way before I was even introduced to HDLs. Thus, my whole programming logic was based upon ...
0
votes
4answers
121 views

Connecting SIM900 to STM32F4 Nucleo

I'm trying to connect Simcom SIM900 to Nucleo-F411RE using the following configuration for USART1: ...
0
votes
2answers
97 views

Where to save DS1307 program to get real time value?

I am integrating DS1307 in my project and using PIC32MX795F512L MCU. I have somehow managed to do I2C communication in it and ...
-1
votes
1answer
38 views

RangeFinder with SRF05(code only run once)

I want to make some LED blink if the range is in range.for example if the range is between 100mm and 300mm turn the LED on PortB,pin1.but the code only rune once and then micro stops working... here ...
1
vote
1answer
47 views

How to avoid garbage values received in UART communication

I am new to the embedded programming. I am doing a UART communication in PIC32MX795F512L MCU. I have somehow managed to transmit and receive data but not able to ...
2
votes
2answers
67 views

MSP430 how to make configurable ISRs in a module (Code composer studio C)

I have a question that I think the answer to is quite simple. But I've been unable to find a straight answer to. If i have this service routine in some module foo.c ...
1
vote
1answer
104 views

Unable to read data from I2C?

I am interfacing DS1307 with PIC32MX795F512L using peripheral library. I am able to send data but not able to receive it. ...
0
votes
1answer
48 views

8051 ADXL SPI interfacing

I am trying to interface a ADXL345 to 8051 - AT89C51RC2 through SPI interface. I have used the below code taken from here: ...
7
votes
3answers
583 views

What determines sizeof(int)

Regarding the standard data types, What is the size of an integer in ATmega controllers? And what determines the size, is it just the compiler? Or is it in the hardware design of the controller itself ...
0
votes
1answer
74 views

How to generate UART interrupt for GPIOs?

I am using PIC32 and I have few inputs. I want a UART Tx Interrupt to fire whenever any input becomes HIGH. I have somehow manged to write code for UART tx and rx ...
0
votes
4answers
89 views

How to handle polling method in micro controllers.?

I am using PIC32MX795F512L Micro Controller. I need to develop an application where 4 led's connected to pins of controller will blink continuously at a rate of 1sec and there are 15 inputs ...
0
votes
1answer
66 views

Are TI TMS320C6x and TI TMS320C2x compatible?

I never learnt assembly language programming. But, I know C and C++. I need to learn C2000 Piccolo programming. I found no book on C2000, there are only manuals from TI website. But, suddenly, I ...
0
votes
1answer
142 views

PIC32MX Harmony i2c Driver

I have a bit of a problem figuring out how harmony i2c driver works. Trying to establish connection between PIC32 and a barometric sensor MS5637 have been a bit of a nightmare for me. From sensor's ...
-1
votes
1answer
67 views

STM32 SPI2 doesn't respond correctly

I have a problem with the SPI2 on stm32f4vg board , I have a code that is working perfectly for spi1 , but when I change the code to run on spi2, the code doesn't respond here is the original code ...
2
votes
2answers
112 views

UART - receive buffer

I want to receive and send packets via UART. The problem is that I don't want to immediately react on a received byte but on a certain sequence. That sequence consists of 4 UART bytes and shall only ...
1
vote
3answers
71 views

Interrupt-on-Change occurs twice on PIC16F1825

I am having a mind blowing misbehaviour in my PIC16F1825. Basically I am using pin 3 (RA4) to toggle a LED using an Interrupt-on-Change. Problem is, although it toggles the led whenever I press the ...
0
votes
2answers
124 views

“If” wrong interpreted when ADC=1023?

My code on ATtiny13A: ...
8
votes
1answer
241 views

Implementation of D (differentiation) in PID

I am implementing a PID controller for motor speed control. I am done with implementing the PI control and it works perfectly fine for me. In the specification I have been told to implement a ...