Using registers

General discussion on mikroBasic.
Post Reply
Author
Message
Nemweb
Posts: 58
Joined: 04 Jul 2011 18:42

Using registers

#1 Post by Nemweb » 31 Aug 2011 21:51

Hi guys. I got a big problem here. I was trying to compile a code to my PIC16F628A and I got a bug: the mikrobasic says: "unresolved extern 'ADCON0' " and "unresolved extern 'ADRES' ". Can someone help me? I don't now how to configure these registers, and I need it as soon as possible. Follow my code:

Code: Select all

program ADC

symbol A1=portb.0
symbol B1=portb.1
symbol C1=portb.2
symbol D1=portb.3

main:
TRISA=%11111111
TRISB=%00000000
ADC_Init
A1=0
B1=0
C1=0
D1=0
loop:
if ADC_read(2) <= 205 then
A1=0
B1=0
C1=0
D1=0
else
end if
if ADC_Read(2) <= 410 then
A1=1
else
end if
end.

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: Using registers

#2 Post by hexreader » 10 Sep 2011 10:07

I see this post is quite old, so I guess you already worked out the answer for yourself.

In case it is of any use, the answer is that PIC16F628A does not have an Analogue to Digital Converter.

It has two analogue comparators, but no ADC. All this information is in the datasheet.

There will be no ADC library listed when you select PIC16F628A and there are no ADC registers within the PIC.

If you want to use ADC, you will need to choose a different PIC.

Hope this helps
Start every day with a smile...... (get it over with) :)

Nemweb
Posts: 58
Joined: 04 Jul 2011 18:42

Re: Using registers

#3 Post by Nemweb » 10 Sep 2011 21:38

oK thanks, buut how I'll use the registers and how I'll configure the ADC with a PIC that have the ADC?

Post Reply

Return to “mikroBasic General”