View previous topic :: View next topic |
Author |
Message |
jaikumar
Joined: 15 Dec 2006 Posts: 109
|
PIC24FV16KM204 regarding RA6 |
Posted: Thu Aug 08, 2013 12:50 am |
|
|
Hi All,
Compiler 5.010.
In the device file: 24FV16KM204.h, the data for PIN_A6 was missing.
Is there a reason why ccs left that port pin(RA6).
I added the line as below.
But the output would not toggle for PIN_A6.
Could someone please help.
Thanks and Regards,
Jai.
24FV16KM204.h
------------------
Code: |
#define PIN_A0 5648
#define PIN_A1 5649
#define PIN_A2 5650
#define PIN_A3 5651
#define PIN_A4 5652
#define PIN_A5 5653
#define PIN_A6 5654 <--- this was added by me.
#define PIN_A7 5655
#define PIN_A8 5656
#define PIN_A9 5657
#define PIN_A10 5658
#define PIN_A11 5659
|
main.h
--------
Code: |
#include <H:\Program Files\PICC\Projects\PIC24_proj1\24FV16KM204.h>
#FUSES HS
#FUSES NOWDT //No Watch Dog Timer
#FUSES CKSFSM //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES NOBROWNOUT //No brownout reset
#device ICSP=1
#use delay(crystal=20000000)
#define LED1 PIN_A6
#define LED2 PIN_A7
#define DELAY 1000
|
main.c
--------
Code: |
#include <main.h>
void main()
{
setup_adc(ADC_OFF);
setup_comparator(NC_NC,NC_NC);
setup_vref(FALSE);
setup_low_volt_detect(FALSE);
//Example blinking LED program
while(true)
{
output_low(LED1);
output_low(LED2);
delay_ms(DELAY);
output_high(LED1);
output_high(LED2);
delay_ms(DELAY);
}
}
|
|
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Thu Aug 08, 2013 1:29 am |
|
|
If you read the datasheet, you'll see that on the many versions of this processor family that pin is used for Vddcore/Vcap instead of RA6. In other words RA6 may not be usable on that processor.
Last edited by RF_Developer on Thu Aug 08, 2013 1:52 am; edited 1 time in total |
|
|
jaikumar
Joined: 15 Dec 2006 Posts: 109
|
|
Posted: Thu Aug 08, 2013 1:41 am |
|
|
Thank you. I just read the datasheet.
Sorry, Next time will read datasheet before posting.
regards,
jai. |
|
|
|