Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

WARNING:current chip does not have enough common(non-banked) RAM

Status
Not open for further replies.

Dr_Doggy

Well-Known Member
what does this mean, and why would it only occur when I add a wait command?

(i cant compile asm when error occurs but i do know wait command works on 16f886(on my demo board)

is the chip not advanced enough?
 

Attachments

  • IRRAY16F526WORKS.asm
    2.7 KB · Views: 125
Hi,

Apart from just changing two characters to lower case on the Config line - see pointer, you code builds ok.

Have you Configure , Selected that chip for your Mplab project ?

Or are you trying to program the 526 code into the 886 chip ? - you cannot do that without modifying the assembler code for the 886 chip.
 

Attachments

  • ScreenShot.jpg
    ScreenShot.jpg
    193.3 KB · Views: 163
Last edited:
THE code posted is the one that works,, but i cannot put a wait command in to it using COWBASIC
 
here is another code, but with this one i ALSO get error: "Symbol RP0 has not been defined"

first one works...
 

Attachments

  • ANtest WORKSS 526.asm
    3.5 KB · Views: 112
  • pwmANtestBADONE526.asm
    5.1 KB · Views: 106
Could you tell why you need all of this? You can only turn it on or off a simple delay would be better

This would
Code:
SysRepeatLoop1
    bsf	PORTB,4  ;Set PORTB.4 On
    movlw D'23'
    movwf temp
    DECFSZ temp
    bcf  PORTB,4  ;Set PORTB.4 OFF
    movlw D'23'
    movwf temp
    DECFSZ temp
    Return
SysRepeatLoopEnd1

get rid of all this basically
Code:
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 On
	bsf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
;Set PORTB.4 Off
	bcf	PORTB,4
Could you tell why you need all of this
 
Last edited:
I am using GCBASIC compiler(IDK c), when using my 16F886 all the code works and compiles fine, but now since using the 16F526; whenever i add a " wait" command i get the posted error

the second one i have my repeat command which works, but when i add "repeat"(variable) i get both those errors in the later post

I had the first posted error also show up when i ran a sub, inside a sub, inside a sub, later i read that those chips can only handle one sub at a time. so I am wondering if the chip is too primitive(it said on the sheet "only 33 word programming")
....for a wait command though? maybe its my compiler?

Is there a difference between the 16F886 and the 16F526 that would explain this, like maybe something strange as different "pipeline flow instructions"?
 

Attachments

  • 16F526.pdf
    1.9 MB · Views: 324
  • 16F886.pdf
    391.5 KB · Views: 400
You are using a chip with 67 bytes of RAM, of which 3 are common to all banks, with a high level language. I'm surprised that ANY compiler supports such a limited chip. Switch to a chip with a 14 bit core like the 16F630 or the even better 16F721.

Mike.
 
Last edited:
:)/

my compiler looks like this: i wasnt sure if you guys would use this, or be compatible!
and here is what code is:


OK...so it is due to a simple chip..... im surprised it can't process a wait command though, even this simple flasher program doesn't work:

thnx again, chip is on the way,
 

Attachments

  • GCGB.jpg
    GCGB.jpg
    79.7 KB · Views: 169
  • TESTABCD4620.hex
    642 bytes · Views: 102
  • 526.asm
    2.1 KB · Views: 120
You are using a chip with 67 bytes of RAM, of which 3 are common to all banks, with a high level language. I'm surprised that ANY compiler supports such a limited chip. Switch to a chip with a 14 bit core like the 16F630 or the even better 16F721.

Mike.
The COW supports 10f's too, I love it. For doing lots of loops, a HLL is sure a lot easier to follow. Using Basic syntax like For...Next, DoWhile...Loop, etc. does not add extra code to the assembler.

doggy_:

The 16f886 is a 14 bit (Midrange) instruction device, while the 16f526 is a 12 bit (Baseline) instruction device. Worlds of differences.

