View previous topic :: View next topic |
Author |
Message |
mayur.k.vadukul
Joined: 07 Jul 2022 Posts: 40
|
PIC18F65J11 & Port A |
Posted: Fri Jun 23, 2023 8:56 am |
|
|
I have the working code for PIC18F66K22 and I decided to change the microprocessor to PIC18F65J11 which is pin compatible.
I have changed the device setting and compiled the code which was fine but for whatever reason the Port A pins which are defined as Inputs are not being detected in the code. I have checked hardware, i.e. place scope on pin to see whether it goes High/Low but the software does not respond.
I went into the debug mode and the code comes to Pin detection but does not detect High.
Has anyone encountered the same issue? There was compiler bug associated with baud rate with PIC18F65J11, and not sure whether this is the similar thing. _________________ MVadukul |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Jun 23, 2023 9:19 am |
|
|
How is your ADC setup?.
This is one of the chips where on the input pins where an analog selection
overrides a digital selection. Some of the newer chips have a separate
ANSEL register for this (this one doesn't), but still if a pin is selected
as analog, it won't function for digital input. By default the ADC and
comparator wake up selecting a lot of the pins..... |
|
|
mayur.k.vadukul
Joined: 07 Jul 2022 Posts: 40
|
PIC18F65J11 & Port A |
Posted: Fri Jun 23, 2023 9:43 am |
|
|
@Ttelmah,
Thank you. It was A2D settings.
I would put this as inconsistency of the CCS. For the same code, it makes A2D off for 18F66K22, but not for 18F65J11. As practice, it is good to define always, but when I create project through Wizard and not select A2D, I expect it to create the necessary automatically.
Never mind. Thanks again and to make my weekend without worries. _________________ MVadukul |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Jun 23, 2023 11:45 am |
|
|
Glad I got it.
Historically CCS turned most things off by default. They then tended to
get complaints when things were turned off rather than defaulting as
shown in the data sheets, so they have slowly tended to do less of this... |
|
|
|