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

3
votes
0answers
33 views

AVR: How optimize cycle-counted ISR to portable code, using inline asm

I'm trying to optimize my RX and TX interrupts to meet maximum execution time of 25 cycles while interrupts are disabled. So far, I have found that code is optimized enough, but pushing and popping ...
1
vote
0answers
15 views

How to program USB RFID reader/writer module?

I bought an USB RFID reader/writer module from local store, it is not well known and branded, It connect to computer with USB port , and i want to write a program for it in Linux Ubuntu. I find out ...
-3
votes
1answer
47 views

Search for matching string on the other string

I have a problem with strstr function, I receive characters from UART with interrupt & save them in the n length array(buffer array). Then in main loop I check ...
3
votes
3answers
83 views

Using bit fields in interrupt-driven applications

When implementing interrupt-driven applications I usually create a bitfield to keep track of different interrupts. For example: ...
-3
votes
2answers
51 views

How to control RC Servo motor using 8051?

I'm using an 8051 MCU and I wish to control an RC servo motor with 2 push buttons for an RC toy car. I have code to use two buttons, one for right and another for left. When I click one button, the ...
0
votes
1answer
42 views

Embedded C programming to interface ultrasonic sensor to 89s51 microcontroller

I am trying to interface an ultrasonic sensor HC-SR04 to a 51 family microcontroller like 89s51. After learning about how ultrasonic sensor works I wrote a program as per my knowledge about ultrasonic ...
0
votes
2answers
24 views

modbus_read_registers - ERROR connection timed out

We are using libmodbus library to read register values from energy meter EM6400 which supports Modbus over RTU. We are facing the following two issues. 1) We are facing issue with ...
2
votes
3answers
268 views

Comparison between uint8_t and String

I have a very fundamental question regarding string comparison.. I implemented a USART to PC with STM32L0 Nucleo board, and I can type something in terminal and receive it on the micro as follows: ...
0
votes
1answer
34 views

BeagleBone Serial Communication

I have a problem seeing characters written in /dev/ttyS8 on my PC terminal with this C code: ...
1
vote
1answer
50 views

can't assign PORTD a variable value on PIC18F

I'm using the following code to test some GPIO while I mess around with the PIC18F45K20 demo board. I realised something was strange when I couldn't increment a value and see it reflected on the LEDs ...
0
votes
1answer
42 views

How to make freeRTOS working on stm32f4

I'am trying to run a RTOS on my STM32F407VGT6 board. I downloaded the demo CORTEX_M4F_STM32F407ZG-SK from freeRTOS website and flashed the code using IAR IDE, however the leds are not blinking as ...
0
votes
2answers
36 views

How to interface two leds and two push button with 8051?

i'm using 8051 mcu to do some tests. i'm trying to use two input for two push buttons and two outputs for two Leds. SW1 = push button 1 SW2 = push button 2 LED1 = led1 LED2 = led2 for example -if i ...
0
votes
2answers
87 views

How to make if condition run once in while(1)

I am intergrating inputs and uart in PIC MCU. My program is if I press a switch, this info is send to terminal but the problem is it keep on displaying until I release the switch. I want it to be ...
5
votes
3answers
178 views

Is disabling time sensitive interrupts in C a bad idea?

I sometimes see code that disables interrupts, for example to perform a non-atomic read/write to a global variable used in an ISR. On AVR with gcc, this may look like: ...
1
vote
1answer
28 views

Receiving a string via Xbee in API Mode

In my earlier question at this link , i asked a question on how to use minicom in linux to communicate between two Xbee's in API mode and got the answer. While i ...
1
vote
2answers
58 views

SPI communication between PIC24FV32KA301 and MS5611 won't work

I am new to microcontrollers programming and I am trying to establish SPI communication between PIC24FV32KA301(Datasheet) and MS5611(Datasheet). After a week of searching and learning about SPI I am ...
3
votes
3answers
76 views

Error interfacing DS1307 RTC with PIC32

I am interfacing DS1307 RTC with PIC32MX795F512L. I am using I2C1 for ...
7
votes
3answers
238 views
+100

