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

5
votes
5answers
464 views

What language do microcontrollers use apart from C?

I want to start making devices and I read about microcontrollers and other stuff on the Internet. I wonder if there are other languages to program microcontrollers with in addition to C.
0
votes
0answers
52 views

Cortex M3 delay 1us

Im trying to achieve 1us delay to be able to drive 1-wire bus. My proc is working on 10Mhz PCLK so I tried to use timer function with overflow on 10th cycle. For some reason it gives me resolution of ...
1
vote
1answer
50 views

RTCC Peripheral, PIC24F16KA102, Problem accessing values

Minimal Peripheral Description To read the values from this particular RTCC peripheral you have to read the data from a single register(RTCVAL), where the information it represents is dependent on a ...
-1
votes
0answers
38 views

Simple program in c, its my first one.. I need some help [migrated]

Here is my code: This is supposed to output values for area and circumference, with area = to about 113 and circumference 37 something. That aside, my output is showing incorrect values, area ...
2
votes
3answers
87 views

'bit' type for AVR Microcontroller programming

I have written a code for 8051 microcontroller, where I used bit type, something like this: ...
4
votes
2answers
203 views

LEDs not working, Simple :)

Objective I am trying to change the state of a pin on the PIC24FV16KA304 depending on a button press. Initially the pins are set as inputs, upon a button press the pins change to an output with a low ...
2
votes
1answer
83 views

Why UART Interrupts are not working properly in dsPIC?

Hello I am working with the UART1 module in a dsPIC33FJ128GP802 but it is not working as expected using XC16 compiler. Here is my initialization code and interrupt routine, the ...
5
votes
1answer
76 views

L3G4200D random spikes

I've searched this forum a bit in regards to the L3G4200D gyroscope, and haven't seen this problem mentioned, but I have seen others talk about it on other forums. I am seeing a strange large value in ...
0
votes
0answers
16 views

How do you implement timers on MSP 430 5528 using the help of an implementation for MSP 430x26x?

I have followed GINA Mote instructions from this page: https://openwsn.atlassian.net/wiki/display/OW/IAR and I was able to successfully able to build and run 01bsp_radio.c transmit project. I ...
0
votes
0answers
82 views

Any simplified diagram explanation of how CPU works? [duplicate]

I'm a high level Java developer. My major is Information Systems. However, my internship subject is in embedded systems programming by C, about which I have no idea. Trying to study about it, I ...
0
votes
1answer
45 views

ADUC7024 UART not working

I am currently working on getting my ADUC7024 (ARM7) microprocessor to communicate with me via UART/RS232. I have tried everything and I'm getting really desperate especially since the provided ...
0
votes
1answer
51 views

PIC32 stuck after long time

I am using a PIC32MX795F512L which sends CAN messages to a WiFly module (RN-171) using UART. I receive messages over WiFi but after a longer time (20-60 minutes), the PIC seems to be stuck and I have ...
0
votes
1answer
74 views

read from serial buffer

I am trying to interface a dsPIC33EP chip with a RS232 device at baudrate=460800. My code works OK but I think there must be a better way to do this. Here is the code: ...
1
vote
2answers
92 views

How to program PIC 12F629 internal oscilator in C?

I have some troubles understanding the datasheets when comes to use the internal oscilator in a PIC 12F629, using C (MPLAB X IDE + XC8 compiler). Also I don't have any PICKIT or anything, I use a DIY ...
0
votes
0answers
30 views

How to change PORTX register in other place of program?(Codevision & GCC)

i have a question about GCC and CodeVision: How can i changing PORTX register in other place of program. as you know, normally we setting it at Main function inside DDRX rigester for example like ...
0
votes
1answer
88 views

local variable resets to zero

I have a problem with below code. The variable loopTimes get reset to 0 after one loop. The program also has a ISR routine for TWI interface which updates the value as shown in the below code. ...
0
votes
2answers
86 views

Set Output Port High Low

