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

PIC18 DELAYTCY parameter problem

I want to set a delay of 1s, I set internal oscillator with 4MHZ, so TCY = 4/4MHZ = 1us so one second = 1us * 1000 000 so Delay10KTCYx(100) means delay 10kilo * TCY(4/4 = 1us)*100 = 10000*1*100 = ...
0
votes
1answer
20 views

PIC18 how to explain : you write bit 1 by making TRIS input

I'm reading 1_wire header file for PIC18 with C18 compiler. in the write_byte function, they specified that in order to write bit1; we make line input and that will take it high. can we specify high ...
0
votes
3answers
71 views

Pointer to an Memory Address of Flash Memory

I think that the following question is simple, but it is important for me to know. I am working on microcontrollers. I have seen some code to access the data from the flash memory. For example in ...
0
votes
0answers
21 views

CAN BUS Acknowledgment error

I am using STM32F429 CAN bus Program with TJA1041A as CAN Transreciver.The Problem is the messages are not getting acknowledged and herewith I am attaching the code for further reference.I am using ...
0
votes
1answer
48 views

How to send a buffer with spi

I use an atmega32 and I want to use the SPI bus. I have the Adafruit 24 channel, 12 bit pwm led driver. I use a buffer to set the pwm for a certain channel. The question is how to send the whole ...
0
votes
0answers
20 views

Best way to send data from Intel Galileo to Dropbox Datastore? [closed]

I am developing a project using Intel Galileo board. I would like to send some data to Dropbox Datastore. I found out that there are two way to do this - one using html and curl and second using ...
-4
votes
0answers
69 views

integer promotion rules in C [closed]

Can anybody tell what will be the output of below function and why? Please explain in brief which integer promotion rule will be applicable here. Thanks. ...
0
votes
0answers
16 views

Reading Mac data of Zigbee protocol stack

I am working on a project using one of the popular Zigbee based RF-MCU Mac-codebases. I have integrated a sensor to the MCU and the same is reading data and I am sending data to the gateway using the ...
-4
votes
0answers
62 views

How to implement CAN Bus Communication using STM32F429? [closed]

Does anyone have any ideas abou implementing a CAN Bus communication with a STM32F429 MCU? I am looking for any references regarding CAN Bus regarding this microcontroller.
1
vote
0answers
48 views

Making a program that sends data to USB port [migrated]

I want to create a program that is able to communicate to the USB port on my laptop. From this program I want to send data to the USB port constantly. Basically something like a hyperterminal, but ...
1
vote
0answers
73 views

Missing clock edges when using SPI on the CC430

I'm currently using the CC430F5137 and I'm having an issue with using SPI to communicate with an external flash. I'm currently using DMA to send out SPI comms using the UCSI_B module. Most of the ...
0
votes
1answer
65 views

MPU6050 I2C PIC18F458

I'm using MPU6050 with PIC18F45 protocol I2C. On EasyPIC v6 board its just send me back anything that I put in this WRITE command I2C1_Wr(0xD3);. I replaced the ...
1
vote
2answers
201 views

Why using a pointer interfacing LCD HD44780

I'm trying to interface with an LCD display (HD44780). I came across a tutorial on the internet to send characters and strings to the display. Everything went well and it works fine but I have no idea ...
0
votes
2answers
65 views

Choice of the appopriate conditional statement

I'm measuring the width of a PWM puls with the external interrupt: ...
1
vote
0answers
48 views

BH1750FVI with I2C won't work

I have the led driver of Adafruit connected to my atmega32. I adjusted their library for the Arduino, so now I just need a µcontroller and not an Arduino. This thing works. Now I want to control the ...
0
votes
1answer
54 views

MPLAB X IDE on computer emulation / debugging how to set input values?

Is there any way I could emulate input into chip using the free emulator, when debugging my code to see if it responds correctly into input?
0
votes
3answers
93 views

Is it Electrically Correct to Direct Driving Seven Segment in Multiplexed Manner?