MSP430 program only works during debug mode

I am trying to retrieve the values from the ADC on my MSP430F5529 and send them to my computer over USB, but I am starting small. All I have right now I something that retrieves the ADC value and ...
0
votes
0answers
24 views

How to send command to servo motor using two interrups port with 8051?

I'm using 8051 MCU and i'm trying to send signal to servo motor with interrupt 0 and 1 port from 8051. I have some problems here, when i push any buttons, it happens nothing. thank you for your ...
-1
votes
1answer
67 views

How to design GUI for my embedded design [closed]

I have designed my embedded software and it is working fine. I was thinking about making good GUI so that it is easy for others to interface with my software.
1
vote
1answer
34 views

How to use CMSIS to set up bidirectional Port on STM32F4

I'd like to use the GPIO_TypeDef an GPIO_Init to create a bidirectional Port on the STM32F407, some input pins, some output pins. Do I just run GPIO_Init twice, once for the input pins and once for ...
1
vote
1answer
55 views

Unable to receive GPS data from Quectel L80 GPS module

I have a Quectel L80 GPS module with PIC24fj128ga202. I am using UART2 to get GPS data from the module and I transfer the received data to hyperterminal, using UART1. Between PIC and PC I there is an ...
0
votes
1answer
100 views

Running LED at different speed using timer

