Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F877a channel switching Problem

Status
Not open for further replies.

STSCBE

Member level 2
Joined
Jul 9, 2016
Messages
43
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
360
PIC16F877a ADC channel switching Problem

Hello,
I'm using MPLAB V8.3 version. Im having problem with 2 ADC input conversion.. while Proteus running getting this message and while Hardware, it clashes two channels..
ADC conversion started before 'wait' time has expired following previous conversion or channel change
Code:
ADCON0=0x05;
ADCON1=0xC0;
while(ADGO);

ADCON0=0x0D;
ADCON1=0xC0;
while(ADGO);
Give solution. Please...
 

Try "GO_nDONE" as the bit to test, that is what it is named in MPLABX 4.05 but it is probably the same in MPLAB 8.3.
It is better to fully qualify the name as "ADCON0.GO_nDONE" in case ADGO is just a bit number definition.

Brian.
 

Try "GO_nDONE" as the bit to test, that is what it is named in MPLABX 4.05 but it is probably the same in MPLAB 8.3.
It is better to fully qualify the name as "ADCON0.GO_nDONE" in case ADGO is just a bit number definition.

Brian.

Thanks,
But V8.3 Hitech compiler says, Undefined identifier.....
 

Try ADCON0.ADGO then. I use the XC compilers so I can't check bit definitions on Hitech programs.
The problem I find when converting some source files is for example, ADGO might be defined as '0' because that's it's bit position in the ADCON register but when written in source code it would be used only as that number without reference to the register. That would make your line:
Code:
while(ADGO);
translate to:
Code:
while(0);
which obviously would cause your problem.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top