I want to design a voltmeter with minimum no of components so the pcb becomes as small as possible.For this purpose i wish to direct drive the seven segment display. Considering the fact Typically ...
0
votes
1answer
59 views

Different data type volatile unsigned int to const char ,

I have to reply via SMS the value of a variable if the password is sent to arduino by help of sim900. I am able to switch an led on successfully. Now I want the arduino to reply to me the variable ...
0
votes
1answer
54 views

How to display character on multiplexed seven segment?

I am designing a system which I want to display a message on a seven segment display. I have the source code for displaying a number but how to display a character ?? ...
0
votes
1answer
95 views

PIC - 4-20mA (Duty cycle formula)

I am implementing a 4-20mA current loop to my PIC. I have everything working. I am measuring the distance away from an object. When I hardcoded the distance as 300 the output voltage is 4V and when ...
1
vote
1answer
79 views

External interrupt doesn't set flag bit

My goal is to measure PWM pulses. But to achive that I'm making baby steps, so my first goal is to set a pin when an edge of the PWM signal is detected. The PWM signal enters the microcontroller ...
1
vote
1answer
64 views

Compilers for STM32F303x [closed]

Does anyone have any suggestions for C/C++ compiler/debugger for this chip, initially via ST-LINK on a Discovery board? I am currently using IAR EWARM but am not particularly happy with it.
2
votes
2answers
330 views

Best method to transfer two int percentage values over a CAN bus

I have two integers: int A is a value from -100 until 0 and int B is a value from 0 to 100 What is the most effective way to put this into a CAN message and decode it again at the other ...
0
votes
1answer
56 views

libmodbus trouble with reading from slave

I have the following code for connection to a temperature sensor as my slave using the libmodbus library in C, ...
0
votes
2answers
89 views

Blinking LEDs in reverse order

The code below flashes some LEDs in order: pin 1, pin 2, pin 3, pin 4. After this sequence has completed I would like to reverse direction and show pin 4, pin 3, pin 2, pin 1. I wrote the code ...
0
votes
2answers
32 views

Need help with pushbutton on atmega8

This is what I have: Atmega 8 wired for programming, confirmed working, programmer is my power supply. 2 leds connected via 470Ohm pull up reisistors to ports PORTB0, PORTB1 and to GROUND, working. ...
0
votes
1answer
71 views

ATmega8 LED blinking project not working properly

I am making a simple project using ATmega8 microchip. I uploaded this code to the AVR: ...
0
votes
1answer
63 views

Regarding configuartion of 50kg load sensors with arduino due and 8-pin LM741CN Op-Amp

Please don't mind if my question is naive. I am new to this thing but I am pretty much interested in playing with these sensors. I am trying to configure the 3 wire load cell/strain guage (50 kg ...
1
vote
2answers
58 views

Set function to specific address in PIC18F with the HI-TECH C compiler

I want to put a function in an specific address of memory like PIC C Compiler (#org). I'm using MPLAB X, HI-TECH compiler and PIC18F4550. In PIC C compiler: ...
0
votes
1answer
44 views

AVR TIMER0 treating with prescaler and without to blink a led

I am playing with ATMEGA168A's TIMER0. CPU is running at 20MHz and there are two treatments. a) Blink a LED at 20ms frequency by using a 1024 prescaler. In that case i count the the times that an ...
1
vote
2answers
110 views

ATMEGA328p ADC keeps returning 1023

I'm trying to configure my ATMEGA328p to measure temperature using the TMP36GZ temperature sensor. However, the 10-bit ADC keeps returning 1023. I've tried disconnecting the temperature sensor (it ...
3
votes
1answer
79 views

Problem in writing register maps using C structure for a TI Microcontroller

I am writing register maps in C for a TI ARM based Micro-controller board. Here is the link to the datasheet. I am using the following guidelines on how Register maps should be written in C: ...
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
1answer
59 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
45 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
75 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
55 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
136 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
69 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
108 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: ...
1
vote
1answer
77 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
64 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
76 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
91 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
36 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
90 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
42 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
147 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
29 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 ...