Questions tagged [mplab]

IDE for the Microchip PIC series of microcontrollers.

Integrated Development Environment for the Microchip PIC series of microcontrollers.

614 questions
0
votes
1 answer

I2C Sampling Rate

I'm having trouble trying to sample I2C slave devices using a dsPIC33f microcontroller. I am using the PICs internal timer1 timer to 'tick' over at a defined sampling rate and grab the necessary data. Unfortunately the results aren't being obtained…
ritchie888
  • 583
  • 3
  • 12
  • 27
0
votes
1 answer

ADC dsPIC33 issue

I'm struggling to get the ADC to work with my device. I'm using the dsPIC33FJ128GP802 and have attempted to start off slow with manual sampling and conversion. My code is posted below, I've set every register for ADC and have then attempted to…
ritchie888
  • 583
  • 3
  • 12
  • 27
0
votes
2 answers

How to address all fields in a struct like these registers?

If you've programmed a microcontroller, you're probably familiar with manipulating select bits of a given register, or writing a byte to the whole thing. On a PIC using C for example, I can write an entire byte to PORTA to set all the bits, or I can…
BB ON
  • 251
  • 1
  • 3
  • 15
0
votes
1 answer

MpLab Link Error: Could Not Allocate Section (C30 Compiler)

I have put the two pieces of code together (originally described in This Question Here). I have now just experienced this error from MpLab (Microchip MPLAB C30) Link Error: Could not allocate section .nbss, size = 20004 bytes, attributes = bss near…
User.1
  • 2,562
  • 3
  • 33
  • 40
0
votes
1 answer

C18: Will the compiler "know" a function call will never return?

I'm building a 16 state FSM on a PIC18 with C18. I'm considering having each state as its own function which jumps to and gets jumped by other states. I'm tempted to just write a branch cases of "state##();"s at the end of each state to determine…
BB ON
  • 251
  • 1
  • 3
  • 15
0
votes
1 answer

PIC24 Breakpoint on Either Read Or Write Memory Access

My environment... PIC24 MpLab (V.8.80) ICD 3 I have a byte that I want to watch, to see which routines are reading and which ones are actually writing, and when it happens I can only set a breakpoint on when the byte is written, or when it is…
User.1
  • 2,562
  • 3
  • 33
  • 40
0
votes
1 answer

Odd behavior with switch statement using C30 and MPLAB X

I am experimenting an strange problem with C30 and MPLAB X, I have this piece of code: unsigned char mode; switch(mode){ // Eligo el modo que se envio a traves del UART case FRECUENCIMETER: …
Andres
  • 6,080
  • 13
  • 60
  • 110
0
votes
1 answer

Where is there a key to microchip mplab source editor syntax color highlighting?

I must be missing something obvious, but, in spite of a lot of internet searching, I cannot find a key to the colours used for syntax highlighting in Microchip MPLAB source code editor. I am sure that interpreting these will help me discover an…
Harry Weston
  • 696
  • 8
  • 22
0
votes
2 answers

warning: illegal conversion of pointer to integer with char and structure to string

I have a really annoying problem... I have to be able to display some text from a structure onto an LCD display from micro controller. These are the affected areas: struct menu_id { char id; char menu[11]; char submenu; }; void main…
Reemahs
  • 5
  • 2
  • 5
0
votes
1 answer

LATCH and PORT, dsPIC33f

I am referring to a simple program (example 2) on http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2123¶m=en024284 #include "p33Fxxxx.h" #pragma config WDT = OFF void main (void) { TRISB = 0; /* Reset the LEDs */ …
0
votes
1 answer

I want to run my motors connected to PIC16F628A ..? I need PIC BASIC code?

I have a PIC16F628A, and I have 2 motors coonnected to pins of that PIC. Pins RB0 and RB1 are connected to right motor. Pins RB2 and RB3 are connected to left motor. I'm using MPLAB as compiler from .pbp to .hex. I want to write a PIC BASIC program…
Jonah
  • 11
  • 1
  • 4
0
votes
1 answer

MPLAB Trace Register

I new to PIC mplab and PICs. I developed a program that I run under the simulator and things seem to be working as expected. Now, I'd like to record what my program is doing on port C. I have a text script that applies stimulus. Once things get…
Mike D
  • 2,753
  • 8
  • 44
  • 77
0
votes
1 answer

XC8 compiler error "no identifier in declaration"

I recently took over some C and firmware responsibilities at work, and am having trouble with what seems like a basic issue but one that I can't find the answer to. I'm not very experienced with C, but I've had many years of experience with higher…
kingcoyote
  • 1,145
  • 8
  • 21
0
votes
4 answers

Why do I need this line, it is redundant as far as I can see

Below is a section of code that I use for parsing tokens. There is a line indicated with >>>> near the bottom that is no longer required, but if I comment it out, the cmd_parse_value_lookup() function fails. If i leave it in, the code runs properly.…
Graham
  • 318
  • 1
  • 16
0
votes
3 answers

C30 PIC Compiler won't compile (MPLAB-X IDE)

I am trying to compile a very simple program, I dont understand why it doesn't compile. Here is my program: /* General includes */ #include #include #include #include #include…
Andres
  • 6,080
  • 13
  • 60
  • 110