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
0answers
17 views

Write/read 2d data from DDram from the arm on the FPGA?

I having some problems with testing the example code, which the Vivado sdk has available for testing my FPGA implementation. The implementation can be viewed here : ...
0
votes
1answer
22 views

Application protocol for multiple devices on serial bus using the QP Framework

I am currently looking at designing an application protocol using the QP Framework to talk to several devices using a serial bus like Canbus or LonWorks. My idea was to develop a set of events that ...
-4
votes
0answers
72 views

Getting Garbage value when converting Float to string? [on hold]

I am getting garbage value when converting float to string. I can!t use sprintf because it takes more memory and PIC24 microcontroller ram size is very low (128kb). ...
1
vote
1answer
67 views

Digital filter implementation in C (embedded)

I am a recent grad and my new project at work deals with taking the signal from an electret microphone and getting SPL values for 10 standard frequency bands. The analog amplification/conditioning is ...
0
votes
0answers
15 views

How to view Nios 2 assembly code?

I use the Altera DE2 FPGA that can run my C program. If I want to view the generated assembly, how can I do it? It's usually some flag for gcc and I use Nios 2 IDE ...
0
votes
0answers
34 views

Can't get I2C to work with DS3231 and MSP430 due to hanging issues

I am currently using an MSP430G2 processor. I am trying to get I2C communication between it and a DS3231 timer chip to work properly. ...
0
votes
2answers
78 views

Integer division and scaling an input

I'm trying to get my head around integer division. I'm entering a decimal number between 100 and 6300 into my program, I then need to scale this number by 100 and output the result as a 6-bit number. ...
5
votes
3answers
371 views

Writing to pins on a port without affecting other pins on that port

I'm outputting a 6-bit number on PORTA (RA0-RA5), how do I write to those bits without messing up what is already on RA6 and RA7? For example if I want to output 0x3F on bits RA0-RA5. If I use ...
-9
votes
1answer
55 views

How to interface water sensor to LPC2148 ARM 7 kit? [closed]

I am making a prototype of automatic car wiper system using lpc2148 kit as a part of my course project, but I am unable to find the code (.c format) to configure the water sensor. There are some ...
-2
votes
0answers
20 views

SPI communication by UCA0 with two MSP430F5529

I wrote the following code for master and slave. I try to communicate in 4 pin mode. appearently i can not recieve data from Slave or Slave doesn't recieve data from master because of STE pin fault. ...
1
vote
1answer
241 views

Programming pattern to generate VGA signal with micro-controller?

I want to generate VGA signal with micro-controller (like TI Tiva ARM which runs at 90/120Mhz speed). I'm not sure how to make accurate timings with micro-controller. Which programming pattern I need ...
0
votes
2answers
123 views

Moving from assembly to C [closed]

About four years ago i stumbled upon some electronics projects on the internet and ever since i fell in love with it. So I started at basic circuits then moved to analog circuits and spent very little ...
-4
votes
1answer
45 views
0
votes
1answer
33 views

can't figure out why dsPIC digital input is not working

Having trouble getting a basic digital input to work correctly. Just trying to use it as an additional condition for an LED flasher to work. Right now their example code works just fine but when I ...
4
votes
3answers
155 views

I2C communication won't start unless SDA pullup resistor is reinserted

I'm working on a project where a PIC12LF1552 microprocessor is using I2C to talk to a TMP75 temperature sensor. Like the title says, a very strange issue keeps happening. Overview Every time I ...
0
votes
1answer
60 views

How to Sycnhronize STM32F4 Clock with PC Clock

I'm using 3 STM32F401RE to synchronize their clocks. My desired accuracy is of 1ms and even lesser like 0.1ms. This device is connected to PC via USB port. Question 1 : So I would like to know if I ...
1
vote
1answer
73 views

How to count using Interrupts

I have an issue where I want to count how many times I hit a switch using an interrupt. I tried placing the count variable inside the main but it claims that count does not exist. I put count inside ...
8
votes
4answers
3k views

Run code once in lifetime of an embedded C program

How can I make a code snippet run only once in the lifetime of a program? It can be turned off and turned on many times. The only option to run the code snippet again must be flashing the board again. ...
2
votes
0answers
44 views

Implementing periodic sensor data storage and GPRS transmission

I am using custom hardware driven by a TIVA TM4C (specifically, TM4C123GXL) to control a microgrid with battery energy storage, solar panels, four loads controlled by relay, and a SIM900 GSM GPRS ...
0
votes
2answers
65 views

MSP430FR4133 timer interrupt

I am trying to use the timers on the microcontroller in order to count up to 10us then add 1 to the int timer. I intend to use this in a project I am doing where I count the time between pulses from a ...
0
votes
0answers
10 views

Error with libraries after setting up Code::blocks to work as an arduino IDE [migrated]

I followed this guide: http://arduinodev.com/guide-to-arduino-development-environment-codeblocks/ Everything seemed to work until I compiled the example code: ...
1
vote
2answers
56 views

avr-gcc float macro error

When I try to compile some code with macro definition at the following definition # define _SPEED_FACTOR0 0.9 //or any float value I get the error floating ...
1
vote
0answers
40 views

Using map for DC motor instead of servo [migrated]

I am trying to use map command which is used to power servo 180 degrees as the potentiometer moves... Forward digitalWrite(I1, HIGH); digitalWrite(I2, LOW); ...
0
votes
1answer
46 views