I'm using MPLAB to compile a program in C using the CCS compiler. I want to set an output port as high or low using defined ports. #bit portOut1 = PORTC.0 So, I ...
2
votes
1answer
72 views

Can't write more than one byte to the SST39SF010A Flash!

I use code composer to program the TMS320C31 DSP (through MPSD) to write to the SST39SF010A flash. I can successfully write one byte to any location of the flash by following the "Chip Erase" then ...
0
votes
0answers
47 views

How can i port this Lib(ProGFX) to CodeVision(compiler)?

i want to port this library to CodeVision(compiler). http://progfx.org/ How can i do it?
-1
votes
1answer
77 views

which books should i refer for embedded systems? [closed]

i am in second year of mechanical engineering and i want to learn about embedded systems and to program them.from where should i start? which books to refer? is it possible to learn it without any ...
2
votes
2answers
147 views

Memory management problems with ATTiny85

The setup is as follows: I have a little program to drive single color 8x8 led matrix using 595 shift registers that are supplied with data by ATTiny85 through USI as SPI Master. I upload program to ...
1
vote
1answer
57 views

arduino-tiny: change TIMER_TO_USE_FOR_MILLIS from sketch

In the arduino-tiny core, is it possible to change TIMER_TO_USE_FOR_MILLIS in the sketch itself? I want to be able to leave my arduino-tiny install stock but swap the timers just for one sketch. ...
3
votes
1answer
72 views

FreeRTOS queues and IPC confusion

I'm struggling with my first real freeRTOS project. I am basically using an ATmega328P microcontroller and an nRF24L01+ radio as a "node". I have two of these nodes and I am using them to talk to each ...
0
votes
0answers
36 views
0
votes
1answer
132 views

interfacing pic184f450 with 16X2 lcd in four bit mode?

I am working on interfacing 16X2 lcd in 4bit mode with pic18f4550.The higher 4 bits (D4,D5,D6,D7) are connected to PORTA1,A2,A3,A4 , pin RAO as RS, RE2 as RW, RE3 as RE3. i am struck with below code ...
-3
votes
4answers
150 views

how to access the bit fields of an registers in microcontroller

I am working with PIC18f4550 micro controller . i have connected a lcd in 4 bit mode to port d<1:4> pins .So how can i send data only to the 4 bits of port d <1:4> register without affecting ...
3
votes
1answer
142 views

UART is garbled when running at more than 9600 bps

I'm connecting 2 MSP430F5529-based boards (running at 1 MHz) using UART and MAX3232 (MSP430F5529 -> MAX3232 -> cable, a few cm long - will be longer in our final application -> MAX3232 -> ...
2
votes
3answers
241 views

Arduino Code - simple if, else statement?

Basically, I have two led lights connected to pin 2 (led 1) and pin 3 (led 2), and I want led 2 to light up every time led 1 lights up, and turn off every time led 1 turns off. My code: ...
4
votes
3answers
274 views

How to cut interrupt code to minimum?

I have some interrupt let's say from UART to make a real example: ...
1
vote
0answers
71 views

Sdcc linker error "could not get183 consecutive bytes in internal RAM for area DSEG

I am trying to interface micro sdcard with P89V664 using Petit FatFs. Petit FatFs link http://elm-chan.org/fsw/ff/00index_p.html. Chan's Petit FatFs sample port are available at ...
1
vote
1answer
104 views

How to get 10bit data of ADC using SPI protocol

I am doing Single master multiple slave implementation. Master - PIC18F4550 Slave - PIC18F4520 A potentiometer is connected to the Slave. Slave will convert the Potentiometer value to digital and ...
3
votes
1answer
178 views

find TH1 in AT89s52 micro controller in serial communication

I want to establish serial communication between an 8-bit microcontroller, AT89S52, and a PC. I am using a crystal oscillator of 8 MHz frequency. For baud rate calculation I have used the following ...
0
votes
1answer
104 views

Calling ports in C on my microcontroller