I have used the Cow with 10f's, no problem. Extreme vigilance is needed with variable usage and code size. One of the first things learned is to use Timer0 for rough delays, instead of the wait command. Or get exact ones from the PICLIST delay calculator.

Also, inline your subs as necessary, two deep is OK (i.e. sub from within a sub). Using maths, and conditionals like >=, <, etc. make for extra shadow registers (i.e. RAM variables). Reuse variable names where practical, or the W register in assembler. Start small, and work up from there. Keep checking the output .lst file for variables, and program words used.

Yes, at some point it probably makes sense to go all assembly.

Code:
;use TMR0 for delays
clrwdt	;must do prior to changing prescale, per data sheet
movlw	B'11000110'	;asign prescaler to TMR0, prescale 1:128
asm	option

Main:
...
...
For ON_Time = 255 to 1 	'Ramp down
	Call Change_Duty
	Call SoftPWM
Next
For On_Time = 1 to 20	'Blank time
	clrf TMR0
	Delay3:
	btfss TMR0,7
	goto Delay3
Next
...
...
Goto Main
 
yup! good tips
is that 2nd FOR loop the wait command, can i put it in to cow? (this may solve alot of my probs!)
will that PICLIST delay calculator code go in to cow too?
 
yup! good tips
is that 2nd FOR loop the wait command, can i put it in to cow? (this may solve alot of my probs!)
will that PICLIST delay calculator code go in to cow too?
Yes, the second For...Next loop is a delay using TMR0. The first three lines of the above code need to initialize the OPTION register for assigning the prescaler to TMR0, and choosing the prescaler value.

I don't use the graphical cow, but I am sure there are instructions to inline that code in the flow diagram. Same for the assembler code from piclist. As you can see, there are several assembler instruction in my code already.
 
GCBASIC can't compile that. But I did the same code in MPLAB using Mpasm and it worked fine.
Code:
;Program compiled by Great Cow BASIC (0.9 7/2/2010)
;Need help? See the GCBASIC forums at http://sourceforge.net/forum/?group_id=169286,
;check the documentation or email w_cholmondeley@users.sourceforge.net.

;********************************************************************************

;Set up the assembler options (Chip type, clock source, other bits and pieces)
 LIST p=16F526, r=DEC
#include <P16F526.inc>
 __CONFIG    _CPDF_OFF & _IOSCFS_8MHz & _MCLRE_ON & _CP_OFF & _WDTE_OFF

;********************************************************************************

;Set aside memory locations for variables
TRISB	EQU	13
DELAYTEMP	EQU	14
DELAYTEMP2	EQU	15
SysWaitTempMS	EQU	16
SysWaitTempMS_H	EQU	17
;********************************************************************************

;Vectors
;Start of program memory page 0
	ORG	0
BASPROGRAMSTART
;Call initialisation routines
	call	INITSYS
;Automatic pin direction setting
	banksel	TRISB
	bcf	TRISB,0

;Start of the main program
SysDoLoop_S1
	banksel	PORTB
	bsf	PORTB,0
	movlw	100
	movwf	SysWaitTempMS
	clrf	SysWaitTempMS_H
	call	Delay_MS
	bcf	PORTB,0
	movlw	100
	movwf	SysWaitTempMS
	clrf	SysWaitTempMS_H
	call	Delay_MS
	goto	SysDoLoop_S1
SysDoLoop_E1
BASPROGRAMEND
	sleep
	goto	$

;********************************************************************************

Delay_MS
	incf	SysWaitTempMS_H, F
DMS_START
	movlw	142
	movwf	DELAYTEMP2
DMS_OUTER
	movlw	1
	movwf	DELAYTEMP
DMS_INNER
	decfsz	DELAYTEMP, F
	goto	DMS_INNER
	decfsz	DELAYTEMP2, F
	goto	DMS_OUTER
	decfsz	SysWaitTempMS, F
	goto	DMS_START
	decfsz	SysWaitTempMS_H, F
	goto	DMS_START
	return
