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

Arduino if else code [migrated]

I have made this If-Then-Else code, but it doesn't work. First I tough only the analog code is wrong, but if I take a digital port, the code doesn't work either. What did I do wrong? ...
0
votes
0answers
35 views

Determining temperature using lm35 with avr MCU (program debugging) [on hold]

This Program converts the analog input from LM35 into binary outputs: ...
0
votes
1answer
51 views

Can some pins of the same port on AVR MCU's be declared as inputs and some as outputs?

Can some pins of the same port of AVR MCU's be declared as inputs and some as outputs? If yes, then I am not able to understand how this works since we have to compare the pins of the port and also ...
0
votes
0answers
39 views

C Coding Examples For Mc9S08Se8 Microcontroller

Can any one provide me an example c coding for producing a single PWM output and toggling a port pin from MC9S08SE8 microcontroller. I browsed many sites but I find no example c coding for this ...
0
votes
3answers
66 views

using C libraries inside verilog

I'm implementing a radio in Verilog. the time taken for bit reversal while computing the FFT is more. it is almost equal to a symbol time (OFDM system). Can I use a FFT library in C, which can be ...
0
votes
1answer
52 views

MCU Performance: running with emulator vs running without emulator

If I connect to my MCU with its SWD emulator/debugger, is there ANY difference in performance/behavior as compared to when I run the MCU without the emulator? EDIT: I am using a freescale KL25z ...
0
votes
2answers
110 views

Assembler coding for ARM (Cortex-M0 and M3): is it possible/practical?

Unfortunately there are no questions on Stack regarding ARM and assembler at all. My concern -- is time critical devices. Let's take for an example one of my AVR-based device (program compiled with ...
1
vote
2answers
55 views

MSP430 Stack pointer and frame pointer behavior

While trying to analyze a simple Assembly file generated through the msp430-gcc, I stumbled upon a set of instructions that I don't understand dealing with the frame pointer and the MSP430's stack ...
0
votes
3answers
70 views

I'm trying to implement interrupt from RB pins. But it doesn't work

I'm new to PIC programming. I made a program to get interrupt from RB pins. but it doesn't work. My code is as follows: ...
-2
votes
0answers
39 views

Programming Slave SPI on PIC16LF1503 without SS pin

I'm tring to setup a SPI communication. I need to do this without SS pin usage, using only two device: one master and one slave. Now I'm able to send a byte correctly, I see it from a scope, but I ...
1
vote
0answers
37 views

Two functions in the high priority interrupt

I'm using the PIC18F46k22 mcu and I'm using two function in my high priority interrupt routine: ...
0
votes
1answer
47 views

How come the value in my RAM of DS1307 RTC become zero?

I'm using the 56 bytes of RAM in the DS1307 to store some data. My DS1307 is connected to the PIC18F46K22. But after running a few days, all the data inside the RAM will suddenly become zeros. The ...
3
votes
1answer
69 views

Are there platforms where disabling/restoring interrupts from ISR should be done differently than from non-ISR context?

I'm familiar with several real-time kernels: AVIX, FreeRTOS, TNKernel, and in all of them we have 2 versions of nearly all functions: one for calling from task, and second one for calling from ISR. ...
1
vote
3answers
77 views

Returning from interrupts at a different location from where the interrupt occurs. (PIC16F877A)

Is there a way to return from interrupts at a different location from where the interrupt occurred in Microchip PIC16F877A? I have a problem where I need my code restarts at a specific point always ...
0
votes
1answer
35 views

Program aborts after ISR

First I am new to this and I signed in to get some help on this problem I have been having. I have done so much googling to figure this problem out and with no luck. I am trying to capture humidity ...
0
votes
1answer
70 views

What does ADCXX_INYY represent? Configuring ADC on certain pins from STM32F207ZG Board

I have a STM32F207ZG-SK board, and I want to configure pin B0 and A6 to read analog values from another board. Did I do the setup for pin B0 and A6 correctly? I checked to see if it has ADC and it ...
1
vote
2answers
41 views

