Questions tagged [pic]
PIC is a brand of 8, 16, and 32 bit RISC microcontrollers manufactured by Microchip. "PIC" originally was an acronym for "Peripheral Interface Controller".
2,796
questions
5
votes
2
answers
315
views
PIC MCU wont accept external oscillator
I have been trying to use a PIC16F684 with an external oscillator. I tried a few, changed capacitors, added series resistor - nothing.
Right now I have a 10 MHz crystal connected with 30 pF capacitors ...
0
votes
0
answers
43
views
STEP Motor Maximum Speed
Hello I'm struggling with getting my nema 23 step motor(3A max) to achieve maximum speeds and I'm wondering if its the algorithm or the motor driver. I'm using 24 volt power supply with TB6600 step ...
0
votes
3
answers
95
views
How is the sweep of duty cycle handled in common microcontrollers? [closed]
I have designed a PWM module in Verilog, and it was giving me a glitch. After debugging it for some time, I found that the value of the duty cycle was changing twice within a certain period.
How do ...
0
votes
1
answer
59
views
Difficulty defining interrupt in PIC18F14K50 [closed]
When I try to set the interrupt on change in PIC18F14K50, I can't get the interrupt to run once and turn off the flag. What could be the problem in working with this component?
I am working with the ...
0
votes
1
answer
27
views
PIC32 VUSB3V3 must be externally powered?
I use a PIC32 and I want to use RB11. That's a USB pin but can be used as GPIO.
The datasheet specifies in 18.4 page 180:
For non-USB operation with RB11 and/or RB10 as GPIOs, the USB module must be ...
0
votes
2
answers
71
views
Do I need to set configuration bits for oscillator in mikroC in code?
I am new to programming PIC, I use PIC16F684 (via mikroC). I want to do an accurate (up to 1 minute per 24h) timer to control relay, so I chose an external 16 MHz crystal oscillator.
I connected it to ...
0
votes
1
answer
68
views
PIC reset pullup
I'm trying to repair a "Flexineb E2" veterinary nebuliser for somebody, it holds a charge and works plausibly well if the battery connection is briefly interrupted but will not power-on if ...
-2
votes
1
answer
61
views
A question about the use of 4017 and ULN2003A [closed]
Can someone please help me understand the use of CD4017 AND ULN2003A with the 7-segment display?
0
votes
1
answer
44
views
Mplab XC16: can't use sprintf to convert float to string [closed]
I want to use sprintf function to convert a float to string, here is part of the main.c code : (PIC24JF64GA004)
...
0
votes
0
answers
31
views
dsPIC30F 10 Bit ADC Module. Meaning of the SAMP bit
The documentation (https://ww1.microchip.com/downloads/en/devicedoc/70064e.pdf) is saying about the SAMP bit in the ADCON1 register the following:
...
0
votes
2
answers
61
views
Some characters lost in UART Transmission (PIC12F1822 -> SIM800L)
I am using the diagram recommended in the SIM800L datasheet to connect it to a PIC12F1822 MCU operating at 3.3V and 16MHz using its internal RC oscillator.
...
1
vote
1
answer
67
views
Why is no data written to the I2C bus using this PIC12LF1822 code?
I am trying to implement a basic I2C Master write sequence for a PIC12F1822 Microcontroller. I am programming the device using the PICKit 3 programmer.
I have heavily simplified the code to isolate ...
0
votes
0
answers
139
views
PIC16F1829: how to read device ID using LVP mode?
I am stuck. Datasheet, programming guide. LVP mode.
I see how to write to area 0x8000-0x8008 using "load configuration" command, but I do not see how to read this area. It is not a part of ...
0
votes
1
answer
55
views
Do not get how to time PIC16F USART sending in interrupt-driven environment
Device: PIC16F1829, half-duplex communication (RS-485)
The USART is having two registers - TSR and TXREG. Transmit is performed from TSR and process is indicated by TRMT bit. TXREG is second register ...
0
votes
0
answers
54
views
PICkit 5 giving -109 error when programming PIC
I have a PICkit 5 which I think is correctly connected to a PIC16lf18425. Whenever try to program it I get
error -109
I just have a 0.1 uf electrolytic capacitor between GND and VDD and a 10k ohm ...
1
vote
1
answer
65
views
May I safely apply negative voltage to PIC's analog input?
For example I'd like to apply AC voltage ~3V. Could I not detect, but simply connect to MCU? I'd measure positive side as regular ADC, but I simply do not want negative side of amplitude to damage it. ...
3
votes
1
answer
191
views
Why is Vdd connected to GND?
I am trying to build a JDM programmer for PIC. I looked at many circuit diagrams. During my analysis one thing I noted is that on most of the circuit diagrams the Vdd of PIC is connected to the GND of ...
0
votes
1
answer
63
views
Shape of signals in PORTB of PIC after executing code
I am trying to understand how in this document the signals in PORTB.0, PORTB.1 and PORTB.2 are drawn.
According to the code, there is an infinite loop and we are every time adding 10 (in binary), so ...
0
votes
1
answer
51
views
Writing EEPROM on PIC18F27Q83
I'm trying to write the EEPROM (DFM) on a PIC18F27Q83. I copied the sequence from the datasheet exactly and it still fails. The device id is 0x9909 and revision id is 0xA45.
...
2
votes
1
answer
64
views
PIC assembler to perform arithmetic on 10-bit number spanning 2 registers
I wondered if there was any 'clever' way of decrementing a 10-bit value which is stored across 2 registers. In this case, its the PWM duty cycle value which has its 8 MSB in PWM1DCH and its 2 LSB in ...
0
votes
0
answers
50
views
Pump motor interference with PIC microcontroller
I am building a fermentation chamber for sourdough which has a heating element and a 5v mini-pump for humidity. Both are controller by a PIC16 microcontroller. Without the pump all is well, but as ...
0
votes
0
answers
55
views
What are the key design components for illuminating Christmas lights using a PIC
So my cheap Christmas lights failed this year due to something broken in the control logic. I thought I would try and build my own control circuit and use them again next year.
The LED lights still ...
0
votes
1
answer
51
views
MSSP setup on PIC16F18313
I am new to using PIC16F18313 and having some difficulty setting up the MSSP module. I am using PICKit 3 on Windows 10 with MPLAB X IDE v5.40 and XC8 compiler v2.41.
The IC has pullup resistors 4.7k ...
1
vote
1
answer
99
views
PIC16F18855 adc read mismatch
I wrote a code for pic16f18855 analog voltage to digital value reading. but I noticed that analog voltage connected to pin RA0 read with RA1 and analog voltage connected to pin RA1 read with RA2 and ...
1
vote
1
answer
93
views
Controlling PWM Fan/Read Sensor from PIC16F18877
I am working on a controller based around the PIC16F18877 which will need to control a 4-wire 12V DC Fan, as well as read the signal from the sensor wire. The PWM signal needs to be somewhere between ...
0
votes
0
answers
53
views
Identifier whose declaration cannot be found. TRISbits
Currently trying to program a PIC32MZ2048EFM144.
I'm new to PIC programming, and I'm currently attempting to set pins J7, 3, and K7 as outputs and set them to a high state. However, I'm encountering ...
0
votes
2
answers
117
views
Unable to resolve TRISBbits even with xc.h included
I am new to PIC programming, and I am trying to blink an LED using the PIC32CM MC00. I understand I must declare them as inputs or outputs, but the IDE I am using (MPLAB) keeps giving me an error when ...
1
vote
0
answers
60
views
Is it possible to display DHT11 on a 4 digit-7-segment with a PIC16f877A?
I'm trying to display the temperature of the DHT11 on a 4-digit-7-segment. I simulated it on Proteus and the result always equal to 0. I wonder if the way I used timer to display the LED affected the ...
0
votes
0
answers
99
views
Different result displaying LM35's temperature on a 4-digit 7-segment using PIC16F877A versus Arduino
I'm working on a project using a display LM35 using PIC16F877A but the room temp was measured around 70°C. I tried using this LM35 with Arduino and it showed result around 40°C. I used a multimeter to ...
1
vote
3
answers
106
views
PIC16f628a internal oscillator runs at a lower frequency than expected
Specifically speaking, it runs at almost exactly 1 MHz instead of the supposed 4 supplied by the internal oscillator. This is probably the cause of other strange behaviour like failing to blink an LED ...
0
votes
1
answer
99
views
PWM on desired pin PIC18f47k40
trying to question again.. Thanks in advance for any help!
I've been working with PIC chips for a while and recently using a PIC18f47k40. I cannot get the PWM via CCP or the separate PWM modules to ...
0
votes
1
answer
44
views
Is it possible to force an input port during debugging in MPLAB IDE v8?
I am using MPLAB IDE v8 (not IDE X) to write some PIC programs (PIC18F4321) in assembly. I am using the debugging tool MPLAB SIM to debug the programs, however I am not able to force port bits from ...
1
vote
1
answer
43
views
Programming a PIC with a programmer on demo board
I'm a beginner on PIC world. I'm doing a project with PIC PIC18F04Q40 and I'm curious if I can use the programmer/debugger present in a Curiosity HPC board to program the PIC18F04Q40 through ICSP ...
0
votes
0
answers
75
views
Controlling LED drivers with a PWM using a PIC MCU
In one of the circuits I'm working on, there are three LED's connected to every LED driver output (I have a space and cost constraint because of which I need to use this). The high side of each LED is ...
1
vote
2
answers
382
views
PIC based MCU coding to make a speedometer
I am trying to make a speedometer cum odometer. I'm using a PIC based MCU. The speed I'm getting is as an analog input. (at 0 V, I get 0 km/h and at 18 V, I get 25 km/h). I can easily measure the ...
4
votes
4
answers
1k
views
How could I connect a PDIP8 PIC controller to a PCB so I could remove it?
I would like to not solder it in place so I could simply remove it for reprogramming. Is there breadboard-like PCB solderable component which will let me stick the MCU to it and then easily remove it?
...
1
vote
1
answer
91
views
Smooth a PWM to DC stable [closed]
I have to smooth a PWM (0V- 12V, 200Hz) who trigger my pic12f1572 via transistor 2N3904. What is the best way?
I have PWM source connected to 2N3904 and output from 2N3904 is connected to PIC uc. I ...
1
vote
1
answer
90
views
PIC16F1825 trouble with simple increment MPLAB XC8
I have set myself up with on a breadbord with a simple PI16F1825.
I am using MPLAB x with XC8 V2.45
i have a led that turn on/off every second using the simple delay function.
i would just like to ...
0
votes
2
answers
105
views
PWM Driver for PIC12F1572
I have rear lights for car (VW Passat) controlled by default with PWM. I want to create another circuit who do like follow:
When I press brake, car send PWM into LEDs and turn it ON. I want to use ...
0
votes
1
answer
25
views
Pic32MZ interrupt signal to output pin set without CPU usage
I generate ADC digital comparator interrupts. I want to use this interrupt to trigger Input Capture module. To achive precise timing it will be better to directly trigger IC module with ADC digital ...
0
votes
1
answer
54
views
Why can't I drive pin RA4 low on PIC16F1823?
I am using PIC16F1823 MCU. Pin RA4 is a multipurpose pin but can be used as I/O. But I cannot find which settings are required to achieve this. I've tried to disable all unrequired peripherals ...
1
vote
0
answers
133
views
PIC16F UART Receives only the first byte
I'm currently working on a PIC16F18855, I'm trying to set up the communication part.
My setup is as follows:
A PCB connected to my computer via a TTL232 cable.
The PIC16F18855 is clocked at 32Mhz, the ...
5
votes
2
answers
938
views
Loading LSB first or MSB first?
I am trying to create a delay function similar to builtin __delay_ms() in MPLABX IDE PIC18F4520.
The question is if I write the LSB first to the TMR0L register, I ...
0
votes
0
answers
58
views
Problems programming PIC16F15213 with PICkit4
I'm having problems programming my PIC16F15213. I am trying to program it with the PICkit4 and it gives me this error:
...
0
votes
0
answers
63
views
Problem in code while interfacing PIC24 with 25AA256 EEPROM
I have been trying to interface a PIC24FJ128GA010 with a 25AA256 EEPROM using Proteus and Serial Peripheral Interface (SPI).
I wrote a C code and configured everything and all pins but since I self ...
0
votes
1
answer
93
views
Proteus error about coff format. (Coding in C to program a PIC microcontroller)
I am trying to make a code to interface a PIC24FJ128GA010 with a 25LC256 EEPROM.
This the following code:
...
3
votes
1
answer
526
views
PICKIT3 unavailable on MPLAB X IDE [closed]
What I want to achieve
To write a program to a PIC microchip using PICKIT3 and MPLAB X IDE.
Issue
PICKIT3 not found on Device Manager
No compilers found on MPLAB X IDE
Environment
Windows 10
...
0
votes
1
answer
125
views
Error while uploading hex file in DSPIC33CK32MC102
I am using DSPIC33CK32MC102 SSOP package, I have code and its hex file ready. I made the connections for the controller those are as follows:
Pullup resistor of 5.5 kΩ for MCLR pin and 100 Ω between ...
0
votes
0
answers
25
views
dsPIC33CH512MP508 CAN Transmit Error
I am using dspic33ch512mp508. When I call the CAN1_Transmit function, it transmitting continuously with 100us second gaps. Even if I put it in the 1 second timer, it doesn't work.I tested it, the ...
3
votes
1
answer
138
views
How can I dynamically preload the EEPROM on a PIC microcontroller
I'm trying to set up code to preload the EEPROM of a PIC16F628A with the necessary data depending on the value of one #define, so the uC is ready to be popped into ...