Searching \ for 'No Luck With 18F2620' 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: 'No Luck With 18F2620'.

Truncated match.
PICList Thread
'No Luck With 18F2620'
2009\01\08@223212 by solarwind

picon face
I decided to dive into PIC 18 F chips and made a test application
after doing some research on the internet and on the datasheet. I was
still unable to get this very simple program working:

http://pastebin.com/f74456e30

If anyone can please help with this, I would really appreciate it. Thanks!

--
solarwind

2009\01\08@225547 by Marcel Birthelmer

picon face
On Thu, Jan 8, 2009 at 7:31 PM, solarwind <spam_OUTx.solarwind.xTakeThisOuTspamgmail.com> wrote:

> I decided to dive into PIC 18 F chips and made a test application
> after doing some research on the internet and on the datasheet. I was
> still unable to get this very simple program working:
>
> http://pastebin.com/f74456e30
>
> If anyone can please help with this, I would really appreciate it. Thanks!
>
>
You don't need to write to PORTC AND LATB. Only LATB should be written to,
while PORTC should be used for reading.

2009\01\08@231538 by peter green

flavicon
face
solarwind wrote:
> I decided to dive into PIC 18 F chips and made a test application
> after doing some research on the internet and on the datasheet. I was
> still unable to get this very simple program working:
>  
What stage exactly are you stuck at? does your code fail to compile? (if
so with what error?) does it compile but not work?

What is your circuit like?

> http://pastebin.com/f74456e30
>
>  
>__CONFIG(1, IESODIS & FCMDIS & HS);
It looks to me here like you are selecting HS crystal mode

>OSCCON = (OSCCON & 0b10001111) | 0b01100000; //4 MHz
yet here it looks like you are trying to configure the speed of the
internal oscilator

>ADON = 0;
I don't think this has any effect on whether the chip treats pins as
analog inputs or digital inputs (that won't affect you right now because
you are only using outputs but it's something to remember for later).

The correct way to make all pins digital on a 18F4620 or 18F2620 or
18F4520 or 18F2520 (and possiblly other chips too but NOT the first gen
18F452 and 18F252) is to use

ADCON1 = 0x0F

Also while again it's not important in this particular case it's good
practice to use LATx rather than PORTx for output to avoid RMW issues
(writing to both is just pointless since both writes get directed to the
same place).

2009\01\09@013242 by solarwind

picon face
On Thu, Jan 8, 2009 at 11:15 PM, peter green <.....plugwashKILLspamspam@spam@p10link.net> wrote:
> What stage exactly are you stuck at? does your code fail to compile? (if
> so with what error?) does it compile but not work?

It compiles, but when I put a multimeter to the pins, I'm not getting
what I exepect.

> It looks to me here like you are selecting HS crystal mode

What should I be using? All I want is my chip to run at 4 MHz without
an external crystal.

>> OSCCON = (OSCCON & 0b10001111) | 0b01100000; //4 MHz
> yet here it looks like you are trying to configure the speed of the
> internal oscilator

Yep, to run at 4 MHz.

{Quote hidden}

Advice taken.

> Also while again it's not important in this particular case it's good
> practice to use LATx rather than PORTx for output to avoid RMW issues
> (writing to both is just pointless since both writes get directed to the
> same place).

Yep.

--
solarwind

2009\01\09@015342 by solarwind

picon face
Update: I opened up the pic18f4620.h file from HI-TECH's C18 folder
and scrolled down to this:

http://pastebin.com/f50a0e8c1

I guessed that what I'm looking for is this:

RCIO // Internal RC, RA6=IO, RA7=IO

Is it? Well, I hooked up my multimeter and now the pins are reading
correct values. Is this the right internal oscillator? Am I doing it
right?

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