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
33 views

Loading a HEX file with PICkit 2

I'm trying to upload a hex file, generated from multiple C source files with xc8 in Proteus, into a PIC18F4520. Usually, I don't have any problems doing this but ...
0
votes
0answers
32 views

STM32 communicating with LCD module HY28B

I'm currently in trouble with displaying something on the HY28B LCD module . I configured my LCD module in 16bits mode by soldering the right short at the right place and I'm using an STM32 discovery ...
0
votes
0answers
39 views

Using the interrupts of ATmega16

I am using CodeVisionAVR and I'm trying to write an ISR which should do a specific job for me. the problem is that first time that the ISR is called, it works properly but for next time it does not. ...
0
votes
0answers
32 views

How can i make an array equal to another array [closed]

I have a question how can i make an array equal to another array par example. My first array is: int Array1[] = {1,2,3,4}; My second array is: ...
-4
votes
0answers
46 views

Vhdl to C learning t, d, jk, and sr flip flops [closed]

lengththy question but been a VHDL student and looking to C wanted to know how to describe or explicite the above. I maybe able to find them individually but wanted too know how they are all in one. ...
0
votes
1answer
36 views

FIFO ASF drivers and USART avr problem sending and recieve data via rs232 connection

I'm working to send frame of 8 bytes to Micro-controller Xmega128a1 (via RS485). The frame looks like this: {header1,header2,CMD,D1,D2,D3,D4,CRC} For example: ...
0
votes
1answer
52 views

RTC in MSP430 microcontroller

I'm trying to generate a 15 minutes alarm using RTC in MSP430F5438A microcontroller from Texas Instruments. What values should I put in the Interrupt registers. I have tried putting 0x95 in RTCAMIN ...
-1
votes
2answers
71 views

Methods of testing interrupts

I am maintaining and developing software in C for S12X micro controllers. The ISR for each interrupts (like I2C, Timer Interrupts etc) are very lengthy, like around 20 to 30 lines with several ...
0
votes
1answer
54 views

PIC18F2550 PWM Square wave generator

I am trying to generate a square wave on 50% Duty Cycle using my PIC18F2550. The signal is to be outputted through a loudspeaker. The frequency does not really matter, as long as it is in the hearing ...
0
votes
0answers
22 views

Array write/read with atmega 8 with help of USART

I have been stuck on a problem for a week, so I need to ask for help. I want to receive an array by USART and write that array in EEPROM(internal/external) and same read that value or array and ...
-5
votes
1answer
82 views

Atmel studio coding [duplicate]

I am new to atmel studio, and want to know the best way to code this example: What is the difference between using: DDRG |= (1<<DDRG3) vs ...
0
votes
0answers
12 views

Configure UART2 in Kinetic TWR-k53n512

I have already configured a uart2 in kinetic TWR-k53n512 freescale with reference to the hello world example from iar(Under Freescale/kinetic/twrk40-k50-k60/example),program build successfully with no ...
1
vote
1answer
24 views

UART issue with receiving a char

Currently I am working with two MSP430G2553 Microcontrollers for a school project and I have to use UART to have them communicate with each other. The transmit MSP430 is to send a character whenever a ...
0
votes
0answers
27 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 : ...
1
vote
1answer
73 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
19 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
51 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
79 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
381 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
66 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 ...
1
vote
1answer
274 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
128 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 ...
0
votes
1answer
36 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
175 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
69 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
80 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
48 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
71 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
1answer
13 views

MSP430F6736A UART configuration via Code Composer

Using embedded proggraming, Code Composer Studio 6.0.1, Trying to configurate UART to communicate between MSP430F6736A and my PC. Using USB/RS485 converver(2 vire (A,B)). For sending data using ...
1
vote
2answers
60 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 ...
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 ...
2
votes
2answers
77 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
40 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
112 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
72 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
83 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
126 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
44 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
230 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
41 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
147 views

How to sum two binary numbers

i have two binary number ...
0
votes
0answers
18 views

How to handle Uninitialized Interrupts in MSP430?

I am working on MSP430 Series Controller. And I am using Interrupts for UART ( for receive only) and I2C, Timer and DMA. there are also UN-initialized interrupts , To make sure That they are not ...
0
votes
2answers
72 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
92 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
198 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
189 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
144 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 ...