Why doesn't the MCU's pin go high on time?

I have a STM32F103 and I downloaded this program to it(a simple blink program): ...
0
votes
0answers
56 views

STM32F103 Hangs in I2C_CheckEvent()

I'm trying to connect my both MCU (actually they are two board) together over I2C. one STM32F103ZE (as master) and one STM32F103RE (as slave). This is the code of the Master: ...
1
vote
1answer
15 views

How to drain power with pins for led matrix on atmega32 instead of using a led driver

I want to make a led driver without the tlc594 series. I use the atmega32 of which I can use 1 PWM pin. The PWM pin will be connected to the base of the transistors. With the PWM pulse I can dim the ...
1
vote
2answers
329 views

PIC18F2550 Loop Counter Overwritten by sprintf

I have the following code compiled with Microchip's MPLab and XC8 compiler and running on a PIC18F2550 which is doing something rather odd: ...
1
vote
2answers
99 views

Microchip XC8: How to Overlap Specific Variables without Union?

I have effectively three sets of variables to put in two locations. Sets 1 and 2 are never used together, so they can occupy the same space. Set 3 needs to be unique. I know I can use a union of ...
2
votes
1answer
99 views

AVR simple bootloader - how to call application code?

I am using the atmega328. I want to create a simple test application using a bootloader. I want to: Blink an led at one speed in the bootloader section of flash, and then blink at another speed in ...
0
votes
0answers
30 views

Trouble getting push button working in Nios II

To give you an idea of what I'm trying to accomplish, the 18 LEDs on the board are to scroll right to left, then back to the right, and keep looping as such. Where the push button comes into play is ...
0
votes
2answers
164 views

Why can't I use a variable in an if statement?

I am new to Pic microcontrollers and just started programming them. Now my problem lies in this code: ...
0
votes
1answer
46 views

Measuring pulse length with ICP

I am trying to measure pulse length, with ICP (input capture pin) on Atmega8, coming from this circuit:. PINB0 is ICP pin on AVR. This is (most of) the code: ...
-1
votes
1answer
133 views

Proteus error “Stack overflow is forcing device reset”

I used PIC18F452 microcontroller for my project. And I'm using mikroc pro software. My code compiled successfully. But in proteus, it will give the error "Stack overflow is forcing device reset". And ...
0
votes
1answer
69 views

#10269 output file exceeds code size limit

Using Code Composer Studio and MSP430F5438A I get that error when compiling, but if I randomly delete some lines of the code, it will work fine. The problem is that I have not finished yet and there ...
0
votes
0answers
66 views

How to read write an SD card in SD mode on SAM4S HSMCI

I have managed to initialize the HSMCI and SD card in SD mode on SAM4SD32C. I can now check the relative card address, card capacity and have enabled the full speed and 4bit bus width for the ...
-1
votes
2answers
93 views

Can I use math functions in PIC16F877A code?

Can I use exponential (exp) math function in PIC16F877A code? For example like this: double a,ans; a=5.7; ans=exp(0.5);
1
vote
1answer
64 views

how to clear an UART interrupt flag manually?

I'm using an ATmega32. I have ISR(USART_RXC_vect) as follows ...
0
votes
2answers
64 views

ADC 10-bit false results

I'm using atmega32 µc with the internal 10-bit ADC. I connected my potentiometer to the ADC 1 and I'm using 5 V Voltage Reference. using the following code, I did the ADC-config ...
0
votes
1answer
60 views

Writing data over Serial comm //Arduino & MPU6050 gyro+accelerometer

I'm new to serial communication and I am just scratching the surface, therefore please bare with me. What I need to accomplish is the transfer of the gyroscope data I gather on my Arduino to ...
0
votes
1answer
94 views

Why does my MCU go back? (to the previous instruction)

I don't know why but I see the same odd behaviour sometimes in the debugger environment. Look at this code (function): ...
1
vote
1answer
55 views

RTCC interupt doesn't work