I have been developing a small OS for my lpc1313fbd48. I am sending all of the C and assembly code in a binary file. I want to be able to call the ports in C and have an LED turn on for a few seconds ...
0
votes
1answer
56 views

Cortex M3 (ATSAM3N4B) Peripheral DMA read from SRAM ok, FLASH fails

I've stumbled across a peculiar problem with my PDC (Peripheral DMA Controller) where using the PDC to transfer a constant string from flash over UART 0 seems to produce an unexpected result. The ...
-4
votes
3answers
166 views

Using array as global variables in IAR (STM32) [closed]

I have defined a global array in main.c: __IO uint8_t data[3]={0,0,0}; then, I extern and assign vlues to this array in another c file: ...
0
votes
1answer
98 views

IAR errors about extern and global vriables

I want to get values of a global array in a c file. the print screen of code is shown below: 'data' is the global array and 'slave_buffer_rx' is another global array defined in this file to get ...
0
votes
0answers
140 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 ...
2
votes
1answer
66 views

Searching for standalone unix development board to connect DC motors

I though a bit about the board and came to the conclusion that it may be more intelligent to use a stand-alone component which provides serial ports and an unix os which I then can control over the ...
0
votes
0answers
135 views

SPI interfacing between FTDI and Lattice FPGA

I am trying to establish SPI interface between FTDI FT2232H and Lattice MachX02-1200ZE. The following code for this purpose compiles successfully and the last SPI_ReadHiSpeedDevice() function returns ...
0
votes
1answer
45 views

How to know which element replaces which for a cache?

If I assume that the first element of the matrix that is fetched to the D-cache is a[0][0], for associativity 4, please tell me which element in which matrix that ...
1
vote
2answers
878 views

Creating a lookup table in a microcontroller using in C

How can I create a lookup table in a microcontroller using C? I have one input and one output and want to implement a lookup table in C.
2
votes
1answer
523 views

Problems using Servo.h and VirtualWire.h in arduino

I'm using an Arduino Uno. My motive is to control a servo via wireless transmission using RF. So for that I have to use both Virtual Wire.h and Servo.h. But when I am compiling it shows me errors that ...
2
votes
1answer
166 views

How to calculate the modulation register for MSP430 UART?

I'm using a MSP430F5529 clocked at 1 MHz and want to use the UART at 9600 bauds. So far I did: ...
1
vote
1answer
78 views

Difference between SMPEND and SMPMID

I'm interfacing an SPI chip with a PIC18 device, programmed with a C program compiled with the XC8 compiler, using libraries from plib.h. In the docs, I read: ...
0
votes
1answer
125 views

PIC32 Issue with using JTAG Pins as Analog Inputs

I'm trying to read in a value using a few analog pins on a PIC32 (MX775F512H), including RB12-- part of the JTAG pins on the device. The device the board is reading from works great, but the board ...
0
votes
1answer
59 views

Shifting between PWM options

I'm using a Freescale MC9S08DZ60 microcontroller, and Ive written the code for applying PWM on a specific pin.'This is an attempt for Breathing Effect of LED, a question i had already asked - LED ...
2
votes
2answers
174 views

ExternalDifferential ADC Values for PIC

I have a temperature sensor design that I'm using as a reference. It takes 2 RTD sensors and reads their values with a Dual Channel 16-bit Differential ADC. The ADC interfaces through the SPI bus. ...
2
votes
2answers
206 views

Understanding volatile class fields in AVR C++ programs

I'm having some confusion about what members to declare volatile in a program I'm writing in C++ for an AVR microcontroller, with interrupts. When it's plain C it makes sense - the compiler doesn't ...
14
votes
1answer
385 views

Sine signal generation using PWM

We are unable to generate a sine signal properly using a MC68HC908GP32 microcontroller. PWM description begins in page 349. Clock frequency is 2.4MHz, while we have used 7 kHz PWM by using the ...
0
votes
0answers
258 views

stm32f2xx external clock source for timer

I trying to use a timer with an external clock source on a stm32f207ZE microcontroller. But it isn't working. Here is my code: ...