r/pic_programming • u/fevera1985 • Jan 17 '19
Would a Gikfun CH341A1 will with PIC12f683
I'm wondering if a USB Gikfun CH351A1 EEPROM debugger BIOS programmer will program microchips 12f683 8pin ones.
r/pic_programming • u/fevera1985 • Jan 17 '19
I'm wondering if a USB Gikfun CH351A1 EEPROM debugger BIOS programmer will program microchips 12f683 8pin ones.
r/pic_programming • u/elemep • Jul 24 '15
r/pic_programming • u/tallestinmysquad • Mar 14 '19
I need help Programming a PIC16F628 for generating a pulse width modulation with variable duty cycle using internal comparators, i just want to know witch registers should i work on and howvto program the internal comparators
r/pic_programming • u/[deleted] • Feb 14 '13
Find your install location for MPLAB X. This is typically something like "C:\Program Files (x86)\Microchip\MPLABX"
Within this MPLAB directory you should see a folder structure that looks like "\mplab_ide\etc" .
Open the file called "mplab_ide.conf"
Look for the entry that looks like:
default_options="-J-Dnb.FileChooser.useShellFolders=false -J-Xms256m -J-Xmx4096m -J-XX:PermSize=512m -J-XX:MaxPermSize=512m -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled"
Definitions:
XmsXXX is your initial heap size (256M or 512M is OK)
XmxXXX is your maximum heap size (go with 2048M if you have that much)
PermSize and MaxPermSize store metadata about the JVM and shouldn't be higher than 512m
Save the file. Make sure you have security permissions to do so.
Reboot the IDE
There may be a way to do this from within the IDE but I'm not sure
r/pic_programming • u/ciuzan • Mar 21 '25
Hello!
I'm currently working on a project for my university. Firstly i need to check if the sensor is calibrated. I would like to check this with mplab x ide. I have to mention that im using MPLAB x IDE v6.20. I have an ICM20948 sensor connected to a PIC32CXSG41 Curiosity Ultra. I made the connection between the sensor and the pic board using these pins: PD08 for SCL and PD09 for SDA using SERCOM6 and UART using SERCOM5 from the mplab code configurator.
I have tested the board just in case to know if it works properly (and it does).
I wrote a code for checking if the sensor is calibrated and i used Tera Term terminal for checking.
The issues that i encountered are in the terminal. I don't get any data from the terminal once i run the code and i am stuck here.
If you have some ideas about how can i rewrite the code or if you can provide me with another code to check the calibration i would be thankful!
Thank you in advance for your answers and tips!!
I wish you a great day!!
r/pic_programming • u/aspie-micro132 • Mar 07 '26
I would like to ask if someone knows some sort of example project using around 3 leds and a button. I do wish to get one led on by default and each time i push the button, to turn on the next one keeping off the others, so once it reaches the last one starts over.
I do understand C, i can barely read assembler.
r/pic_programming • u/[deleted] • Mar 03 '21
problem when burning pic 12c508a
r/pic_programming • u/l_CptChronic_l • Nov 24 '20
Hi,
PIC16F18325
MPLAB X using MCC
So im trying to use ADC to read a voltage from a hall sensor. When the sensor reaches a certain voltage, i want it to toggle an led by switching from input to output over and over while LATA5 = 0. (LED is always on so i want to turn it off and on repeatedly)
Ive done it all in MCC so all the back code is there
ADC is enabled
Using FOSC/4 or /2
Right aligned
Positive ref: VDD
Negative: VSS
No auto trigger
Heres my main code:
void main (void){SYSTEM_Initialize();
ADC_Initialize();
while(1)
{
if (ADC_GetConversion(RA0) > 100)
{
LATA5 = 0;
TRISA5 = 0;
__delay_ms(500);
TRISA5 = 1;
__delay_ms(500);
}
}
}
Now the problem im having is;
When coded like this: (ADC_GetConversion(RA0) > 100) The led will always flash until the number in the statement (100) is met.
I want to swap it around so the led doesnt flash until 100 is met.
If i change the statement to: "if (ADC_GetConversion(RA0) < 100)" changing the bigger than to smaller than, it just constantly flashes no matter where the trigger is positioned.
Ive tried all values from 0-1023 but it just flashes no matter what.
I really cant get my head around this, if i have it set to > 100 (if ADC_GetConversion(PotA0) > 100) the led flashes all the time until the trigger is pulled all the way in. (until its less than 100)
Which surely means all i need to do is change the > (more than) to < (less than).
Changing to < should make it...
If the conversion is less than 100, make the led flash
This should now mean that when the trigger is pulled in the led will flash....right??
What am i doing wrong? I have been trying for days now but cannot get it working the way i need it.
r/pic_programming • u/[deleted] • Mar 07 '13
Hi guys. Just some interesting stuff for self-study. If you have questions throw them up here.
r/pic_programming • u/No-Collar-1272 • May 01 '23
Hi, i wounder if you guys can help me with a program. This have to show a message in a common cathode 7 segment display that starts on the right like this ___W (the _ means that the display is inn off), and then run to de left showinmg the complete message like "WORK". It should be configure with the Timer0, pleasssssssssss
r/pic_programming • u/Superb_Designer_3206 • Jan 07 '22
Hi, Has anyone used the RC522 RFID reader with PIC? I have problems wanting to read a specific sector of the RFID. Please help.
r/pic_programming • u/qReZe • Jul 02 '23
Hello group, could someone help me with a code in c for the pic16f690 microcontroller, I need a code that will generate a pwm and make a current measurement for me to display on an alphanumeric lcd. its for a personal project made in proteus(wireless charger)
Thanks!
r/pic_programming • u/eltimeco • Aug 13 '19
I have some source code I need to be compiled for a PIC18F6620 using Hi_Tech PICC-18 V8.20 pl1 - would someone be able to help me for fee?
r/pic_programming • u/piense • Dec 24 '19
I'm working on some code for a PIC32MX675F256H in MPLAB X using the simulator while I wait for boards to arrive and I'm having trouble getting a DMA transfer to work correctly to transmit out a UART port. It doesn't seem to be triggering properly off the TX interrupt and just dumps the whole buffer in one go which overruns it quite quickly and ends up not transmitting most of the bits.
Here's a gist of my code: https://gist.github.com/piense/65e50b0d9a44edfef098f7ea6705bf49
I tried using Microchip's echo example with this part in the simulator and saw the same behavior. I've seen a few references that the chips with an 8 deep fifo on the ports do the interrupts a bit differently, but no particularly good example that address this issue. So if anyone has any ideas, I'm all ears.
r/pic_programming • u/CE_b1tch • Apr 23 '22
r/pic_programming • u/canyoufixmyspacebar • Jan 12 '17
What do you think of this?
void main(void) {
OSCCON = 0x41;
TRISBbits.TRISB0 = 0;
while (1){
/* This does not work in Proteus but works in
* MPLAB Simulator and in 'Real PIC Simulator'
PORTB ^= (1<<0);
for (int j=0; j<20; j++) __delay_ms(50);
*/
/* This works in Proteus */
PORTB |= (1<<0);
for (int j=0; j<20; j++) __delay_ms(50);
PORTB &= ~(1<<0);
for (int j=0; j<20; j++) __delay_ms(50);
}
}I mean, of course I should look at the assembler but because I'm new to PIC, I thought I just run a quick check because maybe I'm missing something trivial.
Target chip is 16F8887 and my goal was to evaluate/compare different simulators available, only like 15 minutes into and I stumble on this.
r/pic_programming • u/aspie-micro132 • Jun 07 '26
I am trying to get my pic16f877a to toggle between leds reading a button.
I tried several things, but one idea comes to my mind: to turn on a led, hold it on with __delay_ms() and before jumping to the next one, get into an if() to read whether a button is pushed or not.
However, should my idea be feasible, how can i read when __delay_ms() reaches zero? I do wish to, read the button and the state of __delay_ms before turning off the actual led and on the next one.
I think this before i tried to do it without delays and i just get leds turning on and off as fast as a spin dryer..
r/pic_programming • u/aspie-micro132 • Nov 11 '25
I am trying to write a firmware for a Pic 16f877. as i wish to read several variables, i declared some Enum structures.
However, in the recent past, i had learnt that pics like 16f819 are just able to handle 2 variable, i mean if((a = 1) && (b == 1) { do this} or that.
i had read its datasheet, it speaks about it's registers and bits you can enable or disable to use features of the chip, yet, nothing seems to tell me about limitations on C language.
r/pic_programming • u/aspie-micro132 • Aug 03 '26
I am trying to create a non interrupting function, calling it
BlinkLed().
I had set TMR1ON = 1 and others 0 or 0x00 to disable them
I found those 2 code excerpts by Google AI. One of them does not blink at all, since it's not reading any timer, yet also not counting in it's own when working.
The other one below has a complex function name, given what i had learnt i do believe it shall work should i be able to rename it to "BlinkLed" but i do not know how to do it without breaking it:
/**********************************************************************************/
{
while(Button == 0)
{
unsigned int timer_counter = 0;
// Task 1: Non-blocking LED Blink (Toggles every ~500ms)
timer_counter++;
if(timer_counter >= 25000)
{
RedLed = ~RedLed; // Toggle LED
timer_counter = 0;
}
}
}
/*New ExtremeAgitationLED() Prototype Base*/
/*
void __interrupt() timer1_isr(void) {
if (TMR1IF) {
TMR1H = 0x0B; // Re-preload Timer1 high byte (3036 = 0x0BDC)
TMR1L = 0xDC; // Re-preload Timer1 low byte
TMR1IF = 0; // Clear interrupt flag
overflow_count++;
if (overflow_count >= 2) { // 2 x 0.5 seconds = 1 second
overflow_count = 0;
// Toggle an LED or do your 1-second task here
RedLed = !RedLed; /*I do not know if ~RedLed Can be Used Here */
}
}
}
r/pic_programming • u/breu9 • Aug 14 '25
Hi everyone,
I’ve just started working with MPLAB X IDE version 6.20 and I’d like to improve my workflow. Are there any must-have plugins or useful extensions you’d recommend?
Also, if you have any productivity tips, hidden features, or configuration tweaks that make development easier or faster, I’d love to hear them.
Thanks in advance :)
r/pic_programming • u/aspie-micro132 • Aug 09 '26
After some experimentation, i got buttons switching between leds and some functions on my pic16f877A. Problems is: It does not do it once, it cycles.
I tried several code pieces i found in the web using a flag, reading the button and turning to 0 or 1 a variable which should stop that theroretically, but it never works on my controller.
I also tried to add a NOP(); at the end of each procedure under if(button ==1){} but it does not brake the IC.
Does exist any manner to do this without adding capacitors to the buttons?
Edit: I know you are supposed to read, not the state of the button, but the transition from low to high or high to low (edges) but i can not figure a manner of doing exactly that with an instruction.. capacitors do it by hardware..
r/pic_programming • u/canyoufixmyspacebar • Jan 10 '17
Sorry, I know it is a lame question but I quickly need to make choices for my first PIC project. Can't explain in detail but the situation is that I'm used to AVR and now this requirement just came up. If I were to do it on AVR, I would have chosen the ATmega328p which is in every way sufficient for that project (and with ample room for growth).
I'm planning to use MPLAB X (plus their 8-bit C compiler) on Linux and PIC-KIT3 from Olimex. Feel free to comment on that too if you know what painful caveats there are for an AVR guy taking on PIC.
I found a comparison of some sort here, if you know more comprehensive comparison tables or discussions on web, please link me to them.
I by no means want to get into the processor wars, let's not start on how one is BS and the other is good and so on :)
r/pic_programming • u/[deleted] • Feb 28 '13
Hi guys.
Thought I'd post this up since it's a nice piece of tech that many people don't know about.
Let's say you have a 12v source but you need to have both a 12v source and a 4v source for powering your PIC chip and the 12v for a light bulb. When I first started I looked around for voltage regulators as a solution to this kind of problem. And they do have their place since voltage dividers do make certain assumptions about the input voltage, on which more later.
Ok, so we don't want to wire up a baby breadboard with a voltage regulator every time when want to work with voltages, nor do we want clunky transformers doing the work either since they tend to be big and relatively expensive.
So let's look quickly at the math, which seems pretty simple. The voltage in we will call Vin and voltage out we will call Vout. Voltage regulators work in ratios, the input and the output being the numerator and denominator respectively. Back to our example we see that our input voltage is 12 and desired our output is 4; so our ratio 12/4 = 3.
Ok here's the meaty part. Choose a resistor of some known resistance to be R1. Then to get the desired output voltage simple solve for R2 using:
R2 = R1 / (the ratio above - 1)
R2 = 10 / (3-1)
R2 = 10 / 2
R2 = 5 ohms
Now, let's choose another value for R1 just to see if the R2 and R1 form some kind of interesting correlation.
R1 = 1000 ohms
R2 = 1000 / (3 - 1)
R2 = 1000 / 2
R2 = 500 ohms
It appears anyways that there is a correlation, at least with a input to output ratio of 3 that the R1 should be twice the resistance of R2. Anyways have a look at the Wikipedia website and let me know if you have any questions/comments/corrections.
You can now take variable resistance and turn it to variable voltage. No more issues with how to get your PIC's ADC to read variable current!
Happy hobbying!
http://en.wikipedia.org/wiki/Voltage_divider
It appears that voltage dividers only scale downwards!
The problem with VRs is that if the input voltage moves so does the output voltage, which may or may not be what you want!
r/pic_programming • u/ThExterminator1 • Jul 13 '22
I have been having issues with this pic for 3 days, and haven't received a response of any kind from it. I have copied an pasted code from a tutorial so that I wouldn't get any code wrong due to the fact that my original code my have been wrong. I have successfully gotten this particular mcu to blink months before. I have used internal and external oscillator, and nothing has worked. I even switched to the pic16f877a, and it wont work! I have uninstalled mplab ide and reinstalled it, switched pickits and have been debuging for close to 8 hours now and haven't seen so much as a flicker.
/*
* File: main.c
* Author: boos
*
* Created on April 18, 2019, 9:50 PM
*/
// CONFIG
#pragma config FOSC = INTOSCIO
#pragma config WDTE = ON
#pragma config PWRTE = OFF
#pragma config MCLRE = ON
#pragma config BOREN = ON
#pragma config LVP = OFF
#pragma config CPD = OFF
#pragma config CP = OFF
#include <xc.h>
#define LED RB3
#define _XTAL_FREQ 4000000
void main(void) {
TRISB3 = 0;
while (1) {
LED = 1;
__delay_ms(1000);
LED = 0;
__delay_ms(1000);
}
return;
}VDD: 3.3v - 5v
I can personally guarantee that the connections are correct