Questions tagged [pic24]

PIC24 devices are general purpose microcontrollers, manufactured by Microchip Technology.

pic24
Filter by
Sorted by
Tagged with
0 votes
0 answers
39 views

PIC24HJ XC16 Linker Script Interrupt Vector Table

I am working on a bootloader for a PIC24HJ series MCU. While going through the linker script I noticed something, tried a google search, searched documentation, GCC linker documentation, I'm out of ...
nurchi's user avatar
  • 780
1 vote
0 answers
50 views

How can I use the DMA of a PIC24F microcontroller?

I want to use the DMA of a PIC24FJ1024GB610 that I have. Basically, what I want is to read some analog inputs and store them in a memory space that the CPU can access whenever it wants to perform ...
WalterPH's user avatar
  • 113
0 votes
2 answers
114 views

Does a software reset clear the GPIOs state on PIC24?

I am trying to find out if a software reset would cause the GPIO state to default back to a reset states on PIC24F? The reset command i would like to use: asm ("reset"); I could not find ...
Guillaume.P's user avatar
2 votes
1 answer
145 views

How to remove unwanted data padding from custom sections on XC16

I am currently trying to dev a firmware for a PIC24F using the whole microchip stack (xc16, mcc, mplab X IDE, etc ...) (not necessarily relevant but i work on a debian 22) Doesn't really matter why ...
gokasor's user avatar
  • 41
0 votes
0 answers
110 views

How to turn on LED in pıc24FJ124 and UART by reading message useing UART1_read()

