1
vote
1answer
193 views

How to intitalize data in Program Memory

Im using MPLAB IDE & C18 compiler to program Pic18f2550. I have to initialize a const string in program memory to save space in RAM how do I do it ?
4
votes
3answers
838 views

How to Debouce Six Buttons on One Analog Pin With Arduino

I'm using analog pin 5 on Arduino to detect presses from 6 push-buttons. On the picture top-right button is number 1 and then from right to left they go as 2, 3, 4, 5, 6. Program should print 0 when ...
1
vote
3answers
299 views
1
vote
2answers
205 views

How to make Arduino Duemilanove Atmega 168 store instructions and act acording to them [closed]

I'm trying to make a small car with Arduino for kids. I have connected 2 DC motors at the end of chassis and one spinning wheel which is able to rotate for 360 degrees and L293NE IC with my Arduino ...
3
votes
3answers
393 views

Should I refactor my C code to optimise it for an embedded microcontroller?

Below is some code implemented on an 8 bit microcontroller. The following comment was posted to another question: As your code doesn't use the i variable, why ...
0
votes
1answer
443 views

Store data in built-in Flash of PIC at runtime using C code

I am designing PIC16F877a based project that counts the number of people in a room and turn ON the relays in accordance with that number like if 5 persons in a room then One relay would be ON. I want ...
1
vote
2answers
380 views

STM32 program not executing

I am currently trying to make my own stm32 development board. i have stm32f100c4t6 microcontroller mounted on pcb. I am using Atollic True studio free edition. i had made small blink led program ...
0
votes
2answers
485 views

Converting 10 bit (2:8) value to 14 bit (6:8) result

My C skills are seriously lacking, and I haven't come up w/ a good way to do this on 8 bit architecture. I've tried shifting by 4, but then I lose digits, I know I can just multiply my 10bit result ...
2
votes
4answers
5k views

How to calculate phase shift between two sine wavefroms

I two sinewave signals with same frequency. I want to measure phase shift between two signals. There will be a small phase difference between two signals. I am using ATmega32-A micro controller and ...
-5
votes
2answers
303 views

problem with reading values in case

I am using ATmega32-A microcontroller and CodeVisionAVR compiler. I am able to read values from an AD7798 external ADC successfully. I am also generating wave from with an AD9833 using SPI ...
-1
votes
1answer
268 views

Logic needed to read and store values

I am new to programming. I have one input signal from waveform generator. I am giving this signal to one sensor and as well as channel 1 of multiplexer. The sensor output is giving to channel 2 of ...
2
votes
2answers
495 views

Analog to digital conversion

I am using an Atmega32-A microcontroller and an AD7798 external ADC. I am able to set the ADC registers and read back ADC values. I have written the following code: ...
-1
votes
4answers
483 views

What are the pros/cons of C and C++?

What would be the pros and cons of using C++ over C for uC (AVR) programming ?
0
votes
1answer
180 views

Loop is executing infinite times

I am working with an ATmega32-A microcontroller. Using USART communication, I am displaying data on monitor and am using switch case to select different commands. In one of the commands I have written ...
3
votes
1answer
267 views

Problem with while loop

I am trying to read external ADC AD7798 values using ATmega32-A controller. In the datasheet, Status register Bit 7 (SR7) indicates the conversion is finished or ...
11
votes
3answers
5k views

What is bit banging

I am new to microcontroller programming. I am using ATmega32-A controller and CodeVisionAVR compiler. I am using the waveform generator(AD9833) to generate a sinewave signal using SPI communication. I ...
1
vote
1answer
159 views

problem with printing function return value

I am new to programming. I have small doubt, I know this is simple question but I am confused. I have the following function: ...
18
votes
10answers
9k views

Programming languages for electronics engineers

I am an Electronics and Communications Engineering student, before I got to college, I have been interested in programming and computer applications. I had focused on designing Windows applications ...
0
votes
1answer
1k views

How to setup defines in AVR Studio 6.0

Like basic C language I tried making a define as follows ...
1
vote
2answers
1k views

MOSI and MISO at 89S52

How can I use MOSI and MISO at 89S52 ? can I use serial port from computer, directly connected to these pins ? Any example codes for this function ? Thanks a bunch Anyone has a code example, ...