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

1
vote
0answers
47 views

How to specify in the project or firmware of the application, where to start writing the code?

I have a bootloader to PIC18F4550 that was written using Mikro C for PIC and I have two firmware applications, one was written using Mikro C for PIC and the other using MPLAB X with XC8 compiler. With ...
0
votes
1answer
32 views

PIC24FJ Baud Rate Issues / Crystal Selection

I'm using a PIC24FJ1024GA606 and I'm using the internal Fast RC Oscillator. Here is my config: ...
0
votes
1answer
34 views

How to implement ion acceleration and deceleration in stepper motor?

Actually, I am using pic microcontroller and software uses for programming is microC. One more thing I use a controller unit (DH542-D)for controlling bipolar stepper motor. I did read several articles ...
-5
votes
0answers
89 views

Build error with PIC programming [closed]

I am self-learning with the help of a book, and whole code comes from that book. The problem appears when I push F11+Shift. There are some messages shown below. Because I am a beginner, I have no ...
0
votes
1answer
58 views

PIC18F26J50: how to use printf in C18

I'm trying to use the printf family of functions in C18 for a PIC18F26J50. In my system, the output should go through the UART and show up in RealTerm. Here is my ...
0
votes
3answers
198 views
+50

How to read a specific port with ADC in Mplab Harmony?

I configured the ADC for 3 instances/3 analog inputs: ...
0
votes
1answer
61 views

Application and bootloader written in different tools can not be compatible?

I have a bootloader to PIC18F4550 that was written using Mikro C for PIC and I have two firmware applications, one was written using Mikro C for PIC and the other using MPLAB X with XC8 compiler. ...
-2
votes
1answer
36 views

How can a watchdog timer be cleared in Mplab Harmony?

Using Mplab Code Configurator (MCC) it's easy to clear watchdog timer, for example i created a project for a PIC 16F15324T and in my code i only have to call the ...
0
votes
2answers
42 views

How to read a port by a label in Mplab Harmony?

I'm more familiarized with MCC and with that framework is really easy to read a port we just need to give a custom name in ...
0
votes
1answer
27 views

Where to put main code in Mplab Harmony Framework?

When i'm doing code using MCC for example i will put my code the following way: ...
0
votes
1answer
18 views

How to do a counting of a timer configured in Mplab Harmony framework?

I'm new to harmony framework, and am trying to find how i can count timer iterations, so i'm doing a simple test. I configured the timer like this: Now i want to know if this is the correct way: <...
0
votes
1answer
40 views

How to toggle a pin in Harmony framework for a pic?

I'm new to pic's and the harmony framework, and i'm trying to toggle a pin from high to low and vice versa in the interrupt callback of the Timer. I configured my oscillator to operate at 32 MHz or ...
1
vote
1answer
38 views

Anyone knows what is a driver implementation in Harmony?

When configuring a Timer Driver implementation the option for Dynamic and Static appears. Anyone knows, what does these 2 types mean?
0
votes
1answer
42 views

With harmony how to implement printf to uart?

I setup a project using harmony v2 for a pic32mx470f512l. In drivers -> USART i configured the UART (strange its called USART in harmony in datasheet says its a UART): Now i want to use the function ...
0
votes
1answer
21 views

PIC32MX470F512L not appearing on harmony setup?

I installed Harmony plugin in MPLAB X IDE because i can't put this pic working with MCC. I was going to do a new project for this pic and when i was going to select it, it doesn't appear on the list! ...
0
votes
3answers
99 views

What Is the timer period of a timer of a Pic

This is causing a bit of confusion to me. I'm assuming that timer period of a timer is the time that it takes for an increment of timer. Am I correct? It works the same way for 8-bit and 16-bit timer,...
1
vote
1answer
39 views

PIC18F26J50 serial communications over RS485 link

I'm trying to figure out why my serial communication is not working. The design is to use the UART of a PIC18F26J50 over a RS485 link. Here is the relevant part of the schematic. Other relevant info:...
0
votes
1answer
48 views

Does the increment of a timer on pic is equal for a pic16 and pic32?

The question is because in porting code from a PIC16F15324T using MCC to a project using a PIC 32MX470F512L. There are portions of code where i have code like this: ...
1
vote
1answer
22 views

