Tagged Questions

PIC is a brand of 8, 16, and 32 bit RISC microcontrollers manufactured by Microchip. "PIC" originally was an acronym for "Peripheral Interface Controller".

learn more… | top users | synonyms (8)

0
votes
2answers
63 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
0answers
42 views

battery charger using pic [on hold]

i designed a 6V battery charger powering from solar panel. I'm using pic16f73. The whole circuit is powering from either solar panel or 6V battery itself. Battery voltage and panel voltage are ...
1
vote
2answers
37 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: ...
-2
votes
1answer
77 views

what should i use? [on hold]

I wish to design a circuit that uses one button to turn on a multi-color LED to a preselected color, and then uses repeated button presses of another button to cycle the LED through 2 or 3 colors. In ...
2
votes
1answer
77 views

PIC18 not working when wiring 30pf capacitors of cristal resonator to ground

I'm using pic18 with external oscillator 16MHZ 16M HZ HC-49S Crystal Oscillator with two 30PF capacitors configuration OSC = HS using breadboard, when wiring the ...
4
votes
2answers
363 views

Fastest time a PIC can set and clear a pin

What is the fastest time a microcontroller (PIC16 in this case) can be set and cleared? It is defined by the frequency, but I don't know the formula to calculate the fastest time that a single pin can ...
0
votes
0answers
27 views

Trying to start i2c communication on dspic33fj128gp802, but I cannot write on the SEN bit of the I2CxCON register

Good evening, I was trying to start the communication with the I2C on my pic. I only set the bits in the control register in the code for now and the inizialization of both the pins and the PLL, and I ...
2
votes
2answers
83 views

What is __bit in the XC8 C compiler?

Let's take an example: extern volatile __bit TRISB0 @ (((unsigned) &TRISB)*8) + 0; I believe this is pointing TRISB0 to ...
1
vote
1answer
66 views

PIC32 does not get UART RX interrupts in xc32 Compiler

I'm trying to setup a UART channel on my PIC32 MCU (PIC32MX470F512). But the code does not reach the ISR at all. I have verified that the PPS (peripheral pin select) is configured properly and the ...
2
votes
0answers
47 views

PIC12F ADC conversion has an unwanted offset

The current setup is shown below. PIC12F1822 with a 10-bit ADC. I'm using a 250R 0.05% precision resistor to get a nice 0-5V input to the analogue pin (AN2 if it matters). As far as I can tell I ...
0
votes
1answer
39 views

PIC16F57 - problem implementing wake up signal on key stroke

I have designed a simple RC5 remote control using a PIC16F57 and the classic rows-columns scan over a 4x4 matrix keypad. The previous version of my firmware continuously scanned the keypad to find a ...
1
vote
1answer
380 views

HDD Motor Spinning

I'm trying to run a hdd motor using the following link. http://theamateurprogrammer.blogspot.hk/2014/02/revitalizing-old-hard-drive-motors.html Instead of using Audrino I'm using PIC16F73.I tried to ...
0
votes
1answer
33 views

Simple PORTA Control via PIC

I am trying to setup a simple blinking LED on a PIC18F25K50. I can get RA0 to toggle using LATAbits.LA0 = ~LATAbits.LA0; However, if I try to use ...
0
votes
1answer
40 views

Trouble holding MCLR line low for PIC ICSP, ICD3 works, hardware defect?

I have an ARM Cortex-M3 that talks to a dsPic33F. I am attempting to do ICSP programming of the attached PIC. I have an analyzer and can see that I cannot control the MCLR line the same way the ICD3 ...
1
vote
3answers
67 views

What is the difference between debug mode and normal execution on dspic?

I have a dspic33fj128mc802 microcontroller. I am using mplabx and xc16 compiler. I have my internal oscillator set up to 80MHz. I have managed to setup FreeRTOS on the device and everything compiles ...
1
vote
2answers
70 views

How to find duty ratio of a PWM using input capture?