;********************************************************************************

INITSYS
	bcf	ADCON0,ADON
	bcf	ADCON0,ANS0
	bcf	ADCON0,ANS1
	bcf	CM2CON0,C2ON
	bcf	CM1CON0,C1ON
	movlw	B'11001111'
	option
	clrf	PORTB
	clrf	PORTC
	movlw	B'00000000'
	movwf	TRISB
	retlw	0

;********************************************************************************

;Start of program memory page 1
	ORG	512

 END
Here the hex
Code:
:020000040000FA
:100000002109A404C4040D04A404C4040605640C5A
:100010003000710013090604640C300071001309EC
:10002000040A0300120AB1028E0C2F00010C2E00EC
:10003000EE02180AEF02160AF002140AF102140A7C
:1000400000080904C904E9046B046804CF0C020029
:0A00500066006700FF0C2D00000899
:021FFE00F70FDB
:00000001FF
 
Last edited:
I agree with Burt, the cow delay routine should work. Assembler routines needed for my 10f example, may not be required for the 16f526.

Aside from the architecture differences as already noted, there have been other problems too. Firstly it was declaring clkout in config, and then trying to output on the very same pin. Secondly, a typo or syntax error seems to have occurred to express another error. The cow will continue to chase its tail until the .bas file can be shown in the future.

The 16f526 is quite new. It is possible that the a-d library needs updating, or some other cow compiler hiccups have occurred.

_IOSCFS_8MHz, first time I have seen that one!
 
I tried the newer GCbasic you can use it like flow code or text only, take your pick. The only base line chips I have are some 12f508 it made real good code for them. Almost as good as if you did it in asm to begin with.

GCbaisc used 14 bytes
ASM used 13 bytes
PBP used 16 bytes
jalv2 used 14
 
Last edited:
lol, i just set the clock the the first internal setting that worked, there were like 4 or 6 options there with IO in them! AND just as you said that i discovered the AD too, so ima scrap the chip till the next time i need a 555 timer or something. I had alot of problems there including using a repeat command inside another one, and using variables, so what was that called again so i make sure never to buy a weak chip like that again! (14bit, is that the processor?)

Also since im in the thread already, and back on my 886 chip; I want to cut some strings for esuart, but i couldn't find a cow command there either(and im using wrong port), so what I have done so far is:

v$="hello "

for loop to 6
x=v(loop)

next loop

so for now it cuts the string, right, so now i need to break up x.... (each letter) to binary(ascii) so i can push it out as a serial register, btw my LCD font map is in ASCII right? is there a command that would work in the cow to convert x to binary?
 
Here some of there examples

Code:
Example:
    'This program will send a byte using PORTB.2, the value of which
    'depends on whether a button is pressed.


    #define RecAHigh PORTB.2 ON
    #define RecALow PORTB.2 OFF


    InitSer (1, r9600, 1+WaitForStart, 8, 1, none, normal)
    Main:
     if Button pressed then Temp = 0
     if Button released then Temp = 100
     SerSend (1, Temp)
     Wait 1 s
    goto Main

Code:
  'This program will read a byte from PORTB.2, and set the green
    'on if the byte is more than 50.


    #define RecAHigh PORTB.2 ON
    #define RecALow PORTB.2 OFF


    InitSer (1, r9600, 1+WaitForStart, 8, 1, none, normal)
    SerReceive (1, Temp)
    if Temp > 50 then set green on
 
ok i got it goin and displaying(problem was defining port), but not characters i want, so i ended up turning off the start and stop bit, set the string to 10, and set my temp value to FE, but my display shows the value for FF, which is very strange....

reading my datasheet its talking about command structures, and i may have inadvertently messed up char map?, could we look over it, I wonder what does a full sequence look like, ?

here is data sheet.....
 

Attachments

  • LCD-serial(bigone).pdf
    559.2 KB · Views: 186
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top