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".

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

MAX6675 SPI communication with PIC microcontroller

I'm using a PIC16F18326 to communicate with a MAX6675 thermocouple-to-digital converter. As I read the values of the temperature and the SSPBUF register, they are way too high; SSPBUF is 223. I assume ...
wqeeekendwrrar's user avatar
0 votes
1 answer
36 views

What can cause these CAN signal distortions?

I occasionally observe signal distortions on CAN H, CAN L, and so also the differential signal. It is causing the microcontroller (dsPIC33) to report so-called Invalid Message Receive (IVR) errors. ...
RoboTK's user avatar
  • 1
1 vote
1 answer
45 views

Reducing current consumption for a PIC16 / Sleep mode

I would like to operate a PIC16F628A in sleep mode with less than 1 µA. For that I have switched off all ADC, peripherals, etc.. But about 7.5 µA is the lowest current I can achieve. I have found a ...
Olaf Rechtner's user avatar
0 votes
0 answers
41 views

Variable speed drive for an alternating current motor with PIC18F4431

I'm designing a control board for a three-phase motor speed controller using a PIC18F4431. I've used an inverter powered by 24V DC to convert the voltage to 24V AC to power the motor. Additionally, I'...
embar's user avatar
  • 1
0 votes
2 answers
98 views

Does anyone know if there is a way to increase the power of the PIC16F pin using MPLABX?

I've been trying for hours to make a 4-digit display work with the TM1637 controller. On Arduino Nano it works well. When trying to port the Arduino library to the PIC, MPLAB-X XC8, the signal ...
user3394963's user avatar
5 votes
2 answers
335 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 ...
Ri Di's user avatar
  • 1,039
0 votes
0 answers
47 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 ...
Bommersooner21's user avatar
-1 votes
3 answers
100 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 ...
Adam01's user avatar
  • 1
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 ...
אסף באבי's user avatar
0 votes
1 answer
29 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 ...
DamanZ4's user avatar
  • 17
0 votes
2 answers
73 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 ...
Ri Di's user avatar
  • 1,039
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 ...
Mark Morgan Lloyd's user avatar
-2 votes
1 answer
63 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?
Abir El Abdellaoui's user avatar
0 votes
1 answer
51 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) ...
Issam H's user avatar
  • 21
0 votes
0 answers
32 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: ...
Buran's user avatar
  • 21
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. ...
Vahid's user avatar
  • 289
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 ...
BlueShoes's user avatar
0 votes
0 answers
141 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 ...
Anonymous's user avatar
  • 7,098
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 ...
Anonymous's user avatar
  • 7,098
0 votes
0 answers
57 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 ...
doge guide's user avatar
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. ...
Ri Di's user avatar
  • 1,039
3 votes
1 answer
197 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 ...
shafeeq's user avatar
  • 133
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 ...
Badr Eddine's user avatar
0 votes
1 answer
57 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. ...
vini_i's user avatar
  • 7,108
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 ...
NomadAU's user avatar
  • 183
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 ...
Elad Lahav's user avatar
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 ...
NomadAU's user avatar
  • 183
0 votes
1 answer
55 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 ...
RickyBoy's user avatar
  • 169
1 vote
1 answer
102 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 ...
Alina Khan's user avatar
1 vote
1 answer
95 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 ...
Dominick's user avatar
  • 111
0 votes
0 answers
56 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 ...
Sean 's user avatar
  • 11
0 votes
2 answers
124 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 ...
Sean 's user avatar
  • 11
1 vote
0 answers
65 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 ...
stevievei's user avatar
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 ...
stevievei's user avatar
1 vote
3 answers
112 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 ...
Hubert S's user avatar
0 votes
1 answer
101 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 ...
Lukas Brenner's user avatar
0 votes
1 answer
45 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 ...
bardulia's user avatar
  • 407
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 ...
noob_programmer's user avatar
0 votes
0 answers
80 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 ...
Siddharth Goel's user avatar
1 vote
2 answers
388 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 ...
Siddharth Goel's user avatar
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? ...
Ri Di's user avatar
  • 1,039
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 ...
SkePsis's user avatar
  • 65
1 vote
1 answer
97 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 ...
old_fool's user avatar
0 votes
2 answers
108 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 ...
SkePsis's user avatar
  • 65
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 ...
Ahmet Atcı's user avatar
0 votes
1 answer
55 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 ...
RickyBoy's user avatar
  • 169
1 vote
0 answers
145 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 ...
Benito's user avatar
  • 41
5 votes
2 answers
947 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 ...
Madhan Gasikanti's user avatar
0 votes
0 answers
62 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: ...
Alberto Penzo's user avatar
0 votes
0 answers
68 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 ...
P-Em's user avatar
  • 13

1
2 3 4 5
56