I have a controller PIC18F and it supports input capture peripheral. I understand it can be used to find the frequency of the incoming signal. How can the duty ratio of PWM can be obtained from the ...
0
votes
3answers
76 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
60 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
48 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 ...
0
votes
4answers
77 views

Wiring up an LCD display with unknown controller

I found an old LCD in my pile of trunk. I would like to be able to use it. However, someone (possibly / probably me) sawed off the part of the PCB with the series code, so I can't know what the ...
1
vote
3answers
80 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 ...
1
vote
1answer
68 views

When setting pin as input it getts pulled high, why?

I've hooked up a push button to GP1 and a LED to GP2 on my PIC12F683 and this is my code: ...
0
votes
1answer
28 views

Unexplained behavior pic port b on change interrupt

I am trying to configure the port b interrupt on change interrupts to work with a program I am writing with MC XC8 demo version. I am using a PIC16F628A I am using this code to initialize the pic for ...
0
votes
1answer
95 views

Best microcontroller for industrial applications [closed]

I have an industrial project requirement to build a device having this functionality: Store Data Send Data to Web Server Device to be placed under scorching sun Sensors - around 5 A Graphical ...
1
vote
1answer
50 views

Using GPIO mode in SIM908

I'm working on a SIM908 module using GPIO mode (my rx pin contact is lost when soldering). I have interfaced it with a PIC16F73 and while using GPIO mode I'm not getting any response. I have included ...
1
vote
2answers
69 views

Catch both sides of a clock change PIC interrupt

I am trying to build an IR remote receiver using a PIC16F628A. To do that, I need to catch both the falling and rising edge of the external interrupt pin. From the datasheet it appears you can only ...
3
votes
1answer
106 views

PIC16F628A Blinking LED

I was setting up a PIC16F628A for a simple Hello World program (blinking LED) and somewhere in the process, I have failed. The LED stays lit at the specified pin and does not "blink". I am using the ...
0
votes
1answer
71 views

SD Card Access Library

I am accessing my SD card using SPI. But I've found this to be slow and I am also sad that when there is a faster protocol already supported by my SD card I am using a slower version. Is there a C ...
0
votes
0answers
67 views

Generating and measuring PWM

Description of the main part of my project: A microcontroller should read 4x PWM channels, that come from a RX1. The frequency of the PWM signal is fixed (about 50Hz), the high time of the pulse is ...
2
votes
2answers
81 views

Digital out, output low voltage, no load

I'm controlling a home-built current regulator, using a PIC microcontroller (PIC12F1572). The regulator is implemented using an op-amp and mosfet, and works well. The input to the regulator is a ...
0
votes
1answer
60 views

Gettinc MCLR error in Proteus on PIC18 in a really simple circuit

I'm simulating this circuit below in Proteus 8.1. It basically consists of a switch that, when pressed should send a signal to port A, and then port B should light a LED. I am using PIC18F4550, and ...
1
vote
2answers
330 views

PIC18F2550 Loop Counter Overwritten by sprintf

I have the following code compiled with Microchip's MPLab and XC8 compiler and running on a PIC18F2550 which is doing something rather odd: ...
0
votes
3answers
121 views

Microchip PIC - How to recover the context saved in interrups or disable the automatic saving of the context?

I'm building a dispatcher for PIC microcontrollers to switch tasks saving their contexts. The dispatcher is triggered when an interrupt occurs. The problem is that the compiler I'm using (C18 V3.x) ...
0
votes
1answer
99 views

PIC resets when motors work

I'm using a PIC18F452 in my project, and L293d for driving motors. I'm using two completely separate power supplies for driving motors and driving the PIC. completely separate two power packs. a 12 v ...
1
vote
2answers
103 views

Microchip XC8: How to Overlap Specific Variables without Union?

I have effectively three sets of variables to put in two locations. Sets 1 and 2 are never used together, so they can occupy the same space. Set 3 needs to be unique. I know I can use a union of ...
1
vote
4answers
190 views

