637 questions
1
vote
1
answer
928
views
member reference base type 'volatile unsigned char' is not a structure or union
I was trying to program a PIC 16f877A Micro-controller to rotate a servomotor, 0 to 180 degrees, but every time i try to build the program i get an error "member reference base type 'volatile ...
1
vote
0
answers
51
views
Change initialisation variable
Im working on something that when turned on for the first time ever I want it to use a default variable but once this is changed I want it to start up with the new variable. Once I disconnect power ...
0
votes
1
answer
714
views
Switching between 2 states
I'm using mplab and coding in C.
I have setup my program so it has 2 states.
I want to be able to double tap a button and it swaps between state 1 and 2. I am doing this a very simple way, rather than ...
-2
votes
1
answer
643
views
P18F4420 Switch case statement in PIC assembly language
Im using a PIC18 on Mplab IDE in Assembly language where I have four LEDs.
2 LEDs tell me the status #1 and the 2 other LEDs the status #2. Finally, I have 2 more output LEDs to tell me the status of ...
0
votes
1
answer
142
views
Figured out the basic I want to do. But need to add PWM
Has a newbie to Code. I wanted to create the iconic TV Knight Rider scan. I have wrote my first code and achieved the basic function. I know there are many (already) made code for this and I have ...
-1
votes
1
answer
336
views
Fumbling through and failing at CODE writing. Working code, not working for me
I have installed MPLAB X IDE, XC8 and MPLAB IPE to write the code. Also, I have bought 2 Dev boards for testing the code out on with a PIC16F88. A small chip to get my feet wet. As I looked over many ...
0
votes
0
answers
117
views
Type casting in MPLABX Harmony IDE
I am tryed following code on online C compiler it works properly. but when I'm using this logic in MPLAb X harmony IDE it not working it not printing value of result. it shows:
result= and stops next ...
0
votes
1
answer
293
views
MPLABX MPASM assembler Alternative with code folding option
I just started using MPLABX from MPLAB 8.92. I like the new setup but the code folding option is not available for MPASM. Is there an alternative assembler that that will offer code folding ? Is ther ...
0
votes
1
answer
1k
views
MPLAB X IDE failing to upload
Everything was working nicely then I tried to build and run some TCP/IP RTOS sample code. Since then I keep getting
java.lang.RuntimeException: java.lang.RuntimeException: RDDI_DAP_OPERATION_FAILED
...
0
votes
1
answer
268
views
Typedef error after including header file multiple times
I am writing c code targeting a SAME51 based Atmel/ Microchip processor. I am using Microchip's MPLABX to compile and run the code.
I have header files that are included multiple times in multiple ....
0
votes
3
answers
1k
views
Why is my C program continuously run forever without the usage of loop?
I am testing my microcontroller PIC18f4550 with the following circuit on Proteus simulation software.
My objective is to turn the led on for one second and turn it off.
Following is my code:
#include ...
-1
votes
2
answers
135
views
PIC microcontroller automatically pressed
I'm trying to turn on a LED on a pic24FV16KA301 microcontroller, through a button press. The problem is the LED automatically goes on. After some altering it looks like the PIC is automatically ...
0
votes
1
answer
48
views
Loop does not stop even after passing condition [closed]
void initTimer (void);
void delay (unsigned long milli);
void main (void)
{
//initialize peripherals
initTimer();
//PORTB all outputs
TRISB = 0;
LATB = 0;
TRISA = 0x0F;
ANSA = 0;
...
0
votes
0
answers
62
views
Code does not stop at loop where condition is met
if ((PORTAbits.RA0 == 0) && (PORTAbits.RA1 == 0) && (PORTAbits.RA2 == 0))
{
while(1){
LATBbits.LATB6 = 1;
delay (SHORT_DELAY);
...
0
votes
2
answers
4k
views
MPLAB X IDE v5.45 Problem with Low Voltage Programming
The program builds fine, but when I tried to flash code from snap debugger to PIC16F15313 in MPLAB its giving this error. Even though low voltage programming is enabled in code.
"MPLAB has ...
0
votes
1
answer
129
views
Loop condition does not stop the program
void initTimer (void);
void delay (unsigned long milli);
unsigned int counter;
unsigned int zero = 0b0000000000000000;
unsigned int one = 0b0000000001000000;
int main (void)
{
initTimer();
...
0
votes
1
answer
86
views
Ininite loop error when print a sensor status pic18f4520
I have a problem with my code, I am programming a microcontroller pic18f4520 to read two reflective sensors, but when I print a status from any sensor become a infinite loop let me explain better
...
2
votes
1
answer
90
views
How can i approach this program with creating a Boolean variable instead of cycling through branches?
I am programming a PIC1847q processor on the curiosity HPC board. My task is to design a battlestar galactica cyclon visor using the LEDs on the board. My current code does infact create and replicate ...
1
vote
1
answer
519
views
Compiler defined symbol not found from code
I'm using AVR GCC compiler v5.4.0 under MPLAB X IDE v5.45.
I defined a symbol for the compiler in the avr-as-pre section. It adds the following to the invoked command:
-DF_CPU=32000000UL
Inside the ...
0
votes
1
answer
744
views
Change link colors in output window of MPLAB X IDE v5.45
I'm using MPLAB X IDE v5.45 under Ubuntu and due to my color setup the links in the output window are almost unreadable:
I went through Tools > Options > Font & Colors but I didn't find ...
1
vote
1
answer
212
views
Trouble setting up PWM using bitwise operations PIC12F615 MPLAB X
For whatever reason, I have never been able to use bitshifts in MPLAB. Here is some code I'm working on to setup PWM on the PIC12F615:
// configuration of PWM
void configPWM(void) {
// Disable the ...
0
votes
0
answers
74
views
PIC24F issues reading analog AC microphone values
I am using a PIC24FJ128GA010 to read the microphone values. When I read the raw values from the sensor I am getting like 270 but over time the value will go down to 90 and stop. 3.3V is being used and ...
0
votes
2
answers
548
views
what's the correct syntax here?
Start MOVLW 0xff ; 0xff=b'11111111
MOVWF PORTA ; on
MOVLW 0x00 ;
MOVWF PORTA ; off
GOTO Start
So I was following a video ...
0
votes
1
answer
2k
views
I do not know if I am initializing ADC correctly for PIC24F
I am using a Microchip Pic24f board to receive 3 analog inputs from a accelerometer.
I am getting a signal for AN0 but for AN1 and AN2 there is a signal but the values are not right.
Here is the code ...
0
votes
1
answer
2k
views
How to read multiple ADC channels using PIC24; can only get AN0
I am using a PIC24 to read data using 3 analog inputs but am only getting 1 to show the right result. I looked everywhere on the internet and am still not able to get the code to work.
I am trying to ...
2
votes
1
answer
434
views
From MPLAB 8.92 to MPLAB X 5.25: how do I programmatically halt the simulator now?
I wrote some test code in PIC assembly language that I have no intention to run on the actual PIC MCU, rather it is meant to generate the trace files so that they can be analyzed later with a separate ...
1
vote
1
answer
415
views
Handling nested dependencies in C++
I am new to programming in C++, my background is in the frontend space with react.
I've started a side project with micro-controllers and I'm having some problems with understanding how handling ...
0
votes
1
answer
506
views
How to configure my Modbus rtu 3.5 character delay and 1.5 character delay using MPLAB mcc
I'm using PIC16f series microcontroller for my application. For that, how to configure 3.5 character time and 1.5 character time for MODBUS-RTU in MPLAB code configurator.
0
votes
1
answer
1k
views
MPLAB X XC8 Error: 0: (499) undefined symbol (VS Code)
I am new to coding in C and I cannot figure out the proper way to link my files together so that I can use code from one class in another. I'm working on a project which will likely become a very long ...
0
votes
1
answer
365
views
PicSimlab 0.7.5 version is shutting down very frequently within 1 minute
picsimlab tool version 0.7.5 tool is closing down within 1minute after opening the tool in windows 10.
I tried uninstalling and installing again, still facing same issue.
I am trying to load hex file ...
1
vote
1
answer
207
views
Using WINC1500 with a PIC32, scan not working properly
I'm currently working on a project using a PIC32 and the wifi module ATWINC1500. I won't be able to give all the code but I'm on a test function that I can share.
First, here is some settings and ...
0
votes
1
answer
462
views
MPLAB X freeze building using printf
My setup is:
MPLAB X IDE v3.40
C30 compiler v3.31
PIC24FJ128GA306
Mi problem comes when I try to use printf. I can print a string but not a variable.
This line is correctly bompiled:
printf("HI&...
0
votes
1
answer
369
views
"error: expected identifier ..." when using trying to use chipKit core in MPLAB, but error is not present when Arduino IDE
As the title states, I'm trying to use the chipkit core in MPLAB X IDE. I'm doing this because I want to be able to properly debug the PIC32 board that I'm using for this project, but I don't have the ...
0
votes
0
answers
273
views
ATWINC1500 SSL socket connect aborted
I am currently working with ATWINC1500 wifi network module on their WiFi click7 board which communicate with PIC32 (FreeRTOS Curiosity PIC32MZ EF).
I'm trying to create tls client example (TLS 1.2) ...
0
votes
1
answer
397
views
PIC16 and EUSART
I'm trying to get the EUSART setup over RS485 on a PIC16F. For the RS485 i have an external circuit MAX3430 to make the conversion to RS485. I am able to both send and receive data. The problem I have ...
0
votes
0
answers
94
views
MPLABX - PIC24FJ1024GB610 - multiple definition error [duplicate]
I am programming a simple gpio program for a PIC24FJ1024GB610 microcontroller in C using MPLABX. I have created two methods that work similarly to Arduino pin direction and digital write methods. I ...
0
votes
1
answer
888
views
How to detect periodic GPIO change in PIC
I am using a PIC12F675 microcontroller with the MPLAB X IDE. I am trying to detect the state of a machine by monitoring an LED with a photoresistor. I have the circuit working such that when the ...
0
votes
1
answer
112
views
Are there any code examples available for AWS Freertos for implementing a DHCP Server and HTTPS server?
I am wondering if anyone know if there is any sample code for implementing DHCP server and https server for AWS Freertos or if not then maybe for Freertos? The purpose for this is purely for WiFi ...
0
votes
1
answer
150
views
wdt on pic with c get errors
I have this:
static void ButtonDebounce(void)
{
static uint16_t debounceCounter = 0;
// Check if only one S3 or s4 button pressed since if I have bouncing several
// interrupts will occur and will ...
1
vote
0
answers
76
views
mclr reset the system pic with #pragma
I have this ISR:
static void ButtonDebounce(void)
{
static uint16_t debounceCounter = 0;
// Check if only one S3 or s4 button pressed since if I have bouncing several
// interrupts will ...
0
votes
0
answers
47
views
insert a humidity sensor into mplab
I have to implement an assignment with PIC24FJ1024GB610 and above the other peripherals I have to add a humidity sensor like HIH-4030/31, I also have to use the built-in temperature sensor. I ...
1
vote
1
answer
89
views
How to build AWS Freertos with MPLAB for PIC32MZ1025W104
It seem to be missing the processor ports file, referenced in ports_p32xxxx.h.
../../../../../vendors/microchip/harmony/v2.05/framework/peripheral/ports/processor/ports_p32xxxx.h:779:6: error: #error ...
1
vote
1
answer
216
views
How to use the Harmony Configurator with AWS FreeRTOS project in MPLAB
I'm trying to setup a new project for PIC32WFI32E, I have downloaded the AWS FreeRTOS git repository. My issue is that if I open the project then I cannot make use MPLAB Harmony Configurator to setup ...
0
votes
1
answer
138
views
Wrong value in the working register after a MOVF operation
How do I resolve obtaining the wrong value in the W-register after a MOVF operation?
I am debugging a code which builds & programs successfully, but does not have the desired result when powered ...
1
vote
2
answers
110
views
Detect digital input from 2v5 src on a chip with 3v3 power?
I'm using a 12F675 PIC and I have programmed it to make 3 LEDs flash in sequence. I want it to only do this when a particular input is NOT received. The PIC is running at 3v3 and that seems to be ...
0
votes
0
answers
19
views
Identify what kind of waveform i get at an analog input
I'm currently using MPLABX to code Pic16f877a, I use Proteus as a simulator, I have to identify what type of waveform I get at the analog input, my frequency is not fixed but I can store it. I wanted ...
0
votes
2
answers
513
views
how ti fix "could not spawn langauge tool" error?
include "P16F84A.inc"
cblock 0x33
V1
V2
V3
endc
movlw 3
movwf V1
movlw 4
movwf V2
movf V1,W
addwf V2 , W
movf V2,0
movwf V3
end
Clean: Deleting intermediary and output files. ...
2
votes
3
answers
241
views
Configurations variables removed by compiler
I am attempting to define a set of global variables which will configure my device, about 10 in a dedicated .c file, that will be changed on a regular basis at compile time (as per device requirements)...
0
votes
1
answer
308
views
I2C communication between PIC32 and LCD
I am trying to communicate with LCD2041 using I2C . I am using PIC32MM curiosity board . I wrote the following code on MP lab code configurator , but the status for I2c communications is stuck on ...
0
votes
1
answer
2k
views
Cannot send or receive data through UART on PIC24F development board
I am trying to upload a simple UART testing program to a PIC24F Curiosity Board using MPLAB X and validate data transmission using TeraTerm. This evaluation board uses a PIC24FJ128GA204 ...