PDA

View Full Version : How to config 18LF2620 to work at 3.3v?



edysan
- 21st July 2008, 21:02
Hello !

I have an 18LF2620 which works correct at 5v, but don't work at 3.3v

I don't use any fuse configuration on my program, and the *.inc is original.

I use MPASM v5.20, and pbp 2.5

Some body can help me to do the right config?

Darrel Taylor
- 21st July 2008, 21:15
What frequency is the main oscillator running at?

4Mhz will get you down to 2.0V, but at 40Mhz you have to stay above 4.2V
<br>

edysan
- 21st July 2008, 21:30
I working with 20 MHz resonator.

Darrel Taylor
- 21st July 2008, 22:47
> I don't use any fuse configuration on my program, and the *.inc is original.
> I use MPASM v5.20, and pbp 2.5
> I working with 20 MHz resonator.

PBP 2.50 defaults to the XT oscillator for the 18LF2620.
At 20Mhz you would need the HS oscillator.

If you have not used any configs, and the .inc is original, I don't see how it could work at 5V either.

According to the datasheet, you can go down to 3.0V with a 20Mhz OSC. So that's probably not the problem.

The only other configs that could affect the operation at low voltage is the Brown Out Detecter. But it defaults to 2V. So I don't think that's it either.
<br>

edysan
- 21st July 2008, 23:16
I have try with:
@ DEVICE BOD_OFF
but don't work.

Have you an correct sample?
May be I will need to rewrite some other times the PIC.
It's right to set LVP_ON?

Darrel Taylor
- 21st July 2008, 23:28
Again. You need the HS oscillator.


I have try with:
@ DEVICE BOD_OFF
but don't work.
Since you are using an 18F, you must be using MPASM as the assembler, and MPASM uses __CONFIG instead of DEVICE.

You should probably read this thread.

Presetting Configuration Fuses (PIC Defines) into your Program
http://www.picbasic.co.uk/forum/showthread.php?t=543


It's right to set LVP_ON?

NO! Bad idea, unless you have a special programmer.
<br>

BrianT
- 22nd July 2008, 00:08
I routinely use the PIC 18LF4620 at 3.7 down to 2.5 volts. I run at 4 MHz and the config data I load into the Melabs USB serial programmer is:-


'************* Config Register setup for USB programmer ****************
' OSC = HS, FSCM = En, IESO = En, PwrupTmr = En, BrownOut = Dis
' BOR Volts = 2, WDT = Off, WDTPS = 1:512, CCP2 mux = RB3,
' PortB rst = Digital, LPT1Osc = Low, MCLR = Reset, LVP = Dis
' Enhanced CPU = Dis, All memory = Not Protected
' Note re power consumption. PBP assumes the WDTPS is set to 512.
' SLEEP draws 2.5 uA in this system. Each time sleep times out there
' is a current pulse for 2.5 mSecs at 600 uA. Setting WDTPS = 1024 extends
' the SLEEP internal period by 2 and so the average power drops BUT
' PBP will get the sleep times wrong by the factor of chosen WDTPS:512
'************************************************* ***********


Do NOT enable LVP which is the short life option - you will go mad and die young trying to find intermittent programming problems.

Even when the WDT is disabled, the WDT post scaler is active and to get the sleep times right you must set the WDTPS to 512.

Enabling the WDT adds 2 uA to the sleep current.
Enabling the BOD also adds about 2 uA to the sleep current.

HTH
BrianT

edysan
- 23rd July 2008, 11:21
I have change the ceramic oscillator with an quartz oscillator.
I am not shure if is an HS, but now works!

Thanks for your suggestion.

Have a nice day.

Archangel
- 23rd July 2008, 17:35
I have change the ceramic oscillator with an quartz oscillator.
I am not shure if is an HS, but now works!

Thanks for your suggestion.

Have a nice day.
If you mean you are using an external oscillator . .
Well that is a little like buying a new car because you forgot to hook up the battery in the old one. If you mean you substituted a crystal and capacitors for a ceramic resonator, then the problem is probably still there, and you are operating at the fringe of the oscillator's ability.<br>

Config fuses, are instructions to the programmer software, you set in your code, to tell the programmer how you want the pic to do things. <b> XT, HS . . . </b> explains to the programmer what level or power to allocate to the PIC's Oscillator, the higher the frequency the oscillator operates at, the more power it requires, which is why 20mhz requires HS and 4mhz gets by with XT. Go back to Darrel's post and follow the link he posted to see how to do it. If you get stuck, come back and seek further help.