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
30 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 ...
0
votes
1answer
30 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 ...
-1
votes
1answer
120 views

How are state machines used in electronics? [on hold]

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 ...
0
votes
0answers
28 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
167 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 ...
0
votes
1answer
37 views

ATMega328p SPI with MCP41100 digital pot

I'm trying to communicate with a MCP41100 over SPI using an ATMega328p and can't seem to get it to work. Here is the code I found, can anybody see what I'm doing wrong? ...
1
vote
0answers
61 views

Float calculations hangs on Kinetis K20 (arm-m4-no-fpu) when PWM interrupt is on

I will use this ARM to control Induction Motor with three-phase inverter. When the program encounters any float operations, like simple plus operation, the system hangs but the pause of debug works ...
0
votes
1answer
85 views

What must be done, a new design?

I tried to compile a TCP / IP project for the MicroC / OS II RTOS with an Altera DE2 and a .sof design. I can run the MicroC / OS II with other apps but when trying ...
0
votes
0answers
49 views

Writing a framebuffered driver for ILI9230 LCD Controller

I'm using STMF32F103VE to control an ILI9320 LCD Controller, the datasheet is here: http://www.gpegint.com/files/library/files/supportpdf/ILI9320.pdf I have problems of copying the framebuffer ...
0
votes
0answers
24 views

Can't read the SPI buffer of a PIC32MX

I have some problems with my SPI communication. Indeed, I have configurated the PIC32 as master, and it communicates with a slave which is a memory. The communication works perfectly. LEGEND : In ...
8
votes
7answers
2k views

Why is printf() bad for debugging embedded systems?

I guess it's a noob thing to try to debug a microcontroller-based project using printf(). I can understand that you have no predefined place to output to, and that it could consume valuable pins. ...
0
votes
1answer
13 views

ATXMEGA128A4 and bluetooth BTM-331

I have some questions regarding atxmega128a4. I want to use all of its 5 uart modules but my very basic problem is that I do not know what are the pins for RX/TX. I have read in manual but I cannot ...
0
votes
0answers
55 views

WS2812 with ATtiny5 Microcontroller Code

I'm having problems with driving a single WS2812 driven LED. I'm using a much more compact version of the code here which is basically I just put in the methods I need and put it all into one file ...
1
vote
1answer
95 views

Hi tech c adc code not working as expected

I am new to using PIC micro-controllers, and I am working on a project that involves reading an analog value. I am using the PIC16F877A. I have found code for using the ADC posted below however when ...
3
votes
2answers
92 views

Scripting to automate projects with microchip tools

IDE: MPLAB IDE 8.87 Compilers: C30/ASM30 Debugger/Programmer: MPLAB ICD 3 Windows 7 Question: I have utility projects such as clearing an EEPROM on custom hardware, retrieve data from an IC, and so ...
-1
votes
1answer
70 views

PIC18F4620 ADC Conversion

I'm in need of help in understanding how to code ADC conversions for the PIC18F4620. If someone could provide an example code with comments that would be great. Also if someone can explain to me how ...
1
vote
1answer
168 views
+50

Hacking a four load sensor based personal weighing scale

I am trying to hack a personal weighing scale.I had taken help of this tutorial but the language used in this is not very easy to understand due to the non-standard naming used for load sensor wires, ...
0
votes
1answer
135 views

LED glows on low port is set to 0?

I have an Arduino UNO board with a ATMEGA328-PU and am trying to control the LED on output 13 that is on the processor pin B5. I have a switch connected on the Arduino port 7, which is on the ...
2
votes
1answer
54 views

Reading to PIC32MX's memory in C and XORing big sets of data

I have a project in which I have 102 8-bit PISO shift-registers in daisy chain configuration and they are outputting to a common SDI line connected to a PIC32MX controller. There is a total of 816 ...
1
vote
2answers
215 views

Arduino Pin value gets stuck

I'm using a Python program to send some message over serial port to Arduino. This message contains the pin number of the pin and whether it should be HIGH or ...
3
votes
4answers
229 views

TRUE/FALSE or true/false?

In resource-constrained systems (like an 8-bit PIC), is there any benefit to using your own macros for true and false as opposed to using those defined from stdbool? ...
2
votes
2answers
34 views

Not getting input on STK600 with ATmega8515

I recently had a written exam for a class and one of the questions was to write a program for the ATmega8515. I wrote down this: ...
4
votes
3answers
276 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
2answers
141 views

STM32F4 - Digital Signal Processing ( DSP )

At this website, I have read that STM32F4 microcontrollers have DSP instructions. To quote: It also implements a full set of DSP instructions I am beginning to learn embedded C programming with ...
4
votes
3answers
358 views

STM32F4 - Floating point unit ( FPU )

I would like to know, what is the purpose of the special FPU unit, that is advertised with STM32F4 microcontrollers ? To quote this website : " The Cortex-M4 core features a Floating ...
2
votes
1answer
96 views

PIC for ENC28J60