How to use SYSTEMConfigPerformance on a MPLAB X project

I started a new project for a pic 32 (pic32mx470f512l) with MCC. And now i want to use the function SYSTEMConfigPerformance to optimize the performance of the pic. It happens that i'm not able to ...
2
votes
1answer
46 views

PIC 12F675 with wrong timing

I have designed an assembler program for PIC 12F675, but it gives wrong timing. Datasheet says that internal oscillator is 4 MHz, and its instruction cycle is 4 clocks. Thus single instruction ...
1
vote
3answers
71 views

How to look at the emitted assembly code of MPLAB X IDE

I'm using MPLAB X IDE V5.05 to generate the code to program a PIC32MX470F512L. It happens that i'm having some problems in the code and i would want to take a look ...
1
vote
2answers
73 views

How to calculate instruction cycles on pic?

I want to know how much instruction cycles are each line of a program, is there a way to do that? It's important to me because i'm having a problem with the oscillator (or might be something else) ...
4
votes
1answer
50 views

PIC CCP in compare mode not changing CCP2 pin

I'm learning PIC C programming from Gooligum Enhanced C lessons. In lesson 14 CCP module there is example 4a which flashes LED every 500ms, see below: Using 16F1824 PIC I can compile in MPLAB X and ...
1
vote
1answer
45 views

What clock source is the oscillator connected at the OSC1 and OSC2 pins of a pic?

I'm connecting a Crystal SMD of 32 MHz to the OSC1 and OSC2 pins of a pic. When doing the configurations for the pic, inside <...
0
votes
0answers
29 views

Pin should be lock for sample A warning in Pic

In an ADC i'm trying to configure for a pic PIC 32MX470F512LT its giving me a warning, that like the title says, it's that the pin should be locked for sample A. I ...
0
votes
0answers
41 views

The interrupt callback happens at the calculated period of the timer in pic?

I'm trying to set the timer of a PIC32MX470F512LT to happens every 8us. But after seeing on an oscilloscope when the callback of the timer it doesn't seem to ...
0
votes
0answers
71 views

Is there a minimum frequency in PIC32MX470F512L?

I'm still an inexpirient and I'm configuring the PIC, through MCC (Microship Code Configurator) So i set in the MCC a TMR1: The configuration for the ...
1
vote
0answers
29 views

How do you get the call ringing response after sending ATD from gsm module?

I have a gsm module. I want to know which AT command can tell me if the target phone is ringing or not. I want to count time between start of ringing and user response Example: atd12345 ...
0
votes
3answers
84 views

Connecting a 5 V signal to a 3 V tolerant pin of a PIC

I have a situation that happened in my case, where i'm putting an AC signal that goes from 0 to about 4,5 V in a 3 V tolerant pin of a PIC. The pin in question is ...
0
votes
1answer
37 views

MPLABX with PIC18F4550 Debug and programming are not working

First I used MikroC for PIC to modify a firmware to a PIC18F4550. I was programming the device using MPLAB IPE and the PICKit3 programmer, everything was ok. Now, I need to change to MPLABX XC8 ...
1
vote
3answers
98 views

PIC understanding the sign of the integer that is in the register

Hello I am getting current data from CANBus, they send me the value as a signed number. The problem is even if the number is supposed to be negative if(current<0) is always true and it never ...
0
votes
0answers
23 views

PIC SMBus timeout and recovery from that timeout

I am trying to communicate with 3 batteries (same kind of batteries) with SMBus and I use PIC18F26K83. There is a mux in order to solve address conflict of the same 3 batteries. My problem is that ...
0
votes
1answer
62 views

Cap in Series with a DAC Reverse Current

I'm using a 8-bit DAC: (DAC5311IDCKR) to generate a 1.5V Amplitude sine wave with a 3.5VDC offset. I've put high-pass RC filter across it shown below to block DC so that it becomes AC. I understand ...
0
votes
1answer
55 views

Problem to update firmware using bootloader to PIC18F4550

I followed the documentation on the Diolan's web site . I changed the project to be programmed to an PIC18F4550 and not a PIC18F4455 as it was originally written. The compilation succeed and I was ...
0
votes
1answer
59 views