What are the (mathematical) restrictions of a TMS320C6713 DSP?

I have a function that computes the sum of even numbers in a Fibonacci sequence less than a boundary. Should I be worried about this calculation? Can the TMS320C6713 handle it? When I run the ...
0
votes
0answers
50 views

MISRA C 2004 rule 1.1 error

I am working in IAR complier and using MK24FN1M0VLQ12 processor for my project. I want to eliminate the Misra errors generated by processor oriented .h and .c files. Currently I am using #pragma to ...
2
votes
2answers
70 views

Systick interruption doesn't trigger when handling another interrupt

I am experimenting with the STM32f4 discovery and i tried to use a delay (based on SYSTICK) in an ...
0
votes
0answers
33 views

ccs pic c: #byte for a nibble

To write to SFRs for SPI one can use the following in CCS PIC C for my PIC: ...
14
votes
4answers
3k views

C standard libraries on bare metal

I am mostly doing development on devices that have ported Linux so the standard C library provides lots of it's functionality through implementing system calls which have a standardised behaviour. ...
4
votes
0answers
86 views

TMS320 Floating Point (Texas Instruments DSP from '98)

Background Is there anybody here who is an EE with programming experience who has worked with the Texas Instruments TMS320 C3X-series DSP? I am currently doing some work with the C3X for a project. ...
5
votes
4answers
1k views

Why do people use (1 << PA0) when setting port?

In AVR Tutorials I often see: DDRA |= (1 << PA0); PORTA |= (1 << PA0); used instead of: ...
0
votes
0answers
48 views

CCS PIC C: To use SPI should one use both #use SPI preprocessor and setup_spi()? What is the difference between spi_write and spi_xfer()?

The CCS PIC C Compiler seems to have #use SPI and setup_spi() both doing basically the same thing related to the SPI interface configuration but not taking the same parameters. Similarly, it has ...
0
votes
1answer
79 views

Problem with lcd - pic interface

I wrote the following code to display a blinking text on an lcd. The code works properly on the simulator but the real lcd doesn't display anything. I attached the circuit diagram I used to connect ...
1
vote
1answer
103 views

Proper way to wait N cycles in ARM Cortex-M4

After enabling a clock for a certain port you have to wait 4 cycles for the clock to finish initializing. How can one wait for N cycles the proper way? In my code I used this: ...
0
votes
1answer
41 views

lcd “random fruit” built in function for pic

I'm trying to display a random fruit on an lcd and I was wondering if there's a built in function in the MikroC PRO for pic v.6.4.0 library that does so. I drew the fruit using the lcd custom ...
4
votes
1answer
144 views

STM32 DMA Transfer bridge between 2 uart ports

I am using a stm32f103 and I'm trying to simply transmit all data received on 1 uart to another uart and vice versa. When using 2 terminal programs it works great, everything I type gets transmitted ...
0
votes
0answers
30 views

DSPIC30F4011 - Need Help with Sequential 4 channel ADC Scanning

I am working on a project with some friends which calls for several IR proximity sensors to be sampled sequentially (The emitters must be powered up individually) but I am really struggling with the ...
0
votes
2answers
145 views

How to sum two binary numbers

i have two binary number ...
0
votes
2answers
56 views

MSP430FR4133 Internal Temperature Sensor

I am currently using the MSP430FR4133 in order to make an ultrasonic measurement system for the volume of a room and would like to be able to check the temperature of a room to work out the speed of ...
0
votes
1answer
89 views

Sensor not working

I have the following code that is supposed to turn on a led (Port D, pin 5) whenever a digital distance sensor is triggered. Double checked the pinout and the sensor is working. Is there a problem in ...
1
vote
5answers
182 views

Use UART PIC24FJ64GB002

I am trying to setup a PIC24FJ64GB002 for UART communication in MBLAB using XC16. I am using the USB CDC demo to communicate with a device, and I am trying to relay that information to an arduino ...
1
vote
3answers
149 views

Binary Counter C Code for pic16f877a

I'm trying to write a code for an up/down binary counter. The task is to light up 8 leds (up counter)and then reverse the lighting order (down counter). I am trying to create an array of leds in my ...
-3
votes
4answers
126 views

Generate sine wave with PWM in C-program - STM32F100RB

I am trying to generate sine waves from my microcontroller (STM32F100RB) by using PWM in C. I would like to generate sine waves and to do so I would need to variate the pulse width. I am trying to ...
2
votes
3answers
111 views

Write to sets of two bits in a register at a time in C

I am trying to set multiple values into a 32 bit register, and each value has 2 bits. Trying to come up with an elegant way to do this. Write now I have something like this: ...
-1
votes
1answer
103 views

PIC C program flow problem XC8

Problem: My C code is not running to the end. To test my EEPROM read and write, I decided to write a simple array and read it back to different array using a PIC. However the problem is not the ...
0
votes
1answer
87 views

stm8s I2C Communication

I want to use I2C Communication between two stm8s208cb MCUs. I use stm8s standard peripharel library. My code: Master: ...
-3
votes
1answer
121 views
0
votes
1answer
68 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
55 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 ...
-4
votes
1answer
51 views

Can't transmit char on msp430f54

Trying to send a character with UART but it just refuses to work. my code: ...
0
votes
2answers
151 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 ...