PDA

View Full Version : fatal error [301] out of memory with 4 lines of code????



George
- 27th October 2005, 02:47
I just got version picbasic Pro 2.46 and am trying to compile a 4 line code as a sample. however it comes up with this error:

Fatal : 301 Out of memory

the chip is set to a 16F88 and I'm using code designer lite, here is the code below - I'm gonna ad LCD and stuff later I was just trying to see if i could successfully program it.

Thanks in advance for any suggestions


@ DEVICE INTRC_OSC, WDT_OFF, MCLR_OFF

DEFINE OSC 8
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 3
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
DEFINE LCD_COMMANDUS 2000

DEFINE ADC_BITS 10 'Set number of bits in result
DEFINE ADC_CLOCK 3 'Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 'Set sampling time in us

TRISA = %00000001 'Set I/O
TRISB = %00000000 'Set I/O
CMCON = %00000111 'Disable analog comparators
ANSEL = %00000001 'Set PORTA.0 analog rest digital
ADCON1 = %10000000 'Right justify result
OSCCON = %01110000 'Set internal osc to 8MHz

Pause 500

Start:

PORTB.0 = 1
Pause 500
PORTB.0 = 0
Pause 500

GoTo start

mister_e
- 27th October 2005, 02:56
http://www.microengineeringlabs.com/faq/02039124.htm#02070858

what happen if you install MPASM and use it instead of PM or PBPW

George
- 27th October 2005, 03:07
might give it a go tomorrow thanks, but it's weird cos I've done quite big programs in the past and never had an such issue letalone turning a port on and off, the computer I'm using has 512MB ram - not way powerful but I would have thought good enough

George
- 27th October 2005, 03:53
I've modified the code and ripped out everything except the "start: and Goto Start"

It compiled with 4 words successfully - yay.

However I need a program with a bit more in it than start and goto start.

I tried on different chips but have the same problem - however when I use v2.42 it compiles fine. I've deleted v2.46 and reinstalled it however still no joy. So I'm assuming it's a problem with v2.46 but would think other people would have come across the same issue. I might also try on a diff computer tonight to see what happens.

my biggest issue is that 2.42 doesn't support the 16F88

mister_e
- 27th October 2005, 16:53
maybe, i said maybe, the update patch could help. Look on the MELABS website for that.

Bruce
- 27th October 2005, 20:59
Out of memory errors like this are normally due to using PBP.EXE instead of PBPW.EXE which is the Windows executable, and it handles memory much better than the DOS command line executable PBP.EXE.

Be sure you're pointing your editor to PBPW.EXE VS PBP.EXE. Should cure the problem.

I just got version picbasic Pro 2.46

If you have an older version of PBP installed on the same machine, make sure your using the new version.

George
- 27th October 2005, 21:26
FIXT IT!!!

With help from Charles at MeLabs,

Under PBPW.EXE properties in windows, set compatibility to windows 98/me and all solved.