Function Pointer in C Language

I'm facing a little problem with function pointers in a code for the microcontroller Microchip Pic 18 Series. The code below shows the prototypes of the functions involved in the problem and a call ...
0
votes
0answers
45 views

pickit3 connected to pic18f4550

I am using pickit3 to program pic18f4550 I build the circuit but still there are some problems outcomes from the output window from both mplab ide v8.60 and mplab ipev2.20 the window outputs : 1- ...
0
votes
0answers
48 views

How can I use the OSC2 pin as normal IO on a pic32mx150f128b?

Everything else works well, the CPU runs at 40 MHz, UART works, GPIO works; the OSC1 pin works as GPIO as well. But I cannot use OSC2 as GPIO. I am using the Fast RC oscillator with divide-by-N and ...
0
votes
0answers
45 views

dspic33 ADC alternative MUX problem

I'm trying to sample from 8 channels using my dspic33fj128gp802 chip. I've had four channels working fine up until now, but trying to use the alternative MUX switch isn't going to plan. I've tried ...
3
votes
1answer
93 views

Android Microchip Accessory Development Starter kit PIC24F

I have the PIC24F Android Accessory Development Starter Kit from Microchip. I am running Android 4.4.2 on a Samsung Galaxy S4, however I am unable to get the phone to recognize the USB device when ...
1
vote
3answers
117 views

Can I use a PC Microphone in a PIC with ADC?

I want to do an FFT on some music, I found an electret board so connect directly to the ADC port, but I was wondering if it's possible to use a normal computer microphone, anyone know a tutorial or ...
0
votes
1answer
382 views

PIC16f xc8 compiler : unknown pragma “code”, “interrupt”,“chk_isr”

Lately I've been trying to interface HC-SR04 with PIC16F877A using capture mode and interrupt but am getting "Warnings" and I've pasted the code below: Compile output: ...
2
votes
2answers
84 views

Making variable delay routines

I know how to write accurate delay routines in assembly to run on a PIC microcontroller. The problem I have is creating delays of a arbitrary length. What I want to do is accept some data which ...
0
votes
0answers
64 views

SPI interface using pic with cc2500

Datasheet of cc2500 is here: http://www.ti.com/lit/ds/symlink/cc2500.pdf . I looked at the SPI timing diagram on page 22. I have gone through the datasheet of cc2500 and understood that. idle state ...
5
votes
3answers
846 views

Is this a correct way to have a 1 second delay?

If I have a PIC24 with a 4 MHz frequency. Is it accurate to have a 1 second delay by having 4 million clock cycles? I made a 1 second delay like this on my PIC24FJ128GA010: ...
1
vote
1answer
125 views

The PIC24F RETURN instruction

The PIC model I have is PIC24FJ128GA010. My question how many clock cycles does the RETURN instruction consume? The datasheet says 3(2), what does that mean?
2
votes
2answers
57 views

Microchip's XC8 Linker doesn't recognize some custom section names

Slightly related to this one: http://programmers.stackexchange.com/questions/254734/microchip-xc8-how-to-pack-code-against-an-upper-limit I can relocate code just fine, but I'm having some trouble ...
1
vote
1answer
49 views

How does the PIC's PMCON1.WRERR bit actually work?

I know from the datasheet that it gets set automatically on a rising edge of the WR bit and cleared automatically on a successful completion. Thus, if it's still on, then something went wrong. So ...
0
votes
1answer
62 views

PIC16f EEPROM Write Errors

Developing on PIC16f1936 and using MPLAB X IDE with the XC8 complier. I have been stuck on this for a while and no one in the office can figure it out either. I've been given this project where I ...
1
vote
1answer
41 views

Finding Equivalent Thevenin Resistence

For the following circuit: I'm solving for the Rth at node 2. In the solution guide, it shows that the Rth = (10k || 10k). I don't understand how this is so, by following the resistence equivalent ...