Searching \ for '[PIC] 18f452 and RA2' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=18F
Search entire site for: '18f452 and RA2'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] 18f452 and RA2'
2008\07\09@135839 by Padu

face picon face
I'm trying to make a program that drives a LED on port RA2 on. Actually, I
need to output on RA0..RA3, but it doesn't work.

Here's my code in mikropascal:

program segtest1;
begin
 ADCON0 := $00;
 ADCON1 := 7;
 TRISA := 0;
 PORTA := $FF;
end.


I tried a few different configurations for ADCON1, but nothing seems to
change. The interesting thing is that RA0, 1 and 3 go high, but not RA2....
any ideas besides hardware failure (which I don't believe).

Cheers

Padu

PS: Sorry for the first message without the [PIC] header

2008\07\09@141024 by Tamas Rudnai

face picon face
Try to use the LATA registers instead of writing directly to PORTA, also try
out what happens if you just put and endless loop at the end of the code
(before the 'end.' directive). What might happens is that if Micropascal
does not stop the execution at the 'end.' directive then it may go furter in
the program memory executing all the instructions and there may be some
unexpected code fragments. Just an idea as the port initialization seems to
be ok.

Tamas



On Wed, Jul 9, 2008 at 6:58 PM, Padu <spam_OUTpaduTakeThisOuTspammerlotti.com> wrote:

{Quote hidden}

> -

2008\07\09@141927 by Jan-Erik Soderholm

face picon face
Can you just double check that it isn't
RA4 that you have trouble with.

Or try another 452 chip.

> I tried a few different configurations for ADCON1,

Don't do that, just use whatever is right for you...

Or write a short test-prog i ASM to verify your MP code.

Jan-Erik.

Padu wrote:
{Quote hidden}

2008\07\10@115741 by Mauricio Giovagnini

flavicon
face
Padu escribió:
{Quote hidden}

Padu , check your device datasheet.  In those pins you have
the Analog Comparator Output.


Try adding something like this to your initialization code.


CMCON := 7;


I hope this helps.





--
------------------------------
Mauricio Giovagnini (Maunix)
http://www.maunix.com.ar
Cordoba, Arg.
LinkedIn Profile: http://www.linkedin.com/in/mgiovagnini

2008\07\10@122616 by Tamas Rudnai

face picon face
Hi Mauricio,

> Padu , check your device datasheet.  In those pins you have
> the Analog Comparator Output.

Actually I could not find anything like that in the PIC18FXX2
Datasheet<ww1.microchip.com/downloads/en/DeviceDoc/39564c.pdf>
It's the 18F452, right?

Tamas



On Thu, Jul 10, 2008 at 5:01 PM, Mauricio Giovagnini <
.....maugiovagniniKILLspamspam@spam@yahoo.com.ar> wrote:

{Quote hidden}

>

2008\07\10@151031 by Mauricio Giovagnini

flavicon
face
Tamas Rudnai escribió:
> Hi Mauricio,
>
>> Padu , check your device datasheet.  In those pins you have
>> the Analog Comparator Output.
>
> Actually I could not find anything like that in the PIC18FXX2
> Datasheet<ww1.microchip.com/downloads/en/DeviceDoc/39564c.pdf>
> It's the 18F452, right?
>
> Tamas
>

Thanks Tamas for pointing that.  I missread the PIC, I read
18F4520 (a device that I use very often).  That's why I
answered about the CMCON reg. :)

Is true, the 18F452 does not have a comparator.



--
------------------------------
Mauricio Giovagnini (Maunix)
http://www.maunix.com.ar
Cordoba, Arg.
LinkedIn Profile: http://www.linkedin.com/in/mgiovagnini

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...