View Full Version : macro cmpeq error mystery
David Marks
- 24th February 2005, 09:49
Following reasonably successful programming ativities using PBP within Microcode studio. I have suddenly encountered the following error:
Error: macro cmpeq?www not found
I can find no reference in any manuals / help files to this error and am now totally stuck with no idea what to do next. Any helpful suggestions would be greatly appreciated
Thanks in anticipation
Acetronics2
- 24th February 2005, 12:42
Hi, David
Have a look to PBPic14 ( or 17 or 18 ...) .mac in your PBP files ... may be it is WWB ?
Then load it back again from the original diskette ...
Alain
mister_e
- 24th February 2005, 12:57
Click Here (http://www.picbasic.co.uk/forum/showthread.php?t=1249)
David Marks
- 24th February 2005, 14:33
Thanks Alain and mister e
Alain: Tried reinstalling from original pbp disc but it makes no difference.
Mister e: Not sure what you mean but presume I have not given sufficient info. If so I apologise and hope the following is of help/interest (The Pic being used is a 16F628a whichI have been successfully programming with the same software on very similar programs.
The ultimate objective of the program is to select one of a list of nominal values and then using a random number generator and a lookup table to produce a corresponding number which will produce an answer which is based on either a normal distribution or a skew distribution and display it on the same seven seg display that is used for selecting the nominal number.
There are two lists of nominal value i.e from 2 to 12 in increments of 2 and from 10 to 35 in increments of 5. Code written so far is simply to select the nominal number from one of these two options by identifying the mode (modes 1- 3 use the 2 to 12 sequence and modes 4 & 5 will use the 10 to 35 sequence.
I have removed a number of syntax errors (I am still a bit of a novice) but am left with this message:
Error: macro cmpeq?www not found in macro file.
b0 var word ‘
w1 var word ‘
A var word ‘
mode var word ‘
nomsel var word ‘ Define variables
inc var word ‘
maxno var word ‘
MyRandomVar var word ‘
trisb = %00000000 ‘ Set portB to outputs for 7 seg display trisa = %1111‘ ‘ Set Port A2 -7 to digital inputs to read
cmcon = 7 ‘ switches and A0 –A1 to outputs to
‘ multiplex 7 seg display
MyRandomVar = 0
main:
gosub Button_mode ‘ Find which mode to operate in
if mode < 4 then
nomsel = 2
inc = 2
maxno = 12
else
nomsel = 10
inc = 5
maxno = 35
endif
gosub Button_nomsel ' Select nominal value
gosub Button_Go ' Go and find actual value
w1 = nomsel
gosub display
goto main
Display:
b0 = W1/10 ' Find number of tens
W1 = W1 // 10 ' Remove tens from W1
gosub bin2seg ' Convert number to segments
poke portb,b0 ' send segments to LED
poke porta,%11111101 ' Turn on tens digit
pause 1 ' Leave it on for 1 ms
poke porta,%11111111 ' Turn off digit to prevent ghosting
b0 = W1 ' Get number of units
gosub bin2seg ' Convert number to segments
poke portb,b0 ' Send segments to LED
poke porta,%11111110 ' Turn on units digit
pause 1 ' Leave it on for 1 ms
poke porta,%11111111 ' Turn off digit to prevent ghosting
return
bin2seg:
Lookup b0,[$40,$79,$24,$30,$19,$12,$02,$78,$00,$18],b0
Return
Button_mode:
if porta.4 = 0 then return
Loop0: if porta.4 = 1 then loop0
mode = mode + 1
if mode = 6 then mode = 1
return
Button_nomsel:
if porta.2 = 0 then return
Loop1: if porta.2 = 1 then loop1
nomsel = nomsel = inc
if nomsel > maxno then nomsel = nomsel -inc * 5
return
Buttontest2:
MyRandomVar = MyRandomVar +1
if MyRandomVar = 46 then MyRandomVar = 0
if porta.3 = 0 then return
Loop2: if porta.3 = 1 then loop2
nomsel = MyRandomVar
return
Button_Go:
David Barker
- 24th February 2005, 15:47
You have confused the compiler with the line
nomsel = nomsel = inc
mister_e
- 24th February 2005, 16:19
I also agree with the multiple equal stuff. I see some others too
it's probably an copy/paste error but
trisb = %00000000 ‘ Set portB to outputs for 7 seg display trisa = %1111‘ ‘ Set Port A2 -7 to digital inputs to read
cmcon = 7 ‘ switches and A0 –A1 to outputs to
‘ multiplex 7 seg display
should be
TRISB=0 ' set PORTB as output
TRISA=%11111100 ' Set Port A2 -7 to digital inputs to read
' switches and A0 –A1 to outputs to multiplex 7 seg display
CMCON=7 ' disable analog pins on PORTA
this
poke porta,%11111101 ' Turn on tens digit
pause 1 ' Leave it on for 1 ms
poke porta,%11111111 ' Turn off digit to prevent ghosting
can be replace to
PORTA.1=0 ' Turn on tens digit
pause 1 ' Leave it on for 1 ms
PORTA.1=1 ' Turn off digit to prevent ghosting
And maybe.. maybe, some variable name u r using are already use in PBP assembler rouines... i'm not sure of inc,w1,b0,A
about this one
if nomsel > maxno then nomsel = nomsel -inc * 5
depending of you math priority.. safer if you use some ()
if nomsel > maxno then nomsel = nomsel - ( inc * 5 )
about this one
Lookup b0,[$40,$79,$24,$30,$19,$12,$02,$78,$00,$18],b0
not sure if it's working to look into b0 and return into b0.. maybe yes, maybe no. try
Lookup b0,[$40,$79,$24,$30,$19,$12,$02,$78,$00,$18],b1
b0=b1
one last, your appostroph is not the good character must be ' instead of ‘
that's a big big big difference or you can use ; instead
;)
David Marks
- 24th February 2005, 18:28
Hi Folks,
Brilliant, I must be going senile ! The double equal sign was the problem. I assumed (obviously incorrectly) that snce I wagetting no reports of syntax errors that there could not be a mistake of that kind. Consequently I dd not check as well as I (hopefully will in future) My only regret now is that I don't live near enough to either of you Guys to buy a round ! I am extremely grateful. many thanks
enoearias
- 19th January 2009, 18:54
You have confused the compiler with the line
nomsel = nomsel = inc
i'm new at this forum, i signed in to learn from all the people with knoledge, tank you for this answer. i have the same problem and you solve it.
sorry if i've mistakes. i'm from mexico.:)
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.