I am new to C programming. I want to program a running LED on my PIC24 (PIC24HJ256GP206) I have 5 LED on my PORT G and have input PORTB (RB0) My program should, if RB0 is grounded (I put jumper on ...
1
vote
1answer
99 views

Help? SPI communication slow

I am using an Intel Edison with Arduino Breakout Board to communicate via SPI to a LS7366R Quadrature Encoder Buffer. I am using the QEB as a timer: a pulse that enters the index will shift the ...
2
votes
1answer
58 views

OPT3001 conversion formula / equation?

I am struggling to find a real conversion formula for converting the RAW value into result that makes sense. I am using an OPT3001 sensor from TI and ATTiny25 as MUC. I have found one example online, ...
2
votes
1answer
40 views

Error in turning ON the LED using UART in PIC32

I have a PIC32 starter Kit & IO Expansion Board. PIC32 Starter Kit has 3 LEDs on baord ...
1
vote
1answer
58 views

Scheduling the transmision of CAN frames in an RTOS

I'm planning to use my STM32 board to send CAN frames. I implemented a simple scheduler that contains 10 tasks; one task will be responsible for sending frames. To do the job I declared a structure ...
2
votes
1answer
36 views

PIC16F684 Timer 2 interrupts occurring much more quickly than expected

TL;DR: Timer 2 interrupts (1:4 postscaler, PR2=0x3F) occurring at about 139 kHz instead of expected 19.5 kHz. Changing postscaler to 1:1 has no effect. I am using a PIC16F684 microcontroller for a ...
1
vote
3answers
74 views

Understanding Source Code of I2C communication

So in my University studies we recieved few source code samples that are working with a OPT3001 Light Sensor. Our studies do not focus on engineering tasks in general, but this is a lecture that ...
-2
votes
2answers
86 views

STM8 multi-byte I2C reads

...
1
vote
0answers
29 views

Input output voltage problem in PIC32 starter kit & IO expansion board

I have a PIC32 Ethernet Starter kit and IO expansion board. I have a made a simple input output program in which if ...
1
vote
3answers
97 views

I2C: Unable to Read Multiple Byte using Bit-Banging method

I am using Bit-Banging for I2C communication via PIC24FJ128GA010. The code works fine for writing 16bytes to EEPROM ( I recieved ACK = 0 for every Byte write ). While reading EEPROM I am able to ...
6
votes
5answers
366 views

Best practice for documenting ports / peripherals?

I've recently taken an interest in embedded development and am wondering how most people document their projects. For example: Each pin on PORTE is wired to ...
0
votes
1answer
37 views

IC FLASH replacement? [closed]

I was working on a schematic design and wanted to modify a part. The part number is W25Q16DWSSIG made by windbound. I'm trying to replace it with an IC flash with a lager storage and faster speed. It ...
0
votes
1answer
97 views

Signal Conversion in C

So I have a 32 bit Float data type that represents a value of Ohms. I need to convert that signal to a 8 bit unsigned data type that represents mOhms, where 1mOhm per bit. Does anyone have any ideas ...
0
votes
1answer
62 views

Problem in PIC24FJ128GA202 UART?

I started to work on PIC24FJ128GA202 microcontroller. Tried samples programs like LED blink and switch, controller works fine with the coding, then I started to work on UART configured all the ...
0
votes
1answer
102 views

Can't get PIC 16F876 working.What am I doing wrong?

I have been playing around with the PIC16F628 for a while, and now I want to transfer to something that has more pins. Specifically the PIC16F876, but I can't get it working. I just want to turn an ...
3
votes
1answer
65 views

MSP430 Launchpad buttons do not behave properly and cannot see variables

I just got an MSP430F5529 Launchpad and have done one tutorial where i make the LED located at P1.0 blink. I am using code composer studio as my IDE Now i am trying to get the LED at P1.0 (red) and ...
2
votes
1answer
37 views

TWINT flag never goes up

I want to establish I2C connection between two atmega2560. First one is working as a master, and second as slave. Master works on a transmitter mode, and Slave works as receiver. On Master side: ...
0
votes
1answer
43 views

Using the USART on the PIC16F877A

I am trying to use the USART to make two PIC16F877A microcontrollers communicate. When I look with an oscilloscope at the output on the TX pin of the MCU that's transmitting , I see the normal NRZ ...
0
votes
1answer
24 views

Best way to simultaneously control two servos positioned horizontally and vertically?

I'm trying to set up a C program where a servo (servo1) sweeps to a position, waits a few seconds, moves to another position and repeats 4 more times. Another servo, positioned vertically, (servo2) is ...
1
vote
1answer
98 views

Bitwise operation for UART, AVR

I'm trying to work on UART for AVR. After setting the baud rate registers UBRRnX, I'm trying to configure the UCSRnA register. I'm trying to set the 2nd bit, U2XO. Which is the right way to do it? ...
0
votes
0answers
13 views

LPC4337 I2S Synchronized Word Select Signals

I am trying to setup the I2S peripheral on an LPC4337 device so that it will send and receive audio data in master mode. The problem I am having is that I would like to ensure that both the transmit ...
2
votes
1answer
58 views

TM4C123 UART is always in busy state

I am trying to configure UART0 on TM4C123G launchpad. All of my configuration registers are perfect. They've been written with desired values. But somehow, my busy flag is always 1 after first write ...
0
votes
1answer
35 views

Error interfacing GSM with Atmega32 using UART Interrupt?

I am interfacing GSM with atmega32 using uart interrupts. I am using an external interrupt which is fired when a user press a switch and uart receive interrupt to receive the response of GSM. CODE: ...
2
votes
0answers
31 views

Best practice for documenting ports/hardware for embedded project? [duplicate]

I've recently taken an interest in embedded development and am wondering how most people document their projects. For example: Each pin on PORTE is wired to ...
0
votes
0answers
27 views

how to programm TIVA C using Eclipse

I got a Tiva C board EK-TM4C123GXL and I want to program it using eclipse, my question is , is there any tutorial which explain how to do that on windows ? thanks ...
4
votes
1answer
148 views

Interrupt never fires

I'm new to embedded and I've been struggling with this for days. I just don't understand why this doesn't work. I'm using an ATxMega128A1. I want to use a timer overflow interrupt to left shift a bit ...
0
votes
1answer
39 views

Problem in GSM interfacing with 8051 (AT89S52)

I have been trying to interface GSM using the code and circuit from this link, since 2 days. only difference is that I am using AT89S52 and SIM900A module, but I am not getting any response like OK on ...
1
vote
1answer
72 views

PIC32 and I2C EEPROM interface problems

I am writing code for a PIC32MX250F128B to interface with the Microchip 24LC02B EEPROM with I2C interface. I have followed the datasheet of the EEPROM, the PIC32 and section 24 of the PIC32 family ...