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

How to ensure serial transmission and reception of required data without any garbage values in the 8051?

I'm trying to continuously transmit the character 'L' from the microcontroller 8051 to the PC at a baud rate of 9600. The frequency of the 8051 is 16 MHz, and I accordingly loaded the BRL register ...
1
vote
0answers
29 views

AVR - ATmega16 - Timer config

Trying to figure out the timer setup in Atmel Studio 6 for an ATmega16 microcontroller. And I just don't get it. I am trying to create a TickCount similar to GetTickCount() Retrieves the number of ...
0
votes
2answers
60 views

Run program directly with MPLAB X(PIC16F628A)

I want to blink LED with PIC16F628A and run it directly with the button make and program device main project of MPLAB X. to programing the PIC I did simple wiring ...
1
vote
1answer
184 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 ?
1
vote
1answer
42 views

Is the output clock correct?

I have written and using a STM32F030F4 for toggle a pin. I configured all things and my program is this (I use GPIOA->ODR ^= GPIO_PIN_2 for toggle GPIOA2 in ...
0
votes
0answers
29 views

UART PIC18F8722

I'm trying to connect a bluetooth module (the baudrate is 9600) with a PIC18F8722. The connection is with UART and I programmed this: ...
0
votes
0answers
43 views

Recommendations on Programming [closed]

Does anyone have a recommendation for a programming book on C? I've looked at several books but can't seem to pick one. I'm not a total beginner to software programming but I don't have a lot of ...
0
votes
3answers
67 views

How to do a specific task after some time

I have to switch on one relay after some specific time, but at same time I have to do continuous polling for controlling other relays, I am already using interrupt for multiplexing purpose (7 segment ...
0
votes
1answer
28 views

How to Prevent continuous switching fluctuation?

I am designing a digital stabilizer ,I am using ADC feature of Micro controller to sense incoming voltage and processing output through an AUTO Transformer .The code is like ...
0
votes
1answer
64 views

Displaying different Data on 7 segment

I am Designing a Digital Stabilizer ,where I have to Use a Multiplexed 7 segment Display to Show Input Voltage & Output Voltage ,I have successfully able to see input voltage but I am unable to ...
1
vote
1answer
54 views

C Programming for 8051: SFR directions as arguments

I'm currently making a very simple Tic-Tac-Toe game with an AT89C51RC2 and I am having issues getting the button input right. Basically, the input is a 3x3 Button Matrix which I want to utilize by ...
3
votes
2answers
166 views

SPI1 doesn't work

I'm working on a simple project. I want to send a string. the string is "Rohalamin". the second board after recieve the string should turn on the LED. the program for first board is (the MCU for ...
1
vote
1answer
71 views

USART communication problem on PIC18F6722

I am trying to use enable USART communication on a PIC18F6722 microcontroller. More specifically enable the receiver and attach a receive interrupt to it. The datasheet describes the relevant bits ...
3
votes
2answers
114 views

Where is the C API reference for the MSP430? CCS version

I see a lot of sample code and tutorials, but where is it documented that symbols (defines) such as P1OUT and P1DIR are ...
2
votes
1answer
65 views

PIC12 TRIS Register not setting, No GP0 GP2 output

I originally asked the this question on Stack Overflow. I think here would have been a better audience. I'm trying to program a PIC12C508A to do a simple LED learning circuit. I've read some ...
6
votes
1answer
719 views

Are pointers treated differently in AVR compared to say x86?

Microcontroller: ATtiny13 IDE: Atmel Studio I'm trying to write a Hello World application by writing high to port PB4. This works fine: ...
1
vote
2answers
138 views

Executing code at diferent speeds, using one timer, and no extra RAM

I was wondering, will this actualy work? (when timer / prescaler set) It saves RAM by not using extra variables. Are the better ways of doing this? ...
0
votes
1answer
47 views

Avoding repeated queries while working in a WSN set-up of Coordinator-->Repeater-->End Device , when Coordinator and End device are in Range

I am working on a WSN set-up. I posted a question earlier on the same. I had a another question with respect to the same. My question is while working in broadcast mode, if Coordinator and end ...
1
vote
2answers
130 views

Problem with USART programming

I have got a problem with an USART module I wrote in C for PIC12F1822, related to USART transmission. Everything happens to be fine when I debug in MPLAB with PICKIT3 (TXREG changes value and every ...
0
votes
3answers
95 views

Tools to compile pointers to arrays of static size

Are there any static code analyzing tools for C that convert pointers to arrays of a static size? It is a marginal pain and I just figured I'd check with the community. A quick google search did not ...
1
vote
1answer
53 views

AVR USART Not Receiving

I have connected my AVR USART to file stream so as to make it easy to send formatted strings on ATmega8 From the AVR, I can send(TX) just fine. However, I am not receiving anything. Can't put my hand ...
0
votes
0answers
30 views

Reading an irregularly shaped matrix and doing action when a key is pressed in a modular way

Before I get into the details, I'd like to apologize if this is the wrong SE site for this. I could see it going on here, Stackoverflow, Arduino, or maybe even code review. I am using a Teensy 2 as a ...
1
vote
1answer
64 views

TCP bootloader memory issue

I am trying to write a simple, stand-alone TCP bootloader for an AVR micro-controller. Right now, I have got a collection of APN that weigh almost 14KB memory. The application code will establish a ...
-1
votes
1answer
48 views

Need Help to debug the program for pic 16f877a

I am a starter in PIC and I have done a program in pic c compiler for the following problem When PIC A0 receives an input of more than 4 v, it is converted into digital output and that is fed to a ...
2
votes
2answers
110 views

Program memory question (working dispite insufficient memory)

I am writing this program to a Microchip PIC. ...
1
vote
1answer
90 views

MSP430 printf function executes too slow

I try to use Sky mote (MSP430 F1611 + CC2420) to read the data from I2C sensor with 100Hz sampling frequency and write the data to serial port (USB). I tried a couple of tests and realized that the ...
2
votes
2answers
258 views

Tiny Code for dumping Flash Memory

I'm trying to write as tiny code as possible to extract the firmware of Infineon's XMC4500 microcontroller. The code must fit into a 30 byte buffer which allows me to have 15 machine instructions ...
3
votes
3answers
163 views

What happens when you fall off the end of main() in a PIC? [duplicate]

Another question included this program: void main(void){ TRISD = 0x00; PORTD = 0xFF; } Let us assume that it does exactly what was intended up through ...
5
votes
3answers
90 views

Dump Flash Memory through a single GPIO pin

I'm working with Infineon's XMC4500 Relax Kit and I'm trying to extract the firmware through a single GPIO pin. My very naive idea is to dump one bit at a time through the GPIO pin and somehow ...
3
votes
1answer
97 views

Writing the bootloader program into ATmega32A

I am in a need of programming a bootloader code written in C into the boot section of AVR ATmega32A using a serial programmer. I can't write the code directly into the boot section from Atmel studio. ...
2
votes
1answer
406 views

Writing bootloader for STM32 by C language in Keil

I want to write a bootloader for my MCU. It's an STM32F103RET6. I searched for information about writing a bootloader for it, but I couldn't find anything. Now I have these questions: Where can I ...
1
vote
1answer
67 views

How to connect with and use a USART to USB converter (CP2102 by Silabs)?

I figured since this is a very specific problem with a hardware device that many on SuperUser might not be familiar with, I would try posting here. I searched around on the net a bit and found a ...
1
vote
2answers
172 views

PIC programming - Get value of multiple buttons to a port

I'm learning PIC (pic18f4550) and pretty new to microcontroller programming. I'm trying get value of three button on PORTA and send it to a 8x8 led matrix as X coordinates through a 74LS595. The ...
1
vote
0answers
33 views

MIPI RFFE software implementation

I'm currently trying to implement the MIPI RFFE (As master) protocol on a simple AVR microcontroller, the specs says that the clock frequency can go down to 32 kHz, so I guess this it should be ...
0
votes
1answer
34 views

SCPI OUTput:COUPling command parameters AC|DC

In the scpi-99 standard command reference the command 'output:coupling' is specified as taking the parameters 'AC' or 'DC'. However, this is the first time such a data type is mentioned! Should these ...
-2
votes
1answer
58 views

TMR1 is not incrementing PIC16f877a

I am developing an ultrasonic range finder.I am using PIC16f877a and the compiler MikroC. I am using the CCP1 pin in PWM mode to generate an ultrasonic pulse. This pulse will be reflected back from an ...
1
vote
1answer
77 views

PIC demo board USART

I am trying to create a gps application but dont get good data. I have heard that the most common fault is to use a invalid baud rate but so I have tried to look at it but without success. The PIC I ...
5
votes
3answers
245 views

Strategies for managing code size - PIC18 XC8

I'm new to embedded C development and I'm looking for some general principals/guidelines for managing the size of the generated code. In my specific example I'm using XC8 on a PIC18F4550. My code so ...
1
vote
1answer
151 views

Using interrupts to strobe an LED

Beginner here, just playing around with a devboard using a PIC micro. I am attempting to strobe an LED using an interrupt, I've created the function below within isr.c, INTOSC is running at 4MHz, TMR0 ...
3
votes
2answers
200 views

Could an ARM (ARM7TDMI) Branch instruction take 6 cycles?

I have found an ARM Branch instruction appears to take 6 cycles to run on an ARM7TDMI processor. It seems it shouldn't be happening because in all references I've found, an ARM7TDMI branch instruction ...
5
votes
1answer
191 views

PIC XC8 arguments redeclard

I'm trying to get to know my PIC with simple 'start-up' projects. I made a LED flash with a button. I made a BCD count up from 0 to 9 with a delay. Now I want to combine those two and also refractor ...
3
votes
1answer
80 views

Does MPLAB X have a call-graph analysis tool?

I'd like to start understanding how deep my microcontroller's stack goes (even if it's only an estimation). How can I do this using MPLAB X?
0
votes
1answer
100 views

Writing to FSMC is extremely slow

I have an ARM Cortex M3 STMF32F103VE http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00191185.pdf, and I'm using an LCD with ILI9320 controller ...
1
vote
2answers
93 views

Dynamically Configure FPGA From Host Program

I was wondering if anyone knows an efficient way to program the FPGA(PL) for a Xilinx Zynq-7 series or related devices,from a host C program (not on the SoC, but from the host PC). Is there an Xilinx ...
0
votes
0answers
86 views

MODBUS WRITE COIL opearation

I am trying to perform write coil operation.In below code i can read data But i could not able to performs write operation. SInce my code size is big i am pasting part of code. Give me simple example ...
-1
votes
1answer
181 views

MicroC rs-485, pic16f887 String sending problems

How can I send the string "test" from a master pic to a slave? I'm using MicroC RS-485 library example: http://www.mikroe.com/download/eng/documents/compilers/mikroc/pro/pic/help/rs-485_library.htm ...
1
vote
1answer
105 views

How to read configuration bit register from PIC?

I'm debugging and want to inspect CONFIG1H (CONFIGURATION REGISTER 1 HIGH) of a PIC18F. CONFIG1H does seem to be recongized as an SFR when I enter it into the Watch window. After stopping at ...
0
votes
1answer
183 views

How are state machines used in electronics?

It seems to me the use of state machines is just in logic circuits, is that correct? If not do they have other uses, such as say in microcontroller programming? I'm quite new to the subject and wonder ...
1
vote
1answer
366 views

3 wire load sensor connection to INA125P

I am trying to use a 3 wire load sensor, connect it to INA125 for voltage amplification and then use the amplified output to be fed to ADC of Arduino. I had used below configuration with INA125. ...
4
votes
3answers
255 views

Calculating time spent by a function in Microcontroller Applications

I would like to write a simple profiler for my STM32F100VE microcontroller. I have seen that I can include time.h and based on the c standard functions I can use it, but I was confused about ...