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)

2
votes
2answers
80 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
52 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
43 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
35 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
371 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
32 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 ...
0
votes
2answers
52 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
67 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
71 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
0answers
38 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
47 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
73 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
77 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
67 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
27 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
89 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
45 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
68 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
100 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
70 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
65 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
79 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
54 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
116 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
98 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
100 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
43 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
45 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
42 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
88 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
113 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
330 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
81 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
63 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
840 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
124 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
56 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
59 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 ...
0
votes
2answers
164 views

Why can't I use a variable in an if statement?

I am new to Pic microcontrollers and just started programming them. Now my problem lies in this code: ...
-1
votes
1answer
134 views

Proteus error “Stack overflow is forcing device reset”

I used PIC18F452 microcontroller for my project. And I'm using mikroc pro software. My code compiled successfully. But in proteus, it will give the error "Stack overflow is forcing device reset". And ...
2
votes
2answers
191 views

Using internal pull-ups for I2C on PIC18F

I'm working with a PIC18F46J53 and it was working quite well without any troubles. Suddenly, I found a hindrance on my path. I used RB4 and RB5 pins as I2C bus pins for communicating with an EEPROM ...
1
vote
1answer
137 views

How to use k150 pic programmer on Linux?

I'm trying to start with PIC microcontrollers. I bought this programmer: http://www.kitsrus.com/pdf/k150v2.pdf and a 16F628A. But I'm not able to use it with my Arch Linux... How can I do that? Thx ...
2
votes
1answer
68 views

PIC32MX795F512H UART1 interrupt problem

I know this topic has already been brought up and I have been going through those posts but I still can't get my UART1 RX interrupt working. What I am trying to do is receive the NMEA string from my ...
-1
votes
2answers
93 views

Can I use math functions in PIC16F877A code?

Can I use exponential (exp) math function in PIC16F877A code? For example like this: double a,ans; a=5.7; ans=exp(0.5);
0
votes
3answers
49 views

Globlal Variable Problem: Pic18f4550 and Pickit3 Debugging

I'm working on a project which includes the usage of the A/D converter module in the micro-controller (pic18f4550). I haven't had any problems in the past with the micro-controller using a pickit3 ...