PIC getting each bit value of an integer value

I need to send some integer value that is between 0 and 100 to another PIC by using 8 bits of PIC18F26K83. The problem is pins are from different ports not from the same ports. So I cannot follow a ...
0
votes
2answers
65 views

Updating PIC18F4550 through its USB?

I would like to be able to program and update the PIC18F4550 through USB. The PIC18F4550 already has USB, so, I don't need a USB to serial converter. On the microchip forum, I found this reference ...
1
vote
1answer
111 views

PIC I2C communication problem with I2C multiplexer

I need to read data from 3 of the same kind of batteries with SMBus so I decided to use an I2C multiplexer for this purpose. I can communicate with 1 battery without any error. But I cannot ...
0
votes
0answers
37 views

PIC32 - USB protection

I have the schematic below. It works fine and has done so for a few months. However, today, it seems the PIC USB module has died when I powered off/on the board. Is there more input protection ...
0
votes
2answers
64 views

PIC does not restart in case of power off and then power on

I am using PIC18F26K83 and everything works great. But when I close the power source (no source voltage for PIC) and then I open it again, PIC does not restart. I do not what does it do but it looks ...
0
votes
2answers
58 views

PIC32 UART TX working perfectly RX not

I am using PIC32MM0064GPL028 to drive RGB+W LEDs via TLC57911 LED drivers. The idea is - data from python script -> Easysync USB to RS-485 -> ST485ECDR transceiver -> PIC32MM0064GPL028 -> TLC57911 -> ...
2
votes
3answers
202 views

How to prevent someone clone PIC [closed]

ACT 1 Okay I know there is code protection system on PIC. But it is preventing someone read the code, not copy. It looks still easy to clone and run on another circuit. Can you suggest another ...
0
votes
0answers
85 views

PIC timer1 interrupt never occurs

I am trying to use timer1 interrupt on PIC18F26K83. I use Micro C as compiler. So I set my timer for 30 ms and after that 30 ms, it is supposed to enter an interrupt and light the LED. But it never ...
1
vote
2answers
120 views

PIC interrupt on change never enters the interrupt routine

Hello I am using PIC18F26K83 and I have a button on RC7 pin. That is why I cannot use a normal interrupt. But according to datasheet interrupt on change can be used in this pin. I could not make it ...
2
votes
5answers
311 views

PIC 16f628a succesfully programmed and simulated but not working on circuit

I simulated this circuit successfully in proteus but it doesn't work on breadboard. The motor is unipolar stepper motor I checked the motor and ULN2003A darlington transistor IC. They work ...
0
votes
1answer
81 views

dsPIC30F: 10-bit ADC. What happens after the bit DONE is set?

Documentation on the 10-bit ADC gives numerous samples. But none of these samples explain in clear what happens and what should the software do once the DONE bit is ...
1
vote
1answer
72 views

dsPIC30F: 10-bit ADC DONE bit vs the ADIF bit (interrupt request)

The ADC module has 2 very similar signals. The DONE bit in the ADCON1 register and the interrupt request bit from the ADC. For ...
0
votes
0answers
31 views

dsPIC30F: 10-bit ADC with no ASAM, SSRC == 000 and multiple channels

When the ASAM is not active, the sampling is started by software, by setting the SAMP bit. When the value of the ...
0
votes
1answer
57 views

Calculate Prescaler value for PIC16F877

I am trying to figure out if there's a way to calculate the prescaler value for Timer 0 on the PIC16F877. I've looked at both parts of Microchip's tutorial on timer 0 and some other tutorials: PIC ...
0
votes
0answers
31 views

Not getting reading back from HC-SR04 with PIC18F45k50 MCU

Hello I'm trying to measure the distance with HC-SRO4 ultrasound sensor PIC18F45k50 micro-controller however, I'm not reading any value on the LCD screen. Here is the following code that I have ...
0
votes
1answer
92 views

LCD 16x4 is shifting the columns of the third and fourth lines

I'm using the PIC 18F4550 to write to an LCD 16x4. I used MikroC Pro for PIC to write the code and the Proteus to simulate. I'm using the library Lcd and Lcd_Constants already present on the ...