I can read and write message with uart and access port and it work correctly. Now I want to turn on one of the leds on the circuit For example when i send "ON" it will turn on the led( ex:...
abduallah Azizi's user avatar
0 votes
1 answer
556 views

Error: java.io.IOException: read failed, socket might closed or timeout, read ret: -1 when connecting to BLE module (Kotlin)

I am trying to connect to an RN4870 BLE module using my Kotlin app, but keep getting an error when trying to connect a socket. I am able to pair my phone and the BLE module, and verify in kotlin they ...
jamesMedved's user avatar
1 vote
2 answers
104 views

How can I return a pointer to registers with different types

I would like to write a function which returns a pointer to either one of two special function registers (SFRs). These SFRs have different types, but their types are identical except for their names: #...
abessman's user avatar
  • 125
0 votes
1 answer
261 views

SPI Slave using PIC24FJ64GP202

I have trouble with a PIC24FJ64GP202 to work as an spi slave. I have simplified the code to the minimum possible in order to find the problem. In this simple code, an spi master (it is an ATSAMD51N19A)...
PLLefebvre's user avatar
0 votes
1 answer
461 views

Havig trouble with SPI in PIC24FJ256GB412

I am trying to configure a PIC24FJ256GB412 to use the SPI interface with an ADC module(ADS114S08). And now, I can view data by oscilloscope(by measuring the SDI pin). But the SPI1BUFL didn't receive ...
John Jhong's user avatar
1 vote
0 answers
95 views

Display control PIC24FJ128GC010

I work with the PIC24FJ128GC010 on the MPLAB® Starter Kit for Intelligent.Integrated.Analog with the compiler XC16. I will read the 16-bit-Sigma-Delta ADC and show the result on the LCD-Display. I ...
VGDS's user avatar
  • 11
1 vote
2 answers
1k views

PWM settings in PIC24FJ64GA002

Good day, I am working with a PIC24FJ64GA002 microcontroller and am struggling to get the PWM working for a servo I want to use. My code is as follows: // PIC24FJ64GA002 Configuration Bit Settings //...
Bottle's user avatar
  • 23
0 votes
0 answers
93 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 ...
Nicodemous's user avatar
2 votes
1 answer
350 views

error: invalid operands to binary >> (have 'float' and 'int')

I am trying to cast float to bitwise int in C. Here's my code snippet: write_eeprom(INDEX_CONFIG_TEMPERATURE_OFFSET_HIGH_INT, (unsigned int) (temperature_offset>>16)); write_eeprom(...
Holebas's user avatar
  • 21
1 vote
0 answers
1k views

MPLAB IDE x 3.55 best way to include files in project

I am compiling a project in which I am using USB as a data logger. The host PIC micro is PIC24FJ, however the compiler is always complaining about NO such file or directory. I have tries the following ...
Jamal2189's user avatar
0 votes
1 answer
483 views

PIC24FJ128GA204 can not wake up from deep sleep

I've been trying to wake my PIC controller from deep sleep however I can not wake it up. According to the datasheet it says there are 3 ways to wake it up: 1)RTCC alarm 2)External Interrupt 3)Deep ...
PVH_1907's user avatar
3 votes
1 answer
1k views

Is this a safe way to disable interrupts on PIC24?

I am working on a project that uses a Microchip PIC24FJ256GA702. For several days I have been looking for an intermittent bug with some UART code. It uses an interrupt service routine (ISR) to ...
James's user avatar
  • 5,812
0 votes
1 answer
294 views

Can't define __BOOTLOADER for linker script of PIC24FJ128GC006

I am making a USB Bootloader for PIC24FJ128GC006 and I am going to map part of the flash memory for the Bootloader and the Application code. I added the linker script from Microchip MLA v2015_08 usb ...
RndSen's user avatar
  • 11
1 vote
0 answers
202 views

Problem in Flash Programming of PIC24FJ128GC006

I am making a USB Bootloader for PIC24FJ. I am now in the process of writing to flash memory the application code hex file through a software and without using ICD3. After downloading the application ...
RndSen's user avatar
  • 11
0 votes
0 answers
40 views

Interfacing PIC24E with ICD3

I am trying to connect ICD-3 to PIC24E micro-controller, and I'm finding difficulty in detecting the device. All the recommendations, as in ICD-3 interface document has been ensured, and still on ...
Gautham Suresh's user avatar
0 votes
0 answers
23 views

Interfacing 32nos. of analog signals to PIC24EP**814 Microcontroller

How can I interface 32 nos. of analog channels or signals to a PIC 24EP***814 Microcontroller?
Gautham's user avatar
0 votes
1 answer
564 views

UART PIC24 - Receive continuous stream of ASCII characters

I am currently using the PIC24 with UART and am able to receive (Rx) and transmit (Tx) characters. The problem arises when trying to receive a continuous stream of characters, where there is no delay ...
DARTH's user avatar
  • 1
0 votes
1 answer
2k views

Redirect Printf to UART on PIC24F Curiosity

I'm trying to redirect Printf to UART to output to a console like CoolTerm etc, without success, I'm using the "PIC24F Curiosity Development Board" with PIC24FJ128GA204, MPLAB X v5.25, MCC v3.85.1 ...
Daniel Surizon's user avatar
0 votes
1 answer
84 views

Is this "mov" command properly implemented from my text book?

I am currently solving some problems out of "Microcontrollers Second Edition" and the question is asking: mov [ W1],W0 The initial register memory contents of W0 = 0x1004 W1 = 0x1006 W3 = ...
Frio's user avatar
  • 1
2 votes
0 answers
132 views

ACKEN bit on PIC24FJ64GA002 not clearing after acknowledge sequence

uint8_t i2c_read(void) { uint8_t u8_readData; uint8_t u8_ackBit = 0; while(I2C1CON & 0x1F); //wait for idle I2C1CONbits.RCEN = 1; //prepare device to receive ...
CODE_guy's user avatar
1 vote
1 answer
848 views

What is the xc16 command to obtain disassembly (listing.disasm) file?

I want to obtain disassembly (listing.disasm) file for my project. My current compilation commands produces .elf, .map and .hex files. How do I (Or what commands) produce a single listing.disasm? Note:...
M Sharath Hegde's user avatar
2 votes
1 answer
441 views

How loops are implemented in PIC24F assembly code

Below is the disassembly of following C code: 268: while (Counter < 250) 269: { 270: Counter++; 271: } Disassembly: ...
M Sharath Hegde's user avatar
0 votes
1 answer
127 views

objcopy for pic30/xc16 - where to find, analogs

I am working with a non-standalone project on PIC24 which requires a bootloader and I want to debug it with a bootloader. I am able to produce an .hex file that contains the application code with the ...
Carry's user avatar
  • 11
2 votes
0 answers
64 views

SCPI_ParamString multiple string as input

I am using the SCPI library of commands, namely SCPI_ParamString. The function I am trying to implement takes in 2 strings and an integer as inputs. To verify that my code is reading the inputs ...
Ashton Meginnis's user avatar
0 votes
1 answer
393 views

Timer accuracy and interrupts

I have a PIC24F Curiosity Board (PIC24FJ128GA204) and I'm trying to get an accurate second timing with the TIM1. As a source I'm using the secondary oscillator, which uses a 32678 kHz xtl. The timer ...
perencia's user avatar
  • 1,531
0 votes
1 answer
149 views

Sign Extended Instruction for PIC24 [closed]

How you can implement the Sign Extended Instruction in VHDL (in ALU) for PIC24? I need to implement the following instructions and I don't have any idea how to implement SE. LOOP: mov 0x1020, w1 ;...
Andreea Dumitru's user avatar
0 votes
1 answer
411 views

Where can I find documentation on SPI2STATbits?

I've recently come across spi2statbits in the following function: int WriteSPI2( int data) { int f; SPI2BUF = data; // write to buffer for TX while( !SPI2STATbits.SPIRBF) ...
SeanJ's user avatar
  • 1,215
1 vote
1 answer
187 views

PIC24H Uart send only 4 bits correct - need to split

I am working with the explorer16/32 evb and trying to send data to UART. I tried UART1, UART2 with and without interrupts and got the same problem all the time. It appeared that in order to send 1 ...
user1820451's user avatar
1 vote
2 answers
118 views

Where is file type mainp24f.c in MPLAB?

I have just started (again!) Programming 16-bit Microcontrollers in C, Learning to Fly the PIC24 MPLAB has changed a bit since I last used it! One of the first things I am meant to do is install the ...
SeanJ's user avatar
  • 1,215
1 vote
0 answers
1k views

PIC 24F I2C slave issue

PIC 24F as an I2C slave has lock up issues sending multiple data bytes to the master (MASTER READ). The PIC (specifically 24FJ128GB202) as an I2C slave receiving data (MASTER WRITE) works perfectly, ...
Ronzzer's user avatar
  • 11
0 votes
1 answer
654 views

Timer1 on PIC24F16KA102 don't work

I want to configure timer1 of PIC24F16KA102 to count it. The clock source must be the internal clock of 8 MHz. I configured the register T1CON and set on high level the bit TON to start the timer. ...
Fabio's user avatar
  • 1
0 votes
1 answer
946 views

PIC24F eeprom and XC16 MPLAB

Can say me anyone why I get error when use this code in XC16 MPLAB? PIC24FJ64GA004 unsigned int __attribute__ ((space(eedata))) eeData[] = {100, 1, 22, 33, 44, 156, 3, 10, 1}; error: space(eedata) ...
Krik99's user avatar
  • 3
0 votes
1 answer
357 views

Display on 7-SEGMENT

I'm writing a code that displays temperature on the following 7 SEGMENT LCD: LCD-H301C31TF Datasheet I'm using PIC24FJ64GA006 Micro. I can only use PORTB[13:6], PORTD[0:7], PORTE[0:7] port pins. ...
Yavni's user avatar
  • 5
0 votes
1 answer
90 views

PIC24F - Set LATx specific pins without effecting the other pins

Is there a way to set specific port pins without effecting other pins at the same port? For example: I used LATB[13:6] for 7-segment LCD, the rest LATB bits are used for other purposes. Now I need ...
Yavni's user avatar
  • 5
-5 votes
2 answers
328 views

Warning in array of pointers "initialization from incompatible pointer type"

What I am asking here can be very easy to solve. Code works fine but this warning is bugging me! //initailize array elements char ZeroA[6] = {0xC0,0x07,0x40,0x04,0xC0,0x07,}; char OneA[6] ...
nikhil patil's user avatar
0 votes
0 answers
2k views

Error No rule to make target PIC24 assembler

I'm trying to make a simple program to turn on a LED using a pic24fv32ka301 in assembler but I can't get it work, when trying to compile in MPLAB using de ASM30 compiler it throws the following error: ...
user2461687's user avatar
0 votes
3 answers
4k views

C - Hertz to Seconds and how to get the proper time for a delay?

I am playing around with a PIC 24 and currently I have a bit of a problem with converting hertz to seconds and then using it as a delay for a signal send to a piezo piece(buzzer, zoomer, speaker, etc) ...
Joe Carr's user avatar
  • 445
0 votes
1 answer
119 views

MAX824/825 IC Watchdog interfacing with PIC or ATMEL

Could someone help me to interface PIC24 for instance with a external watchdog? http://datasheets.maximintegrated.com/en/ds/MAX823-MAX825Z.pdf A kind of beta version could be : WDI=1; while(1) { if(...
Căpățînă Alexandru Ioan's user avatar
-2 votes
2 answers
108 views

Connecting multiple devices

i have a bit of a tricky question. My case is this: I have to handle a large amount of PCB (up to 20) with some hardware and a PIC24FJ128GA306 the microchip only comes with a bootloader, and i want ...
Claudi's user avatar
  • 125
1 vote
1 answer
304 views

PIC24F32KA302 Sleep mode

I want to configure PIC24F32KA302 to go to Sleep mode and wake up by RTC interrupt. However, after waking up, my program runs again from the beginning. The datasheet mentions that: - If the assigned ...
uv_utna's user avatar
  • 61
0 votes
0 answers
634 views

PIC24F32KA302 RTC configuration

I want to configure RTC of PIC24F32KA302 so that LED toggles every second. Howerver, it does not work. Please, find attach below RTC code which I write to initialize internal RTC. IDE: MPLAB X IDE ...
uv_utna's user avatar
  • 61
0 votes
0 answers
930 views

UART RX issue (PIC24)

I have a problem with my PIC24F16KA102. I am using the PicKit2 UART Tool to communicate with the PC. So, these are my routines: UART1Init: void UART1Init(int BAUDRATE) { U1BRG = BAUDRATE; ...
alex20's user avatar
  • 1
0 votes
1 answer
643 views

How to align variables in a struct for PIC24 chips?

I have this struct, but knowing that every 4th byte is not used in memory, I need to align the struct correctly in memory. I'm not exactly sure how to do this, though I know that I'm supposed to and I ...
Eric Diviney's user avatar
1 vote
1 answer
488 views

PIC24FJ128GA010 Uart not working

I am using the above mentioned pic controller on explorer 16 board. I am trying to configure UART but it is not working My code looks something like this. enter code here #define Bit8_No_Parity ...
Sanky's user avatar
  • 13
1 vote
1 answer
700 views

Is there an example program for PIC24f Starter kit to be a Host serial emulator?

The USB host example sent with the kit is only for reading files not sending/receiving serial data. I searched Microchip, forums and google to no avail. As I am sure many of you know the microchip USB ...
D.R.'s user avatar
  • 11
1 vote
1 answer
1k views

PIC- SPI slave select not functioning

I am Using PIC24FJ128GB202 I want to communicate with a slave device which does not need to respond. So configuration is as follows I have written code as /* * File: main.c * Author: ...
nikhil patil's user avatar