HI all,

My problem is different than the original thread, but the title fits, so I'll post it here.

I have been using MCS and PBP for a while, and never managed to really "use" MPLAB. It seem that every time I try, I fall into a "pit of death" and get frustrated and ignore it again.
Well, I have a troublesome program, and I need to see it in a simulator. After looking around, it seems that MPLAB has it if I can figure out the hurtles. I was encouraged to try again by Chuck Hellebuyck's article in N&V and it seemed so easy. HA! again the gremlins have their way with me!

I have MPLAB 7.60 in C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe (default) PBP is 2.47. In MPASM points to C:\PBP\PBPW.exe (default) copied the .inc files as mentioned.
Ran PBPlugins.bat and checked the path on my computer.
It is:
C:\MCC;%SystemRoot%\system32;%SystemRoot%;%SystemR oot%\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\Program Files\QuickTime\QTSystem\;C:Program Files\Microchip\MPASM Suite;C:\PBP



>Executing: "C:\PBP\PBPW.EXE" -ampasmwin -oq -z -p16F690 "BLINK.BAS"
>PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.
>
>ERROR: Unable to execute mpasmwin. Halting build on first failure as requested.
>BUILD FAILED: Sat May 03 06:58:40 2008


I reassigned the paths and got the same error.

I would love to learn to use MPASM, but it seems that I keep running into problems like this and get frustrated.
Can anyone see something that I’m missing?

Thanks again
Mark

P.S. The whole reason for this round of gymnastics is to try and figure out a motion control glue board that I need.
If anyone cares to look it over and offer any ideas, they would be greatly appreciated.

I’m hoping that by seeing it in a simulator, I can get some ideas on where the problem is.

I have been working in MicroCode Studio and using Darrel Taylor’s DT_INTS-14-0.bas for handling the interrupts.(the “-0” is a mod for 0 banks on the 12F).
The code that I have follows:

<code>
************************************************** **************
'* Name : encTest12F675-6.BAS *
'* Author : Mark A.Rokus *
'* Notice : Copyright (c) 2008 Controlled Surroundings Inc. *
'* : All Rights Reserved *
'* Date : 4/12/2008 *
'* Version : 6.0 *
'* Notes : 12F675@4mhz, INT_OSC *
'* : PBP 2.47, MPASM: 5.11, 282 words used *
'* : Need to test *
'* : LAST: Trav works if not too fast, Manual erratic *
'* : and locks auto travel sometimes *
'************************************************* ***************
' 1)Quadrature encoder reading direction and speed of mechanical slide.
' 2) Motor (servo) driven in ONE direction of slide movement,
' not driven for other direction. Active LOW Pulse & Direction drive.
' 3) another Manual Encoder to drive servo either direction manually.
' ADD pull-up to GPIO.3 on 12F675
'_CONFIG INT_OSC?
'move to different chip
'How do you set the DEVICE for MCS & MPASM?
' Test "end of Travel- up" for manual feed

A_trav VAR GPIO.0 'Travel encoder A input
B_trav VAR GPIO.1 'Travel encoder B input
A_man var GPIO.2 'Manual Encoder A input
B_man var GPIO.3 'Manual Encoder B input
P_out var GPIO.4 'PULSE output to motor, Active LOW
D_out var GPIO.5 'LEVEL output for direction
P_out = 1 'start out HI. Moves on LOW pulse

TravEncOld var byte 'Travel Encoder before change
TravEncNew Var byte 'Travel Encoder After change
ManEncOld var byte 'Manual Encoder Before change
ManEncNew var byte 'Manual Encoder After change
TravCnt var word 'Counter for recent Trav Pulses
TravDly var word 'delay to decrement Travel UP
ManCnt var byte 'Counter for recent Man Pulses
ManDly var byte 'count Manual I/P
AutoCnt var word 'preprogrammed feed @ end of cycle
EncNew1 var byte 'Stripped BITS, both Encoders
EncNew2 var byte
Dir VAR WORD 'Direction