This is my first use of the RTCC interrupt for dspic33F and P24h. I have set the date and the alarm, when the alarm goes on, the LED attached in PIN 15 will blink. The code compiles but there is no ...
1
vote
1answer
62 views

What are the caveats of placing PSoC 4 variables in flash?

PSoC4 chips have only between 2 and 4KB of RAM. That's not much, especially if I want to do some data processing. Between 16 and 32KB of Flash seems much more promising, even if I need to share it ...
1
vote
2answers
160 views

PIC18 xc8 compiler : how to resolve warning (335) unknown pragma “code”

I'm trying to compile this code to blink led with button interrupt, using xc8 compiler and PIC18F4550. I got those warning, so the code lines are ignored and the program doesn't work properly (by ...
1
vote
3answers
129 views

Weird output on 16X2 JHD162A LCD display

I am learning interfacing of Atmega 16a with 16X2 LCD. I have a written a header file for routines which will used frequently and every time I want to interface with LCD using Atmega 16a I use this ...
0
votes
1answer
114 views

If condition strange behaviour

I brought an ATmega328P (SMD) and burned a Duemilanove Bootloader. Everything seemed to be working fine until I tested out conditional statements. Average set of analog val are: 84 , 143 , 255 Here ...
2
votes
1answer
94 views

How to configure PIC24F oscillator?

I'm coding on PIC24F and I'm still fighting with oscillator configuration. Between configuration bits and SFRs such as CLKDIV and OSCCON I am a 'bit' lost... I've been making things work by trial and ...
1
vote
1answer
97 views

Problem with the explorer 16 dev board

I have the explorer 16 dev board equipped with the PIC24FJ128GA010. I wrote a C code to write something on the LCD and a LED blinking after that. I wrote the same code in assembly and both codes work. ...
3
votes
2answers
77 views

NSS pin goes high immediately

I'm working on a simple project with stm32f0. the project is when I push the button on the board, the SPI1 of the MCU should send the data. all things work nicely but there is a problem. look at the ...
0
votes
1answer
91 views

Self-made Arduino pushbutton bank not working

So I'm trying to make a 5 key keypad like circuit, but with increased tactile feel, so I forwent actual store bought pushbuttons. I rigged up keys with some aluminum foil and pieces of plastic and ...
0
votes
1answer
66 views

ATmega8 to MCP23S17 SPI I/O Expander not working

Since three days I'm having the problem that I can not talk to my MCP23S17 SPI I/O Expander from my ATmega8. I've double ...
1
vote
3answers
128 views

External oscillator problem

I have this sample program to blink LED with PIC18F4550 using external oscillator. I'm using a 20.000 MHz crystal oscillator with 30pF capacitors. The problem is when I wire the capacitors the the ...
2
votes
1answer
80 views

UART Flow Control

I confused little bit regarding flow control. I have two devices, one is having UART flow control pins (RTS and CTS) named as Device 1 but other device don't have named as Device 2. The device 1 ...
-1
votes
1answer
102 views

How to make a Calculator? [closed]

I am new to electronics programming. I am currently using C#. Can you please tell me how to programme a Calculator, what programming language should I use? Can I use C/C++? And what components ...
3
votes
2answers
120 views

Casting integer to character

I am using PIC18f microcontroller. I have to write a 16 bit integer variables (2 bytes) which was cast into two character variable i.e to write each byte in a consecutive adrressess of EEPROM. By ...
1
vote
1answer
66 views

Xilinx Video Timing Controller freezes processor

I'm trying to acquire video from an image sensor using a ZedBoard with Vivado 2014.2 and I used an existing (working) video passthrough project of mine and simply added in a debayer (color filter ...
1
vote
1answer
106 views

PIC12LF1552 I2C; uC won't exit Start Condition

So I've been tackling this problem with integrating I2C functionality into my code, which is documented here on StackOverflow: ...
1
vote
2answers
118 views

How to stabilize adc output display on 7 segment

I am designing a simple voltmeter. I am using 8 bit ADC of PIC16F72 and Mikro C compiler with a multiplexed 7 segment display. I am getting ADC value on 7 segment display but its continuously ...