I am beginner in the microcontroller world, I started to work with PIC MCUs and writing simple programs in assembly. I am interested in simple controlling via LAN (such as switching LED on/off). I've ...
3
votes
0answers
118 views

Using C++ in resource constrained environments [closed]

In the past I've been using C (or ASM) to develop microcontroller firmware. It's what I learned during my EE studies. It seems though, that the job market here has a high demand for C++ developers in ...
1
vote
2answers
197 views

Algorithm for finding next data in eeprom [closed]

I have an EEPROM and I'm storing data in it, from address 0x00 to 0xff. I have to scan the EEPROM regularly for non zero values. ...
1
vote
2answers
63 views

serial communications and on/off voltages

I'm writing a program in C to talk to a modem via an rs-232 serial port. Unix supports 6 pinouts in the serial line, including TXD (Transmitted Data), RXD (Received Data), DCD (Data Carrier Detect), ...
1
vote
2answers
62 views

PIC output is high before being set high automatically

I am creating a simple pic project that uses a PIC16F877A and I have noticed something that seems odd. Before using any code to change the state of the pins connected to port b, the port b pins are ...
2
votes
5answers
191 views

Measuring firmware performance

I am using C compiler and PIC controllers. I've been wondering about measuring the performance of the f/w code that we write. I have two versions of structures for the same code: First one: using ...
13
votes
6answers
1k views

Use of global variables in Embedded Systems

I started writing firmware for my product and I'm a rookie here. I went through many articles about not using global variables or functions. Is there any limit for using global variables in an 8 bit ...
8
votes
5answers
379 views

What tools or standards can be used to improve embedded C code reliability?

I typically program PICs in C, usually for switched-mode converters. I've heard of various static analysis tools and standards like MISRA C that can be used to help improve the reliability of code. ...
1
vote
1answer
118 views

Understanding Program Size - ATMega328P

I am interested in finding out the memory usage of my code running on an ATMega328P (16 MHz) using the avr-size utility bundled with WinAVR 20100110. Using the ...
0
votes
3answers
204 views
1
vote
2answers
608 views

Best practice to keep main() in embedded systems

I would like to know one thing about keeping the main() in embedded coding practice. I have a stand-alone system that have n ...
1
vote
2answers
146 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 ...
2
votes
2answers
116 views

Allocating more memory Space in controller

Chip: PIC18f26j50 Compiler: C18 My objective is to store values in a table in the RAM memory using structures and feed in the values which are quite large. ...
0
votes
3answers
409 views

Interfacing Keypad to PIC16F877A

I am interfacing a 3X4 keypad to PIC16f877a uC on PORTD as: In the first half of the C program I have set first four pins to Input (From LSB-RD0) and others to Output and store the value in a ...
4
votes
2answers
257 views

Implementing Control Commands for an MCU over Serial

Im looking to integrate a command interface in a project that im making that will accept commands overs serial from a PC. The idea is that the device will do its thing but it gets sent a command, it ...
1
vote
0answers
122 views

MAX7219 interfaced with ATmega128 producing strange results on 7 segment display

I have built a circuit using an ATmega128 interfacing a MAX7219 decoder to control a 7-segment display. I would appreciate if anyone could help me figure out a problem I'm having with my setup. I am ...
2
votes
2answers
102 views

How does the Array allocated in the stack?

I was testing the code below on my STM32 board, but I could't understand how the array was being allocated in the stack. I'm assuming that there are 200 bytes of memory in STM32. Here is the code: ...
0
votes
0answers
43 views

ppc405 communication with custom ip ml403

I am trying to simulate a chemical reaction in FPGA. My basic FPGA architecure consists of 3 processes: ...
1
vote
2answers
122 views

Bit-banging a ShifBrite led driver with a PIC

I am having problems making communicate a Shiftbrite A6281 led driver with a PIC18F4550. What I am trying to do is to send the RGB values to the driver in order to select the color of the led, but I ...
-2
votes
1answer
59 views

Static Parameter in Pic32 [closed]

I am developing for Pic32 platform. I want to know how I can declare static parameter knowing that this parameter will be used all over the file in my application. I have tried using static like this: ...
2
votes
4answers
129 views

sense movement of muscles via electronic signals

I'd like to sense when a certain muscle is contracting or releasing, for instance the movement of one finger over another. Is there any existing work to do this with sensors / arduino / galvanic ...
0
votes
0answers
154 views

MPLAB X WITH PROTEUS COMPABILITY

I will use MPLab X to program a PIC using C and test it in a Proteus circuit. I have installed MPLab X v1.95 with Proteus8 ...
1
vote
1answer
120 views

MSP430 Coding, Can I Place an Interrupt Vector Inside a Function?

As the title said, I am trying to see if an Interrupt Vector can be embedded inside a function? I am using IAR, but gcc or ccs would work too. I don't see it done in any code online. Example: ...
0
votes
2answers
76 views

PIC 24F VGA array addressing instructions

In order to make a VGA driver for a PIC 24F microcontroller, I am generating an interrupt creating a VSYNC pulse, followed by a loop that puts data to the ports. HSYNC pulses are calculated after this ...