INTCON = %10001000 'GLOBAL ON, GPIO Int ON
CMCON = 7 'Comparator off, Digital I/O
OPTION_REG = %00000000 'GPIO Pull-up Enabled
TRISIO = %001111
WPU = %11111111 'weak pull-ups on 0-2,4,5
'GPPU must be enabled for pull-ups
IOC = %00001111 'Interrupt on Change for GPIO: 0-3
ANSEL = 0 ' Analog off


INCLUDE "DT_INTS-14-0.bas" 'Base Interrupt program:0 banks
'include "ReEnterPBP-0.pbp" 'allow PBP int

ASM
INT_LIST macro ;IntSource, Label, Type, ResetFlag?
INT_Handler RBC_INT, _EncChg, ASM, yes
endm
INT_CREATE ;creates the INT processor
INT_ENABLE RBC_INT ;enable RB change int
ENDASM

Main:
'+++++++++++
for TravDly = 0 to 100 'Decrement delay
TravEncOld = GPIO & (%00000011) ' Save initial value of port
ManEncOld = GPIO & (%00001100) 'Save initial value of port
P_out = 1 ' reset Pulse to off
if (TravCnt > 1500) and (ManCnt > 300) then call AutoFeed 'just powered ' up stroke if TravCnt high value. If ManCnt before values depletes, jump ' to sub that feeds fixed amount of fiber out to cutting station.
next TravDly
While TravCnt >1 'If anything left;
TravCnt = TravCnt - 1 'decrement after time
wend 'if already 0 continue '
while ManCnt > 1 'same thing with Man
ManCnt = ManCnt -1
Wend

goto main
'+++++++++++++++++++++
'SUBS
'+++++++++++++++++++++
AutoFeed: 'sub to feed after up stroke
@ INT_DISABLE RBC_INT ;hopefully disables port Int
For AutoCnt = 1 to 4000 'Count for about 10" of fiber
Dir = 0 'DIR to feed out
P_out = 0 'LOW signal to driver for step
pauseus 5 'let step get caught
P_out = 1 'reset pulse out
pauseus 5 'let step clear
next AutoCnt 'repeat until ~ 10"
@ INT_ENABLE RBC_INT ;turn port change INT back on
Return

'+++++++++++++++++
'Motor Drive Pulse Out interrupt handler '++++++++++++++++++
EncChg: 'got here if GPIO 0-3 changed
ManEnc: 'Check Manual Enc first
EncNew1 = GPIO & (%00001100) 'strip Manual enc.
EncNew2 = GPIO & (%00001100) 'second read to de-glitch
ManEncNew = EncNew1 & EncNew2 'try and average
' will this line cause problems?, Better Glitch Check?
if ManEncOld = ManEncNew then TravEnc 'Not Manual, goto TravEnc
Dir = ManEncNew.3 ^ ManEncOld.2 ' decide DIR
' XOR of new Left bit vs. Old Right bit gives Dir
P_out = 0 ' start pulse either DIR
manCnt = ManCnt +1 'track Manual I/P
TravDly = 0 'reset TravDly
goto EndInt 'end the interrupt


TravEnc:
EncNew1 = GPIO & (%00000011) 'strip Travel enc.
EncNew2 = GPIO & (%00000011) 'second read to de-glitch
TravEncNew = EncNew1 & EncNew2 'Did Encoder change?
if TravEncOld = TravEncNew then EndInt 'Not TravEnc, End Int
Dir = TravEncNew.1 ^ TravEncOld.0 'determine direction
If DIR = 1 then EndInt 'end the INT if travel DOWN
P_out = 0 'PULSE if UP
TravCnt = travCnt + 1 'track travel up
TravDly = 0 'reset TravDly
' may have to make binary values 5 bit instead of 8, doubt it

EndInt:
@ INT_RETURN

end
</code>
________________________________________