I can send you a couple of PostScript files that describe the
compiler. Can you accept and print PostScript? (I imagine you can).
Regarding pricing, I am in the process of working out distributorship
arrangements with various organizations so I don't have a final
suggested retail price. If, however, you are interested in the
compiler I can sell them to you directly for $99 for a limited time
(until Jan 15/94). This price will change (almost certainly increase)
after the middle-end of Jan.
Here's the brochure on B.LO.C (pronounced "below C"). There's another,
prettier version, but it uses non-standard fonts, so here's the simpler
one. Content-wise, however, they are identical.
The Example document will follow this one. It is also in PostScript form.
PS. Please respond to the above address---the one in the header is
incorrect.
---------included material starts-------------------------------------
%!PS-Adobe-3.0
%%Creator: pscat
%%For: kalam:asm (Anees S. Munshi)
%%Title: stdin
%%CreationDate: Tue Dec 7 08:20:02 1993
%%DocumentNeededResources: font Times-Roman Times-Italic Times-Bold Symbol
Times-Roman
%%DocumentSuppliedResources: font DIThacks
%%Pages: (atend)
%%EndComments
% Start of pscat.pro -- prolog for troff translator
% Copyright (c) 1985,1987 Adobe Systems Incorporated. All Rights Reserved.
% GOVERNMENT END USERS: See Notice file in TranScript library directory
% -- probably /usr/lib/ps/Notice
% RCS: $Header:
/disks/hobo/vp6/snichols/rel3.0/transcript/lib/RCS/pscat.pro,v 3.0
1991/06/17 17:08:31 snichols Exp $
save /pscatsave exch def
/$pscat 50 dict def
$pscat begin
/fm [1 0 0 1 0 0] def
/xo 0 def /yo 0 def
/M /moveto load def
/R /show load def
/S {exch currentpoint exch pop moveto show}def
/T {exch currentpoint pop exch moveto show}def
/U {3 1 roll moveto show}def
/siz 0 def
/font 0 def
/Z {/siz exch def SF}def
/F {/font exch def SF}def
/SF{font 0 ne
{catfonts font 1 sub get fm 0 siz put fm 3 siz neg put
fm makefont setfont}if}def
/BP{save/catsv exch def 0 exch translate 72 432 div dup neg scale
xo yo translate 0 0 moveto}def
/EP{catsv restore showpage}def
% definitions for PPROC callback functions
% each PPROC is called with the following number on the stack:
% pointsize charcode railmag pswidth pschar x y wid
/$pprocs 50 dict def
/fractm [.65 0 0 .6 0 0] def
% fractions
/PS1{gsave $pprocs begin
/wid exch def pop pop pop pop pop /ch exch def /size exch def
/pair $pprocs ch get def /cf currentfont def
cf fractm makefont setfont
0 .3 size mul 6 mul 2 copy neg rmoveto pair 0 get show rmoveto
currentfont cf setfont (\244) show setfont
pair 1 get show grestore wid .06 div 0 rmoveto end}def
$pprocs begin
8#34 [(1)(4)] def
8#36 [(1)(2)] def
8#46 [(3)(4)] def
end
%%BeginResource: font DIThacks
% DIThacks fonts for some special chars
50 dict dup begin
/FontType 3 def
/FontName /DIThacks def
/FontMatrix [.001 0.0 0.0 .001 0.0 0.0] def
/FontBBox [-220 -280 900 900] def% a lie but ...
/Encoding 256 array def
0 1 255{Encoding exch /.notdef put}for
Encoding
dup 8#040/space put %space
dup 8#110/rc put %right ceil
dup 8#111/lt put %left top curl
dup 8#112/bv put %bold vert
dup 8#113/lk put %left mid curl
dup 8#114/lb put %left bot curl
dup 8#115/rt put %right top curl
dup 8#116/rk put %right mid curl
dup 8#117/rb put %right bot curl
dup 8#120/rf put %right floor
dup 8#121/lf put %left floor
dup 8#122/lc put %left ceil
dup 8#140/sq put %square
dup 8#141/bx put %box
dup 8#142/ci put %circle
dup 8#143/br put %box rule
dup 8#144/rn put %root extender
dup 8#145/vr put %vertical rule
dup 8#146/ob put %outline bullet
dup 8#147/bu put %bullet
dup 8#150/ru put %rule
dup 8#151/ul put %underline
pop
/DITfd 100 dict def
/BuildChar{0 begin
/cc exch def /fd exch def
/charname fd /Encoding get cc get def
/charwid fd /Metrics get charname get def
/charproc fd /CharProcs get charname get def
charwid 0 fd /FontBBox get aload pop setcachedevice
40 setlinewidth
newpath 0 0 moveto gsave charproc grestore
end}def
/BuildChar load 0 DITfd put
%/UniqueID 5 def
/CharProcs 50 dict def
CharProcs begin
/space{}def
/.notdef{}def
/ru{500 0 rls}def
/rn{0 750 moveto 500 0 rls}def
/vr{20 800 moveto 0 -770 rls}def
/bv{20 800 moveto 0 -1000 rls}def
/br{20 770 moveto 0 -1040 rls}def
/ul{0 -250 moveto 500 0 rls}def
/ob{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath
stroke}def
/bu{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath fill}def
/sq{80 0 rmoveto currentpoint dround newpath moveto
640 0 rlineto 0 640 rlineto -640 0 rlineto closepath stroke}def
/bx{80 0 rmoveto currentpoint dround newpath moveto
640 0 rlineto 0 640 rlineto -640 0 rlineto closepath fill}def
/ci{355 333 rmoveto currentpoint newpath 333 0 360 arc
50 setlinewidth stroke}def
%%BeginProcSet: /usr/lib/NextStep/printPackage.ps 3.0
%!
% NeXT Printing Package
% Version: 3.0
% Copyright: 1988, NeXT, Inc.
/__NXdef{1 index where{pop pop pop}{def}ifelse}bind def
/__NXbdef{1 index where{pop pop pop}{bind def}ifelse}bind def
/UserObjects 10 array __NXdef
/defineuserobject{
exch dup 1 add dup UserObjects length gt{
array dup 0 UserObjects putinterval
/UserObjects exch def
}{pop}ifelse UserObjects exch 3 -1 roll put
}__NXbdef
/undefineuserobject{UserObjects exch null put}__NXbdef
/execuserobject{UserObjects exch get exec}__NXbdef
/__NXRectPath{4 2 roll moveto 1 index 0 rlineto
0 exch rlineto neg 0 rlineto closepath}__NXbdef
/__NXProcessRectArgs{
1 index type /arraytype eq{
exch 0 4 2 index length 1 sub{
dup 3 add 1 exch{1 index exch get exch}for
5 1 roll 5 index exec
}for pop pop
}{exec}ifelse
}__NXbdef
/rectfill{gsave newpath {__NXRectPath fill} __NXProcessRectArgs
grestore}__NXbdef
/rectclip{newpath {__NXRectPath} __NXProcessRectArgs clip newpath}__NXbdef
/rectstroke{
gsave newpath dup type /arraytype eq{dup length 6
eq}{false}ifelse{
{gsave __NXRectPath null concat stroke grestore}
dup length array cvx copy dup 2 4 -1 roll put
__NXProcessRectArgs
}{{__NXRectPath stroke} __NXProcessRectArgs}ifelse grestore
}__NXbdef
/_NXLevel2 systemdict /languagelevel known {languagelevel 2
ge}{false}ifelse __NXdef
/xyshow{
0 1 3 index length 1 sub{
currentpoint 4 index 3 index 1 getinterval show
3 index 3 index 2 mul 1 add get add exch
3 index 3 index 2 mul get add exch moveto pop
}for pop pop
}__NXbdef
/xshow{
0 1 3 index length 1 sub{
currentpoint 4 index 3 index 1 getinterval show
exch 3 index 3 index get add exch moveto pop
}for pop pop
}__NXbdef
/yshow{
0 1 3 index length 1 sub{
currentpoint 4 index 3 index 1 getinterval show
3 index 3 index get add moveto pop
}for pop pop
}__NXbdef
/arct{arcto pop pop pop pop}__NXbdef
/setbbox{pop pop pop pop}__NXbdef
/ucache{}__NXbdef
/ucachestatus{mark 0 0 0 0 0}__NXbdef
/setucacheparams{cleartomark}__NXbdef
/uappend{systemdict begin cvx exec end}__NXbdef
/ueofill{gsave newpath uappend eofill grestore}__NXbdef
/ufill{gsave newpath uappend fill grestore}__NXbdef
/ustroke{
gsave newpath dup length 6 eq
{exch uappend concat}{uappend}ifelse
stroke grestore
}__NXbdef
/__NXustrokepathMatrix dup where {pop pop}{matrix def}ifelse
/ustrokepath{
newpath dup length 6 eq{
exch uappend __NXustrokepathMatrix currentmatrix exch
concat
strokepath setmatrix
}{uappend strokepath}ifelse
} __NXbdef
/upath{
[exch {/ucache cvx}if pathbbox /setbbox cvx
{/moveto cvx}{/lineto cvx}{/curveto cvx}{/closepath
cvx}pathforall]cvx
} __NXbdef
/setstrokeadjust{pop}__NXbdef
/currentstrokeadjust{false}__NXbdef
/selectfont{exch findfont exch
dup type /arraytype eq {makefont}{scalefont}ifelse setfont}__NXbdef
/_NXCombineArrays{
counttomark dup 2 add index dup length 3 -1 roll {
2 index length sub dup 4 1 roll 1 index exch 4 -1 roll
putinterval exch
}repeat pop pop pop
}__NXbdef
/flushgraphics{}def
/setwindowtype{pop pop}def
/currentwindowtype{pop 0}def
/setalpha{pop}def
/currentalpha{1.0}def
/hidecursor{}def
/obscurecursor{}def
/revealcursor{}def
/setcursor{4 {pop}repeat}bind def
/showcursor{}def
/NextStepEncoding where not{
/NextStepEncoding StandardEncoding 256 array copy def
0 [129/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/Ccedilla/Egrave
/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/Ugrave/Uacute
/Ucircumflex/Udieresis/Yacute/Thorn/mu/multiply/divide/copyright
176/registered 181/brokenbar 190/logicalnot 192/onesuperior
201/twosuperior
204/threesuperior 209/plusminus/onequarter/onehalf/threequarters/agrave
/aacute/acircumflex/atilde/adieresis/aring/ccedilla/egrave/eacute
/ecircumflex/edieresis/igrave 226/iacute 228/icircumflex/idieresis/eth
/ntilde 236/ograve/oacute/ocircumflex/otilde/odieresis 242/ugrave/uacute
/ucircumflex 246/udieresis/yacute 252/thorn/ydieresis]
{dup type /nametype eq
{NextStepEncoding 2 index 2 index put pop 1 add}{exch pop}ifelse
}forall pop
/NextStepEncoding NextStepEncoding readonly def
/_NXfstr 128 string dup 0 (_NX) putinterval def
/_NXfindfont /findfont load def
/findfont{
% Because we can never let NextStepEncoding get into
% SharedFontDirectory, we cannot reencode a font to NextStepEncoding
% if we are in shared mode. So if currentshared is true,
% we call the normal findfont and return that
/currentshared where {pop currentshared} {false} ifelse
{_NXfindfont}
{dup _NXfstr 3 125 getinterval cvs length 3 add _NXfstr 0 3 -1 roll
getinterval cvn exch FontDirectory 2 index known
{pop FontDirectory exch get}
{_NXfindfont dup /Encoding get StandardEncoding eq
{ dup length dict exch
{1 index /FID ne {2 index 3 1 roll put}{pop pop}ifelse}forall
dup /Encoding NextStepEncoding put definefont
}{exch pop} ifelse
}ifelse
}ifelse
}bind def
}{pop}ifelse
/_NXImageString {/__NXImageString where{pop}{/__NXImageString 4000 string
__NXdef}ifelse __NXImageString}__NXbdef
/_NXDoImageOp{
3 dict begin /parr 5 array def 1 index{dup}{1}ifelse /chans exch
def
chans 2 add 2 roll parr 0 chans getinterval astore pop
5 index 4 index mul 2 index{1 sub 8 idiv 1 add mul}{mul 1 sub 8
idiv 1 add}ifelse
4 index mul /totbytes exch def pop exch pop
gsave matrix invertmatrix concat 0.5 setgray 0 0 4 2 roll rectfill
grestore
{0 1 chans 1 sub{parr exch get exec length totbytes exch sub
/totbytes exch def}for totbytes 0 le{exit}if}loop end
}__NXbdef
/alphaimage{1 add _NXDoImageOp}def
_NXLevel2{
344.362305 188.333206 M 1.299469 0 32 (w tight ) widthshow
2 FF
381.809235 188.333206 M 1.181335 0 32 (B) widthshow
387.679382 188.333206 M 1.181335 0 32 (.LO) widthshow
403.5495 188.333206 M 1.181335 0 32 (.C) widthshow
1 FF
412.999512 188.333206 M 1.299469 0 32 ( code can get.) widthshow
126 203.333176 M 0.685303 0 32 (The same e) widthshow
185.120987 203.333176 M 0.685303 0 32 (xample can be wr) widthshow
273.537659 203.333176 M 0.685303 0 32 (itten in a m) widthshow
329.284668 203.333176 M 0.685303 0 32 (uch more C-lik) widthshow
401.330536 203.333176 M 0.685303 0 32 (e style at a slight) widthshow
126 218.333145 M 5.160828 0 32 (perf) widthshow
144.623398 218.333145 M 5.160828 0 32 (or) widthshow
154.677048 218.333145 M 5.160828 0 32 (mance e) widthshow
201.693268 218.333145 M 5.160828 0 32 (xpense) widthshow
236.992462 218.333145 M 5.160828 0 32 (. The assemb) widthshow
313.732361 218.333145 M 5.160828 0 32 (ler code produced \(27 machine)
widthshow
126 233.333115 M 1.15416 0 32 (instr) widthshow
146.943787 233.333115 M 1.15416 0 32 (uctions\) is sho) widthshow
219.38829 233.333115 M 1.15416 0 32 (wn interspersed with the source \(24
lines\). \(Note that) widthshow
126 248.333084 M -0.165375 0 32 (although ) widthshow
2 FF
171.088608 248.333084 M -0.150345 0 32 (B) widthshow
176.95874 248.333084 M -0.150345 0 32 (.LO) widthshow
192.828873 248.333084 M -0.150345 0 32 (.C) widthshow
1 FF
202.27887 248.333084 M -0.165375 0 32 ( copies single-line comments into
the output, b) widthshow
427.116455 248.333084 M -0.165375 0 32 (ut the) widthshow
454.253326 248.333084 M -0.165375 0 32 (y ha) widthshow
474.658203 248.333084 M -0.165375 0 32 (v) widthshow
479.883545 248.333084 M -0.165375 0 32 (e) widthshow
(been str) 126.0 263.333 T
(ipped a) 165.908 263.333 T
(w) 201.768 263.333 T
(a) 209.545 263.333 T
(y f) 215.332 263.333 T
(or clar) 226.618 263.333 T
(ity\).) 257.341 263.333 T
3 (Courier) 9 1 mymakefontmetric
3 FF
(/* Ramtest.bc: Clear and test RAM in an inf) 90.0 287.0 T
(inite loop. \(Set up for 16C71\) */) 322.2 287.0 T
(const VARSTART__ = 0x0c, VAREND__ = 0x2f ) 90.0 298.0 T
(// Def) 90.0 320.0 T
(ine where RAM starts and ends; this information is used by the compiler)
122.4 320.0 T
(// to allocate variables in appropriate places. This information is
usually put) 90.0 331.0 T
(// in a #include-d f) 90.0 342.0 T
(ile.) 198.0 342.0 T
(const STATUS = 0x03, Z_f) 90.0 353.0 T
(lag = 2, PORTB = 0x06, TRISB = 0x06, FSR = 4) 219.6 353.0 T
(// allocate a one-byte variable at FSR \(the indirection register\)) 90.0
375.0 T
(int8 ptr@FSR // This defeats automatic allocation.) 90.0 386.0 T
4 (Courier-Bold) 9 1 mymakefontmetric
4 FF
135 407.999695 M -0.44989 0 (VARSTART__ EQU 0xc) ashow
135 418.999695 M -0.44989 0 (VAREND__ EQU 0x2f) ashow
135 429.999695 M -0.44989 0 (STATUS EQU 0x3) ashow
135 440.999695 M -0.44989 0 (Z_f) ashow
149.850311 440.999695 M -0.44989 0 (lag EQU 0x2)
ashow
135 451.999695 M -0.44989 0 (PORTB EQU 0x6) ashow
135 462.999695 M -0.44989 0 (TRISB EQU 0x6) ashow
135 473.999695 M -0.44989 0 (FSR EQU 0x4) ashow
135 484.999695 M -0.44989 0 (ptr EQU 0x4) ashow
3 FF
(#origin 0 // generate code at address zero \(RESET\)) 90.0 496.0 T
(goto main // bootstrap to the main program) 90.0 507.0 T
4 FF
135 517.999695 M -0.44989 0 (ORG 0x0) ashow
135 528.999695 M -0.44989 0 ( goto main) ashow
3 FF
(#origin 10 // place main at address 10 arbitrarily) 90.0 551.0 T
4 FF
135 561.999695 M -0.44989 0 ( ORG 0xa) ashow
3 FF
(// This is a named-block, like the brace-delimited block) 90.0 584.0 T
(// of C, except the name acts as a label which propagates) 90.0 595.0 T
(// to the assembler code, allowing it to be referenced \(and located\).)
90.0 606.0 T
(main {) 90.0 617.0 T
( *STATUS /= 5 // set bit 5 of STATUS reg to access page 1) 90.0 628.0
T
( *TRISB \\= 0 // clear bit 0 to make PORTB:0 an output) 90.0 639.0 T
( *STATUS \\= 5 // reset to access page 0) 90.0 650.0 T
( *PORTB = 0 // bit 0 low) 90.0 661.0 T
4 FF
135 671.999695 M -0.44989 0 ( bsf STATUS,5) ashow
1 G
193.5 54 225 54 NF
0 G
1 FF
(B) 288.295 61.333 T
(.LO) 295.412 61.333 T
(.C) 312.705 61.333 T
(release 1.0, v) 248.97 74.333 T
(ersion 4.0) 314.729 74.333 T
(High le) 224.99 87.333 T
(v) 258.893 87.333 T
(el language and compiler) 264.118 87.333 T
1 G
540 540 9 135 NF
0 G
smat 547.333313 664.112976 translate 0 0 moveto 270 rotate (Doc#:
BLOC-39312/BSPI) show rmat
1 G
238.5 684 135 9 NF
0 G
(P) 278.087 691.333 T
(age 1 of 2) 284.985 691.333 T
grestore
FMENDPAGE
grestore
showpage
__NXsheetsavetoken restore
%%PageTrailer
%%Page: 2 2
%%PageBoundingBox: 0 0 612 792
%%PageFonts: (atend)
%%BeginPageSetup
%%PaperSize: Letter
/__NXsheetsavetoken save def
0 0 translate
gsave
/__NXbasematrix matrix currentmatrix def
grestore
gsave
0 0 612 792 rectclip
[1 0 0 -1 0 792] concat
0 0 translate
%%EndPageSetup
FMBEGINPAGE
gsave
0 0 612 792 rectclip
/landscape false def
0 0 612 792 CR
0 G
0 0 612 792 CR
0 (Courier-Bold) 9 1 mymakefontmetric
0 FF
135 78 M -0.44989 0 ( bcf TRISB,0) ashow
135 89 M -0.44989 0 ( bcf STATUS,5) ashow
135 100 M -0.44989 0 ( movlw 0x0) ashow
135 111 M -0.44989 0 ( movwf PORTB) ashow
1 (Courier) 9 1 mymakefontmetric
1 FF
( ptr=VAREND__ // clear RAM) 90.0 122.0 T
0 FF
135 133 M -0.44989 0 ( movlw VAREND__) ashow
135 144 M -0.44989 0 ( movwf ptr) ashow
90 155 M -0.44989 0 ( ) ashow
1 FF
(do {) 109.8 155.0 T
( clear\(*0\)) 90.0 166.0 T
( // clearing location zero will actually clear the variable
pointed to) 90.0 177.0 T
( // by ptr. Loop while ptr >= VARSTART__. Although we could) 90.0
188.0 T
( // perform a <= test, the following is faster.) 90.0 199.0 T
( } while\(eval\(--ptr - [VARSTART__ - 1]\), *STATUS ?! Z_f) 90.0 210.0
T
(lag\)) 403.2 210.0 T
0 FF
135 221 M -0.44989 0 (DH1) ashow
135 232 M -0.44989 0 ( clrf 0x0) ashow
135 243 M -0.44989 0 (DT1) ashow
135 254 M -0.44989 0 ( decf ptr,1) ashow
135 265 M -0.44989 0 ( movf ptr,0) ashow
135 276 M -0.44989 0 ( addlw 0xf5) ashow
135 287 M -0.44989 0 ( btfss STATUS,2) ashow
135 298 M -0.44989 0 ( goto DH1) ashow
135 309 M -0.44989 0 (EN1) ashow
90 331 M -0.44989 0 ( ) ashow
1 FF
(ptr=VAREND__;) 109.8 331.0 T
( ) 135.0 342.0 T
0 FF
156.599976 342 M -0.44989 0 (movlw VAREND__) ashow
135 353 M -0.44989 0 ( movwf ptr) ashow
90 364 M -0.44989 0 ( ) ashow
1 FF
(do { // check RAM for non-zero elements) 109.8 364.0 T
( if\(eval\(*0\), *STATUS ?! Z_f) 90.0 375.0 T
(lag\) {) 279.0 375.0 T
( *PORTB = 1 // bit 0 high) 90.0 386.0 T
( loop {} // trap execution inside an inf) 90.0 397.0 T
(inite loop) 387.0 397.0 T
( }) 90.0 408.0 T
( } while\(eval\(--ptr - [VARSTART__ - 1]\), *STATUS ?! Z_f) 90.0 419.0
T
(lag\)) 403.2 419.0 T
0 FF
135 430 M -0.44989 0 (DH2) ashow
135 441 M -0.44989 0 (IFT3) ashow
135 452 M -0.44989 0 ( movf 0x0,0) ashow
135 463 M -0.44989 0 ( btfsc STATUS,2) ashow
135 474 M -0.44989 0 ( goto EN3) ashow
135 485 M -0.44989 0 ( movlw 0x1) ashow
135 496 M -0.44989 0 ( movwf PORTB) ashow
135 507 M -0.44989 0 (LH4) ashow
135 518 M -0.44989 0 ( goto LH4) ashow
135 529 M -0.44989 0 (EN4) ashow
135 540 M -0.44989 0 (EN3) ashow
135 551 M -0.44989 0 (DT2) ashow
135 562 M -0.44989 0 ( decf ptr,1) ashow
135 573 M -0.44989 0 ( movf ptr,0) ashow
135 584 M -0.44989 0 ( addlw 0xf5) ashow
135 595 M -0.44989 0 ( btfss STATUS,2) ashow
135 606 M -0.44989 0 ( goto DH2) ashow
135 617 M -0.44989 0 (EN2) ashow
1 FF
( goto main // if test was successful, repeat) 90.0 628.0 T
( ) 135.0 639.0 T
0 FF
156.599976 639 M -0.44989 0 (goto main) ashow
1 FF
(}) 90.0 650.0 T
0 FF
135 661 M -0.44989 0 (__end_main) ashow
135 672 M -0.44989 0 ( END) ashow
1 G
54 720 504 27 NF
0 G
2 (Optima-Bold) 11 1 mymakefontmetric
2 FF
(Butter\337y Signal Pr) 80.532 727.333 T
(ocessing Inc) 167.74 727.333 T
3 (Helvetica) 11 1 mymakefontmetric
3 FF
(., 131 Bloor Street W) 226.425 727.333 T
(est #200-154, T) 328.197 727.333 T
(oronto) 403.923 727.333 T
(, Ontar) 434.668 727.333 T
(io) 468.46 727.333 T
(, M5S 1R8. ) 476.579 727.333 T
(Phone: \(416\) 929-5754. F) 195.46 741.333 T
(AX: \(416\) 968-7492) 320.543 741.333 T
1 G
72 45 468 18 NF
0 G
3 FF
(B) 288.295 52.333 T
(.LO) 295.412 52.333 T
(.C) 312.705 52.333 T
4 (Helvetica) 12 1 mymakefontmetric
4 FF
(release 1.0, v) 415.572 52.333 T
(ersion 4.0) 487.308 52.333 T
1 G
238.5 693 135 9 NF
0 G
3 FF
(P) 278.087 700.333 T
(age 2 of 2) 284.985 700.333 T
grestore
FMENDPAGE
grestore
showpage
__NXsheetsavetoken restore
%%PageTrailer
%%Trailer
%%BoundingBox:0 0 612 792
*Can somebody steer me to a book or resource that'll get me started
*in learning assembly code ? I've got all of the PIC tools, chips,
*books and even a hardware design that a PIC will evntually plug
*into. What I'm missing is the specific knowledge about Assembly,
*especially with regard to formatting , etc. I'd hate to burn up
*a bunch of PICs trying to figure out what I'm doing.
*
*Any and all help is certainly appreciated.
*
*Shawn Dienhart
*805 545-4481
*
i am presently in the same position you were in (even have target hardware,
etc), and i was wondering if you could give me a few pointers to overcome
help me climb the learning curve (now that you are a seasoned expert :)
i have tried to familiarize myself with the 16c84 assembly language
(previous experience in c, etc), but i am still confused as to the proper
formatting for assembly (my attempts thus far result in mpalc error
messages)...
i have been trying to write a simple program to turn on and/or blink an led
on portb0 (sort of a pic "hello world" program) and was going to work up to
including use of subroutine calls and implementing the real time counter
and the appnote serial routine...
I'm glad you sent your message via the Internet, the local connection to the
PIC BBS is no longer working (I don't know why), so I haven't been logging on
there.
Anyway, it appears that you might be at the same juncture I was a few months
ago. I am a long way from really knowing Assembly code or the PIC. However, by
charting a certain goal, I have managed to "pick" up a few things that'd
gotten me started in the right direction. Just as you have noted, I too had
hardware ready and waiting for a PIC to be "plugged in". So, here's what I
did:
1. Sent out as many "help" requests as I could (looks like you have already
started).
2. Sorted out the "help" responses and used the "best qualified" advice.
3. Sought (and got) a lot of help building the application code (Assembly)
that met the needs of my hardware (cuz' I understand the hardware already).
4. Plugged in my PIC programmer to a computer and examined the code with a
simulator (PICSIM), to better understand what was going on in the PIC. This
was probably my biggest learning experience yet.
5. Assembled the code (from ASCII text to the various formats (ASM, BIN,
etc.), and studied what each looks like/is used for, etc.
6. Programmed a PIC (OTP type).
7. Put my hardware on a Proto-Board and plugged in the PIC to simply
"discover" what happens (it worked, mostly).
8. Fooled with the (ASCII) code and re-assembled it until the end result met
my desires (several times through this step).
So that's what I have done. I am not yet comfortable with the
code/programming, but I have learned that pure persistence will make up for a
lot of the programming knowledge I don't already have. As you know, most of
the PIC manuals, etc., look like they're written in some cryptic code. Well,
they are. My initial stumbling blocks were almost too simple for others to
grasp. Things like ....what format is the code supposed to be in when I type
out my program in ASCII text before assembling it, should I used the PIC
code or somebody else's (like Parallax's set of instructions), how do I know
how much code fits into the finite memory space, and so forth. I got answers
to these questions by doing the things noted here.
My "trial and error" has helped me complete my first PIC project. But as I've
said, I had an individual help me put together a relatively complex assembly
program. My next big step (which I'm working on) is to apply what I've learned
to put together another program from ground zero.
Since I'm mostly into hardware, I was a little uncomfortable in using the best
advice I received about programming PICS, "just go for it" (software generally
doesn't make any smoke). Any fatal errors will show up using PICSIM or at the
window of a Volt meter.
Don't hesitate to scratch me back a note whenever you want, we'll both likely
learn something.
From: Blackbird Msg#: 13089
To: Voytovich
Re: Macintosh versions?
(Reply to #13026)
There is a very good Macintosh assembler for the PIC called uASM from
Micro Dialects Inc, PO Box 190, Loveland, OH 45140, Ph: 513/271-9100.
It has integrated text editor, assembler, and communications modules.
It assembles code at between 7,500 to lines per minute, fully supports
macros,
automatic labels, local labels, conditionally assembly, includes to 10
level deep. The editor supports up to 10 open files at a time, full
search and replace including grep searches, and file size limited only
by RAM available. The terminal emulator supports data transfers at up
to 38,400 buad. We have been using this assembler for over a year now
and have had no problems at all. MDI is currently working on an upgrade
to support the 16C71, 84, 64, and 17C42.
We also use a programmer from Beradine Products Ltd, PO Box 86757, North
Vancouver, BC CANADA V7L4L3, Ph: 604/988-9853. Gary Anderson is very
helpful and makes the only RS-232 termial serial port compatible
programmer I know of. It supports communications up to 38,400 baud,
stand-alone or host operation, and is very inexpensive. We have also
used this for over a year with no problems.
We use Macintosh for development partly because our application is for
the AppleTalk environment. However we have found that development in
the Mac environment is much easier and more productive because of the
integration of these products. The only thing we miss is the capability
to run a simulator or ICE from our Mac. For those things we must use
our MS-DOS PC.
Full Name ....... Kevin L. Schoen
Title ........... Lead Development Engineer
Company ......... Blackbird
Location ........ New Albany, IN Employees ...... N/A
Business Type ... Microcontrol Manufac Annual Sales ... $N/a
E-Mail Addresses:
Compuserve ... . MCI Mail ....... .
The Source ... . Dialmail ....... .
GEnie ........ . FidoNetmail .... .
Voice Phone # ... 812/944-0799 Computer Type .. Apple Macintosh
Operating Sys ... Mac System 7 Comm. Program .. Zterm
BBS owned ....... none
BBSs used ....... none
Interests ....... PIC-based microcontroller modules with AppleTalk
communicati
Experience ...... N/a
Applications .... N/a
Languages ....... n/a
Summary: Microcontrollers w/ AppleTalk Comm
You obviously got the internet address right. Thank-you for the inquiry.
Yes, ASPIC is shareware and yes I wrote it. Actually the PIC version has
been around for 2 years, and the assembler has been available for other
processors for many years (it's now at version 5.32) but I finally decided
to release it because so many people were frustrated with PICALC (now
MPALC). ASPIC is currently available only for MS-DOS machines, (although I
do have an OS/2 version in beta).
My BBS has been sporaticly off line (which results in calls being routed
directly to the fax machine) for the last couple of months as I have been
restructuring my system. Please try again. If you are using an older, non
MNP modem, or ceartan non-standard modems which support so many protocols
that they time-out before a connection is made, all I can say is keep
trying, they will usually get through eventually.
The files you should get are ASPIC.ZIP and DEMO.ZIP. You're welcome to
brouse and take anything that interests you.
If you find it impossible to connect, drop me a private message on the
Microchip BBS and I will reply with an attached file (please us this only
as a last resort).
ASPIC can assemble Microchips CODE. The differences between the assemblers
is in what it does when it compiles. Although it has a lage selection of
assembler directives to choose from, it compiles 5 to 40 times faster. It
also follows many industry conventions (eg. postfix (0FEH, 10111010B) or
prefix ($FE, %10111010) notation, makefile compatable output and error
returns, parsable error messages for editors such as Multiedit, Brief or
Winedit which can automatically compile and then goto any lines in any
files with errors).
Some features are:
- One assembler for 16c5X, 16c7X, 16c8X, 17c42
- Compatable with PICSIM (MPSIM)
- Compatable with MAKE, and with auto-error tracking editors
- Many times faster than PICALC (MPALC)
- Standard base notation (Intel & Motorola format)
- CODE and FUNCTION macros
- Auto register bank management
- Text/data translation
- Automaticly generates RETLW tables for text and data tables
- Built-in version management and assembly control functions
- user command-line switches
Date: Thursday, August 5, 1993 6:08pm /APPLICN
From: Kenmun Msg#: 7755
To: ** ALL **
Re: Help for SHAWN (1 reply)
Shawn Dienhart, are you out there?
I could give you some pointers on assembly language programming. I'm
not an expert, but I could offer some caveats that could help you out.
Call me if you need to 1-413-684-3155 EST.
Or write:
Kenneth Pergola
122 Hemlock Hill
Dalton, MA 01226-1732
Glad you got a handle on the radix stuff (cuz' honestly I wouldn't have known
without first looking it up). I think your idea about a PIC.LIST on the
Internet would be outstanding. Every now and then I log onto the Circia(SP?)
Cellar BBS. PICS are often discussed in message threads there and there are a
few files relating to PICS on-line. The BBS is a mega-long distance call for
me so the opportunity to do much is limited.
I do have full access to the Internet...I'll do some poking around and see if
anything is going on there with the PIC.
Your message reached me via internet, although I will reply to the copy on
the microchip BBS because that way it can benifit the most PIC users who
sit on the sidelines and hope that someone will ask their questions for
them!
Sorry, I can't send files via Compuserve, otherwise I would send you a copy
of demo.zip.
You are welcome to get a copy off of my BBS @ (604)597-3479. In order to
get the most from it I would also suggest ASPIC.ZIP and NDMAKE43,ZIP (the
makefile in DEMO.ZIP has been tested on version 4.3 of NDMAKE, there is
also a newer version on-line.
2. For the time being, please send list addition/removal requests to the
list iteself. Within the week, there should be a separate address to deal
with administrative issues.
3. It may take a few days to get added-to/removed-from the list. Your
patience is appreciated.
4. Please don't widely publicize the list until the
administration/operational details are finalized later this week.
Hi, my name is Byron Jeff. I'm a PhD candidate at Georgia Tech and a
Asst. Prof. of Computer Science at Clark Atlanta University in Atlanta.
I think the mailing list is a great idea.
Anyway I just wanted to get the discussion going. After hearing about
the PIC 16C5X parts in Circuit Cellar INK, I quickly made friends with
my local Microchip Representative. I've gotten some samples of the
16C71, 16C54, and later on some 25 Mhz 17C42's.
Unfortunately I've had neither the time or the equipment to exploit
these chips yet.
I have a few areas of interest I'd like to share with you. Feel free to
send mail if you'd like to discuss it.
- Device programmers. Most of the talk on the sci.electronics newsgroup
has been about a homebrew 16C84 programmer. I can see why most folks
are attracted to the part because of the EEPROM. But while the PIC
programmers available are relatively inexpensive, there isn't a cheap
way to program all the PIC family members and adding up the costs of
the different programmers can get quit expensive. So in the small
amount of spare time I have I've been working up a design for a device
programmer.
Unfortunately device programmers are usually a catch-22
situation: the best way to build a device programmer is to start with
a programmed device. So my first target is going to be the PIC 17C42.
(BTW DIGI KEY is selling the 17C42 and the new 16C64.) There was an
article in Electronics NOW for a 16C5X programmer (that used a 17C42)
and it had a small blurb about a 17C42 programmer (that used a 8749 Intel
microcontroller). It seemed way too complicated. I'm planning on
bootstrapping from a PC.
- Languages - I've seen the adds for a C compiler for the PIC 16C5X series.
Seems like going duck hunting with a bazooka. I'm teaching a class in
system software development and 2 of the projects are a simple assembler
and compiler. I've choosen the PIC platform as the target. Unfortunately
none of my students completed the whole project. But I've been working
on it the compiler on and off. The language is a simpified C syntax.
I have the scanner, parser and expression evaluator done. All that's
left is code generation.
Because of this class I also have the shell of an assembler. Not that
PIC assembly is hard to do! I know that Microchip has assemblers for
their parts but it's MSDOS only and they don't have source available.
I'm a Linux user myself so DOS based tool have no real use for me.
In fact the Microchip DOS assemblers crash my Linux DOS emulator.
For the assembler I'm planning on MICROCHIP format only (no parallax
meta stuff) and just enough so that the compiler can use it.
BTW nothing is finished. However I'm hoping to spend some time next
month finishing up.
- Applications - My main hobby is computer based music. I'm currently
designing a hardware MIDI sequencer that's going to use PIC's for
IO processors for devices such as the keyboard/mouse, LCD display,
and MIDI serial ports. The main processor is a Motorola 68340 board
I put together last year.
Anyway just wanted to get the ball rolling on the mailing list. Tell us
about what you're trying to do with PIC parts.
> the different programmers can get quit expensive. So in the small
> amount of spare time I have I've been working up a design for a device
> programmer.
Is this device programmer going to plug into the serial or parallel
port of your computer? It would be nice if it used the serial port,
so those of us with non-IBM-PC computers can use it. I currently
have this problem with my BASIC Stamp software. My Amiga's IBM-PC
emulator will run Parallax's editor/downloader software, but it won't
program the Stamp because they do some direct I/O to the parallel
port, and my emulator gets confused.
I'd like to point out that after I set up the list, several people emailed
me with the likes of the followng:
>What's wrong with the one that already exists, @spam@stampKILLspamdiscus.mil.wi.us ?
>
>It was created a couple of months ago for discussion of the Basic STAMP
>programmed PIC, and general PIC stuff.
I am not familiar with this other list (I just sent a subscribe msg), so I
can't say how the two compare/complement/compete/etc.
However, I am also willing to consolidate the lists if people want that...
right now I am taking a wait and see attitude.
My personal interest is in assmbly programming and hardware issues.
I am presently using a 16c84 in an oceanographic instrument we've
developed. We are running @ 32 KHz, and our boards are set up to allow us
to reprogram the PIC in-situ via a serial downloader connected to a MAC (I
use a very tasty programmer/downloader, the Microburner 512 by Baradine
Products, which connects to my MAC (or any PC) via the serial port.) I also
use a MAC-based assembler. The only thing I need to run under SOFT-PC is
Microchip's simulation software.
Another bonus of the Microburner (which costs about $300 I think) is that
for around $50-100 you can get different adapter pod things in order to
program other PICs or other manufaacturers chips.
I've been working on other aspects of the project for the past couple
months, but will soon return to PIC programming for a spell.
My most recent software mini-project was implementing serial i/o on the PIC
@ 32KHz (in order to test our breadboard version of our hardware). Although
there is an appnote in the embedded control handbook on async serial (and
code on the microchip bulletin board) there were a few minor problems with
their approach.
1. It had some scaling constants based on crystal speed which required a
bunch of rounding and didn't work very well at low speeds (the resolution
of their approach was simply not fine enough).
1200 BAUD is so fast for a 32KHz crystal, that I ended up just coding it in
a stright fashion (no subroutine calls, etc). When I did need a pause, I
just used a nop.
However, I was still using the original bit send/ bit receive code from the
appnote. But:
2. If you look at the appnote code (the async routine) for sending serial,
you'll note that it takes one more instruction to send a one than it does
to send a zero, leading to an unpredictable differential in the total
length of a byte depending on the bits involved.
So I rewrote their send/receive routines to be tastier and (more
importantly) symmetrical.
Anyway, just a tidbit from my recent experience.
Moreover, I am still quite a programming neophyte, but I've found the PIC's
assembly to be quite fun and elegant.
In addition to the PIC email list, I am also interested in compiling (or
helping smoeone else compile) a PIC FAQ (assuming a good one doesn't
already exist). Additionally, it might be nice to set up another FTP site
(I know of that one in (Sweden was it?) but it seemed a bit out of date at
any one time, and I also feel you can't have too many FTP sites.)
In a PIC-related project not likely of wide interest to the rest of the group:
Right now, I am collecting various crystals (can and surface mount) in
order to find out which can withstand very high pressures, since out
instrument goes to the bottom of the ocean, and our electronics are
suspended in Fluorinert (a non-conducting fluid made by 3M, commonly used
in heat cycle testing of electronics) and see full ocean pressure.
>For those of you interested in programming in C for the
>Microchip controllers here's some information:
>
>The C compiler I purchased is from:
>CCS
>PO Box 11191
>Milwaukee, WI 53211
>
>phone # : 414-781-2794 ext.30
>
>They sell:
>C5x compiler for $50 which is for all the C5x series
>C71 compiler for $50
>
>
>If you call them, you will not talk to a human, but rather an
>automated system. When I ordered the compiler, I didn't
>know if anyone was listening (you leave your message on an answering
>message), but a few days later it arrived COD.
>
>I paid $60.00, including the shipping charges.
>
>From their advertisement in Circuit Cellar:
>-includes libraries for RS232 serial I/O and precision delays
>-allow call trees deeper than the hardware stack
>-and other things, I'm too lazy to type.
>
>
>From my point of view:
>I've only done a few projects (low level) so far. I interfaced
>the PIC with an LCD using C. I built a basic clock. The
>compiler helped out a lot when it came to the nested if-then
>statements for the seconds and minutes functions.
>
>I have also used the compiler to code up a little game, like
>Simple Simon, where the computer picks a random light to turn
>on , and the user has to remember the sequence of lights and
>enter the sequence to win. The compiler helped out here
>where I needed an array to store the sequence. One of
>the great things to aid in this project was the compilers
>SET_UPCOUNTERS command, where I initialized the internal
>counter for my random number generator.
>
>By the way, I am in no way connected to this compiler.
>I am just a satisfied customer. For $50 (+$10 shipping) I
>didn't go wrong.
>
>--
>Jeff D.
>RemoveMEjpdagueEraseMEEraseMEiastate.edu
> ... It would be nice if it used the serial port,
> so those of us with non-IBM-PC computers can use it....
I have been using a serial programmer for years which is completely ASCII
controlled and quite portable. It's from Baradine Products in North
Vancouver, BC. And it's not very expensive. It programs EPROMS, EEPROMS,
and microcontrollers including PIC 5X, 7X, 8X, 17c42 (and 6X is comming).
It uses the serial mode for 6x+ parts so you can use it for in-circuit
programming.
I have written a (sorry, DOS) based command line programmer for it (so it
can be used from a makefile) which is available on the MICROCHIP BBS.
Without trying to sound like an ad (I am not in any way connected with
Baradine) they can be contacted at 800-668-7886 (north america) or (604)
988-9853.
ujonsson@magnus.acs.ohio-state.edu (Ulf Jonsson) write in response to an
earlier post of mine:
-snip-
ulf asks about mac asssembler...
-snip-
Here is some info I had that someone else had given me about mac
developmnt. The assembler was about $100-150. Note that the programmer is
the same one Don Lekei and I have both mentioned and/or endorsed.
***************************begin insertion ****************************
There is a very good Macintosh assembler for the PIC called uASM from
Micro Dialects Inc, PO Box 190, Loveland, OH 45140, Ph: 513/271-9100.
It has integrated text editor, assembler, and communications modules.
It assembles code at between 7,500 to lines per minute, fully supports
macros,
automatic labels, local labels, conditionally assembly, includes to 10
level deep. The editor supports up to 10 open files at a time, full
search and replace including grep searches, and file size limited only
by RAM available. The terminal emulator supports data transfers at up
to 38,400 buad. We have been using this assembler for over a year now
and have had no problems at all. MDI is currently working on an upgrade
to support the 16C71, 84, 64, and 17C42.
We also use a programmer from Beradine Products Ltd, PO Box 86757, North
Vancouver, BC CANADA V7L4L3, Ph: 604/988-9853. Gary Anderson is very
helpful and makes the only RS-232 termial serial port compatible
programmer I know of. It supports communications up to 38,400 baud,
stand-alone or host operation, and is very inexpensive. We have also
used this for over a year with no problems.
We use Macintosh for development partly because our application is for
the AppleTalk environment. However we have found that development in
the Mac environment is much easier and more productive because of the
integration of these products. The only thing we miss is the capability
to run a simulator or ICE from our Mac. For those things we must use
our MS-DOS PC.
****************************end insertion *****************************
ulf goes on to ask:
>Do you know if the PicStart can be used through the serialport from the mac
>under SoftPC. I will buy one myself on the seminar but i don't know if I
>can use it with the mac or if I need to run to some PC user to burn my
>chips.
>
>Is it possible to play with the BasicStamp from a PC? I think you need a
>paralell port but is there some other way?
The PICstart *CANNOT* be used through the serial port of the mac using
SOFTPC. While the software works fine, uchip uses a completely nonstandard
serial connection which is completely incompatible with the mac's serial
ports. (i know this both from exapnded knowledge from uchip and those who
know a lot about mac serial, and also fro having tried it mayself with
total failure the result)
I know nothing (insert images of colonel klink) about STAMP, perhaps
someone else can help you.
>>In a PIC-related project not likely of wide interest to the rest of the group:
>>Right now, I am collecting various crystals (can and surface mount) in
>>order to find out which can withstand very high pressures, since out
>>instrument goes to the bottom of the ocean, and our electronics are
>>suspended in Fluorinert (a non-conducting fluid made by 3M, commonly used
>>in heat cycle testing of electronics) and see full ocean pressure.
>
>How high pressure will the chips take? I have a application where i would
>like to put LED's and phototransistors into a high pressure chamber (200 to
>5000 bar)
Normal can crystals die somewhere between 5000 and 10000 PSI (pretty
limited/rough data so far, since they worked @ 5000, then we went to 10,000
and the cans crushed... i also don't have long term data).
Oh yeah, the chips themselves will should take that pressure (if my
experience is any measure).
-jory
ps: one cute tidbit from my attempt to hook-up a picstart to mac serial was
that you can get the conversion from mac-->pc serial by opening the
appletalk tool with resedit. in it, there is a pict resource with the
pinout of the mac serial, and how to connect it to a pc serial cable)...
I recently bought a DS-750 kit for doing development work on the Philips
87C750 microcontroller. The only thing is, the EPROM version of these
chips cost about $15 each which seems a bit expensive compared to the
PIC chips. Are the 8051 controllers more powerful than the PIC's?
If the $15 prices is for the windowed EPROM version of the chip, then
it is comparable to the PICs (the low priced versions are not windowed.)
THe 8051 familly is at LEAST broader and more widely sourced than the PIC.
You can get 8051 controllers capable of addressing 64k each of program and
data memory (both 8bits wide) with A-D converters and 84 pin packages from
both Intel and Phillips. Whether the "small" 8051s are as useful as a
small PIC, and whether a broader line makes the 8051 more "powerful" are
pretty meaningless questions that are probably pointless to debate. I
believe that a PIC has a faster "minimum instruction cycle" than most
8051s - another meaningless metric.
Also, has anyone some idea as to the cheapest, yet effective way to get
into PIC development? How much is the PICstart kit these days?
The Picstart kit is $180 from digi-key these days. I think parallax still
has their cheaper programmer/downloader ($99?)
Without low volume distributers like parallax and digikey, the 8051 series
of "tiny" processors is unlikely to create nearly as much interest as the
PIC has in the last few years...
I recently bought a DS-750 kit for doing development work on the Philips
87C750 microcontroller. The only thing is, the EPROM version of these chips cost about
$15 each which seems a bit expensive compared to the PIC chips. Are the 8051
controllers more powerful than the PIC's?
Also, has anyone some idea as to the cheapest, yet effective way to get into
PIC development? How much is the PICstart kit these days?
help,
can anyone tell me if it is possible to use the pic16c54/55/56/57
programmer to program the pic16c84 without serious adjustment, if so how.
I know its possible to program the pic16c84 using the rs232 port on the pc
but would prefer not to use this method.
B.barry
>
> help,
> can anyone tell me if it is possible to use the pic16c54/55/56/57
> programmer to program the pic16c84 without serious adjustment, if so how.
> I know its possible to program the pic16c84 using the rs232 port on the pc
> but would prefer not to use this method.
The chips don't have the same programming setup. The 84 is more like the 71
than the 5X series. There's no easy way to convert a 5X programmer to
program either the 84 or the 71 because the latter two have serial interfaces
and their programming voltage pins are located in a different place.
>
> Hi all.
>
> I've been interested in 8051s for ages - but someone recently introduced
> me to the ridiculously cheap DIY PIC16C84 programmers, and Im now a
> total convert...
Most of us are.
>
> Some questions:
>
> The PIC mnemonics, IMHO, are terrible. Is there a 'standard' better
> mnemonic set?
Well parallax has a set of mnemonics that are 8051 based. The two problems
are that you no longer know exactly how long each instruction is and that
you need the parallax assembler.
Personally I find the PIC instruction set very clean and concise. Very good
for compiler writing. A PIC compiler of a language somewhere between C and
BASIC is one of my summer projects.
>
> Are there any example PIC sources available?
Call Microchip or a local rep and ask for the applications notes for the
PIC series. It has dozens of example programs for you to look at. And all
of them are in the original PIC instruction set so you can see how the
set operates.
> Is the serial programming algorithm of the 16C84 the same or similar to
> that of the other two recent PICs (I forget the names - the 33 IO pin
> one, and the one with internal ADC) -
There are two 40 pin chips (17C42 and 16C64). The internal ADC is a 16C71.
> Can I use a similar modified serial programmer to blow these?
The 16C84 and the 16C71 use almost the same serial algorithm.
A good idea is to get the Microchip Microcontroller data book. It has not
only the data sheets for all the parts but the programming algorithms too.
Michchip is just too cool with the way they interact with us hobby
enthusiasts!
> help,
> can anyone tell me if it is possible to use the pic16c54/55/56/57
> programmer to program the pic16c84 without serious adjustment, if so how.
> I know its possible to program the pic16c84 using the rs232 port on the pc
> but would prefer not to use this method.
> B.barry
I suppose it might depend on the programmer, but the Picstart I have
manages to program 16C84 and 16C71 with no problems. I have read that
you need the more modern firmware (1.5?) and software (on the ftp sites,
or with current picstarts) in order to correctly program the fuses on the
16C84, but mine had no problems whatsoever.
The ultimate check is the current databook (1993 in the UK ;-) which has the
programming details for the whole range.
> >
> > help,
> > can anyone tell me if it is possible to use the pic16c54/55/56/57
> > programmer to program the pic16c84 without serious adjustment, if so how.
> > I know its possible to program the pic16c84 using the rs232 port on the pc
> > but would prefer not to use this method.
>
> The chips don't have the same programming setup. The 84 is more like the 71
> than the 5X series. There's no easy way to convert a 5X programmer to
> program either the 84 or the 71 because the latter two have serial interfaces
> and their programming voltage pins are located in a different place.
>
> Later,
>
> BAJ
Not quite as the 84 and 71 have BOTH parallel (like 5X) AND serial interfaces,
like I said (though it isn't back here yet) PICSTART copes quite well, I used it last
night ;-)
=%-)
Ian
p.s. I haven't got my data book here, but don't 16C5X and 16C84/16C71 all use *MCLR as
their Vpp pin, in which case it is on the same pin. (Could be wrong... often am ;-)
>
> > >
> > > help,
> > > can anyone tell me if it is possible to use the pic16c54/55/56/57
> > > programmer to program the pic16c84 without serious adjustment, if so how.
> > > I know its possible to program the pic16c84 using the rs232 port on the pc
> > > but would prefer not to use this method.
> >
> > The chips don't have the same programming setup. The 84 is more like the 71
> > than the 5X series. There's no easy way to convert a 5X programmer to
> > program either the 84 or the 71 because the latter two have serial interfaces
> > and their programming voltage pins are located in a different place.
> >
> > Later,
> >
> > BAJ
>
> Not quite as the 84 and 71 have BOTH parallel (like 5X) AND serial interfaces,
> like I said (though it isn't back here yet) PICSTART copes quite well,
> I used it last night ;-)
> p.s. I haven't got my data book here, but don't 16C5X and 16C84/16C71 all use *MCLR as
> their Vpp pin, in which case it is on the same pin. (Could be wrong... often am ;-)
>
Well now I can actually say something because I have my data book here:
Ian is correct. The *MCLR pin is the same for the 5X/71/84 as is the RB6 and
RB7 pins. But the programmer has to be smart enough to run the serial
algorithm on the 71 and 84 to put it into parallel mode. So if the programmer
is specifically designed for the 5X series, you'll have to change the
program for the board in order to get the 71 and 84 to work.
> It is always better to get used to the manufacturer's mnemonics as any code
> examples or help you get from others is likely to be in that form. A good
> macro assembler will allow you to generalize your code to make it more
> portable.
I take your point as a general idea, but come on - ADDWF f,d where d is
*direction*!!! Whats wrong with ADD f,W / ADD W,f?
Ive programmed Z80, 6502, 8051, 77C82, ARM2, 68000 - and I have to say
that the PIC has the least user friendly mnemonics of the lot.
Still - Im sure I'll get used to them in time...
Peter
-
Peter Knight Email: RemoveMEp.j.knightKILLspamuk.ac.bradford Mono: Cathedrow
_ _ _ _
Who says you can't display letters on a 7 | _| |_ |_ |_| _| _ _ _|
segment display? OK, so you can't do a W..|_ |_| |_ | | |_ |_| | |_| _|
Im having severe problems getting hold of the PIC16C84 in the UK - Maplin
dont have any in stock, and reckon the entire UK wont get stock of them
for months.
I take Maplin advice with a pinch of salt - but even Farnell, who I also
tried, were out of stock for 4 weeks at the very least.
Where can I get my hands on a PIC to test my newly assembled programmer?
Peter
-
Peter Knight Email: p.j.knightSTOPspamspam_OUTuk.ac.bradford Mono: Cathedrow
_ _ _ _
Who says you can't display letters on a 7 | _| |_ |_ |_| _| _ _ _|
segment display? OK, so you can't do a W..|_ |_| |_ | | |_ |_| | |_| _|
Tom,
Thanks for the question:
> Tell me more about ASPIC ?
I will try to avoid making it sound like an ad <smile>...
ASPIC is a shareware assembler (reg = $100 CDN ($69 US)) which has been in
use since late 1991 for PIC and since 1986 for other processors (NEC
78c10, Mitsubishi MELPS 8 and 16 bit). It is **DESIGNED** for embedded
controler design, so it has som unusual features like character set
translation (eg. for LED, LCD, and On Screen Displays), bit labels,
environment labels, etc.
It is very stable (only 3 bugs reported and fixed in the last 2 years), and
it integrates well with other developement tools. A short list of features
reads something like:
- One assembler for 16c5X, 16c7X, 16c8X, 17c42
- Compatable with PICSIM (MPSIM)
- Compatable with MAKE, and with auto-error tracking editors
- Many times faster than PICALC (MPALC)
- Standard base notation (Intel & Motorola format)
- CODE and FUNCTION macros
- Auto register bank management
- Text/data translation
- Automaticly generates RETLW tables for text and data tables
- Built-in version management and assembly control functions
- user command-line switches
- many other features
(hope that didn't sound too much like an ad, but the shareware license has
an unusual clause absolving those who don't register but only use it for
non-commercial purposes)
I can't ftp from compuserve, but it is available around. Try microchips
bbs (3rdparty file area) or my BBS @(604) 597-3479.
I just received confirmation of my registration for the upcoming PIC seminar,
along with a few brochures.
One of the brochures includes some parts I had not previously heard of, the
PIC16C74 and PIC17C44.
The PIC16C74 is apparently sort of an improved combination of the 16C64 and
16C71. It is available in 40 and 44 pin packages like the 16C64, and has
even more memory (4K*14 program, 192*8 data). It has an 8-channel 8-bit A/D
(presumably similar to the 4-channel A/D of the 16C71).
I hope the PICSTART-16C will program the 16C74. I don't want to buy yet
another programmer. (By the way, does anyone know whether the PICSTART-16B
will program the 16C58A?)
The PIC17C44 appears to be a 17C42 with more memory. I've never been
convinced that the 17C42 was a very cost effective part, so I doubt that the
17C44 will be either.
On 18 May 1994, Peter Knight <spamBeGoneP.J.KnightSTOPspamEraseMEbradford.ac.uk> wrote:
> I take your point as a general idea, but come on - ADDWF f,d where d is
> *direction*!!! Whats wrong with ADD f,W / ADD W,f?
I agree with your comments about Microchip's syntax being suboptimal, but
I should point out that the ",d" doesn't specify the direction, it specifies
the destination. While this may seem like a minor point, consider the
SUBWF instruction:
SUBWF FOO,W ; W := FOO - W
SUBWF FOO,F ; F := FOO - W
While discussing subtract instructions, I should point out that the SUBLW
instruction subtracts the contents of W *FROM* the literal, which is not what
people generally expect.
At first this seemed brain-damaged but then I discovered that it is useful.
If you want to take the two's complement of W, for instance, you can use
SUBLW 0 ; W := 0 - W
If you want to subtract a literal from W, you can use the ADDLW
instruction with the two's complement of the literal:
ADDLW 0feh ; W := W - 2
Some assemblers will let you write this in a natural form:
> On 18 May 1994, Peter Knight <KILLspamP.J.KnightspamBeGonebradford.ac.uk> wrote:
> > I take your point as a general idea, but come on - ADDWF f,d where d is
> > *direction*!!! Whats wrong with ADD f,W / ADD W,f?
>
> I agree with your comments about Microchip's syntax being suboptimal, but
> I should point out that the ",d" doesn't specify the direction, it specifies
> the destination. While this may seem like a minor point, consider the
> SUBWF instruction:
OK - my mistake - I did mean destination...
Thanks for the hint on SUBLW - I missed that subtle point!
Peter
-
Peter Knight Email: EraseMEp.j.knightEraseMEuk.ac.bradford Mono: Cathedrow
_ _ _ _
Who says you can't display letters on a 7 | _| |_ |_ |_| _| _ _ _|
segment display? OK, so you can't do a W..|_ |_| |_ | | |_ |_| | |_| _|
I'm doing a degree in Information Technology at would like to get into
programming PICs.
I've obtained a copy of the MICROCHIP data book and details of their
development kits. Unfortunatly I cannot really afford the development kit, I
was looking at the PICSTART-16B at 125 UK pounds. Especially as I think I
can get assemblers etc. for my PC of the net and already have the data book.
SO, does anyone know of a cheaper programmer? Ideally it will be able to
program 16C5X, 16C71 and 16C84 devices and be PC based.
Alternatively does anyone in the UK have an "old" programmer that they want
to pass onto a student cheaply?
Thanks for any help you give,
Rafe
----------------------------------------------------------------
Rafe Aldridge - @spam@rca@spam@spam_OUTsirius.tn.rl.ac.uk
R65, Rutherford Appleton Lab, wwWWww
Chilton, Oxon, OX11 OQX, UK. o o
------------------------------------------------ooO--(__)--Ooo--
> SO, does anyone know of a cheaper programmer? Ideally it will be able to
> program 16C5X, 16C71 and 16C84 devices and be PC based.
I can throughly recommend 'pic84pgm.zip' off the Microchip BBS, or
available via Circuit Cookbook on ftp -
bode.ee.ualberta.ca:/pub/cookbook/comp/ibm/pic84pgm.zip
Its a very easy to make PC based PIC16C84 programmer.
(I have to admit - I havent actually tried it yet - My first batch of
PIC17C84's is still on back order... :-( )
Peter
-
Peter Knight Email: spamBeGonep.j.knightKILLspamuk.ac.bradford Mono: Cathedrow
_ _ _ _
Who says you can't display letters on a 7 | _| |_ |_ |_| _| _ _ _|
segment display? OK, so you can't do a W..|_ |_| |_ | | |_ |_| | |_| _|
> On Thu, 26 May 1994, Rafe Aldridge wrote:
>
> > SO, does anyone know of a cheaper programmer? Ideally it will be able to
> > program 16C5X, 16C71 and 16C84 devices and be PC based.
>
> I can throughly recommend 'pic84pgm.zip' off the Microchip BBS, or
> available via Circuit Cookbook on ftp -
> bode.ee.ualberta.ca:/pub/cookbook/comp/ibm/pic84pgm.zip
>
This won't handle the 16C5X series, but I'm currently designing
something for that. :-)
Catch22 ? It uses a <pre-programmed> PIC. <g>
Not to panic, I'll make it available at cost<ish>, that is, to
people that talk nice to me. :-)
--
Cheers
Tom
>
>The PICstart *CANNOT* be used through the serial port of the mac using
>SOFTPC. While the software works fine, uchip uses a completely nonstandard
>serial connection which is completely incompatible with the mac's serial
>ports.
Hi Jory,
Sorry that i posted the same question again. I belive fully in what you
said but a forgot your mail in the exitement over getting my own Picstart I
mixed it up with a post i got from a Amiga guy.
My wife was not happy when I told her that i might need space for one more
computer at home (Flintstone IBM PC).
Do you think that there is a possibility to get around the problem by any
meens, like putting a pic inbetween as a translator?
I am designing a simulator(using a pic) that does a slewing fuction. It
is for a class project. Here is my project.
I am makeing a device that will simulate the brakeing of a car.(well
sorta of). Its not real accurate since I dont take into account a lot of
factors like variable weights and variable braking speeds but its a
project. As a matter of fact its pretty close to a half-ass design. But
once again, its all I have to do for the class.
I give the pic a frequency(8 bit 255 in 1.3Hz increments, 70-400HZ) and
have a jump table that does the
Hz->clock cycles for me. Now i have 5 bit slew rate(other 3 bits are
someting else) that represents my braking. The slew is fixed at 330 to
8.3 Hz/sec. Which translates into 255 to 8.3(?) cycles/second. Well
here is my problem. If I only adjust the pulses output per second once a
second it would simulate a vibrater more then a car stopping. ie once
every second I would slow the car by 10.3 Hz or 330Hz.(like braking in a
YUGO :) ok another flaw, brakes are not digital(I dont think) put play
with me. My problem is I dont have and external clock for set time
interupts so I cant decrease the Hz evenly. So i opted to do everything
on a pulse by pulse basis. my problem is how do i find what 10.3 Hz(or
8.3 cycles) would add to my pulse period? I have tried the divide
routines from microchip and found that they have too little acuracy and
generaly dont work worth a flip. If you dont understand my question
email me, i will try to explain it better.
to sum it up
I need to translate 8.3 cycles/sec into a period to which I can add to
the Current period i am outputting. this is a problem is the person is
driving at 300Hz and trys to stop at 8.3 cycles a sec(the amount i would
add to each period) then if the person was moving at 200Hz. Also does
anyone have any math routines that work? I could use them.
Help me please
John
_____________________________________________________________________________
John Johnson |If it's not OS/2.|.....johnsonjRemoveMEccwf.cc.utexas.edu
|It's crap! |RemoveMEjohnsonjspamBeGoneghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
> hi,
>
> i manage the pic list, and i was wonderin if you had any trouble with
> posting, or any odd bounces, etc. I am trying to track down a problem.
>
> thanks,
>
> jory
>
>
>
_____________________________________________________________________________
John Johnson |If it's not OS/2.|spamBeGonejohnsonj@spam@spam_OUTccwf.cc.utexas.edu
|It's crap! |TakeThisOuTjohnsonjspamghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
The easiest way to generate a slope in an integer system is to use a
sum-tracking algorythm (y=mx+b where m = dy/dx). Take the ratio of dy:dx
and add dx while the result is negative then subtract dy while the result
is positive.
The sign of the result at each step indicates whether the next step is x or
y (or in your case, whether or not to decrement the frequency on the next
pulse). The slope can be varied related to another slope to simulate
higher order or non-linear functions.
If you normalize your time constants around 256 then there is no need to
actually do any division or multiplication.
If you still find yourself unable to solve this problem without a decimal
point, may I suggest that you voluntarily check yourself into the Betty
Ford center for the treatment of "float" addiction <G>.
I have solved my problem.. I just quite thinking in terms of HZ and went
to cycles. Also i got some math routines to work(not bloating but 16bit
at least). Aslo i did some calculations on my frequencies and found that
this car would be moving between 800mph-2500mps(thats hauling ass).
Needless to say no cop would ever catch ya.
later
John
_____________________________________________________________________________
John Johnson |If it's not OS/2.|johnsonjEraseMEccwf.cc.utexas.edu
|It's crap! |RemoveMEjohnsonjEraseMEspam_OUTghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
Hi Folks,
As threatened by Jory, here is the first draft of the brand
new PIC FAQ for your perusal. Please give it a glance and help me
to fill in some of the gaps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
This article is a collection of information sources for the PIC
family of microcontrollers (and variants).
The following topics are addressed:
0 ) Index
1 ) ABOUT THIS FAQ
1.1) Who put this FAQ together?
1.2) How can I contribute to this FAQ?
1.3) What newsgroups will this FAQ be posted to?
1.4) Can I distribute this FAQ or post it somewhere else?
2 ) ABOUT THE PIC
2.1) The PIC microcontroller
2.2) PIC representatives and approximate prices
3 ) PIC Utilities
3.1) FTP sites for the PIC
3.2) BBSs that support the PIC
3.3) Programming languages (3rd Party)
3.4) -:- hardware -:- -:-
4 ) PIC DOCUMENTATION
4.1) Periodicals that cover the PIC
4.2) Books on the PIC
4.3) Miscellaneous documentation on the PIC
This FAQ will be posted to the following newsgroups:
sci.electronics
???.????? ---- suggestions ?
The schedule for posting will be once a month.
1.4) Can I post this FAQ to my local BBS?
I am putting no restrictions on the use of this FAQ except - It
must be distributed in its entirety and no financial gain may be
realized from it.
2) ABOUT THE PIC
Comments & Descriptive prose .... anyone ?
2.1) The PIC microcontroller
The PIC series are eprom based 8-bit microcontrollers
developed by Microchip Technology
<List of Addresses to go here >
2.2) PIC Variants
List required here
3) PIC SOFTWARE
This section includes pointers to software for the PIC.
FTP sites and BBSs
3.1) FTP sites for the PIC
FTP SITE Directory
ftp.sics.se /pub/mchipsoft/
The files here are publicly available from the Microchip BBS via
Compuserve. Since many people interested in these files have an
internet connection, the files have also graciously been made
available at SICS by Anders Nobinder of Memec Scandinavia, Microchip's
Swedish agent.
ftp.funet.fi (nic.funet.fi)
3.2) BBSs that support the PIC
Microchip BBS
Contact by dialing the same number you would use to get to
Compuserve at 19200,n,8,1, except that you press +<CR> at the
(garbage)
prompt, followed by MCHIPBBS as the host (instead of CIS).
Don Lekei BBS
(Canada) (604) 597-3479
3.3) PIC programming languages (3rd Party)
Host m/c PC
Prog. Name ASPIC Shareware `C' assembler (reg = $100 CDN ($69 US))
**DESIGNED** for embedded controller design
the shareware license has an unusual clause absolving
those who only use it for non-commercial purposes
Supplier/Author Don Lekei < @spam@72677.2623spam_OUT.....compuserve.com >
BBS at (Canada) (604) 597-3479
- One assembler for 16c5X, 16c7X, 16c8X, 17c42
- Compatable with PICSIM (MPSIM)
- Compatable with MAKE, and with auto-error tracking editors
- Many times faster than PICALC (MPALC)
- Standard base notation (Intel & Motorola format)
- CODE and FUNCTION macros
- Auto register bank management
- Text/data translation
- Automatically generates RETLW tables for text and data tables
- Built-in version management and assembly control functions
- user command-line switches
- many other features
-character set translation (eg. for LED, LCD, On Screen Displays)
- bit labels, environment labels, etc.
Features: An integrated text editor, assembler
and communications modules. fully supports macros,
automatic labels, local labels, conditionally assembly,
includes to 10 level deep.
The editor supports up to 10 open files at a time, full
search and replace including grep searches,
file size limited only by RAM available.
The emulator supports data transfer up to 38,400 baud.
NOTE: The uASM code is incompatible with the MicroChip Simulator
<unless you know better ? >
Product programmer
Model Microburner 512
Supplier Beradine Products Ltd,
PO Box 86757,
North Vancouver,
BC CANADA V7L4L3,
Ph: 604/988-9853.
Contact Gary Anderson
Features RS-232 terminal serial port compatible programmer
Supports communications up to 38,400 baud,
stand-alone or host operation,
4) PIC DOCUMENTATION
4.1) Periodicals that may cover the PIC.
The Computer Applications Journal (Circuit Cellar Ink)
- programming and construction articles
- POB 7694, Riverton, NJ 08077-8784
- FAX: (203)872-2204
- Voice orders: (609) 786-0409
- On-line orders (BBS): (203) 871-1988
- Email orders: spamBeGoneken.davidsonEraseMEcircellar.com
- $21.95, $31.95 surface Canada and Mexico,
$49.95 air all other countries
Computer Design
industry announcements and trends
One Technology Park Drive,
P.O. Box 990, Westford, MA 01886
(508)692-0700
The Computer Journal
- programming and construction articles
- PO Box 535, Lincoln 96648
Dr. Dobbs Journal
- programming articles, concepts and designs
- 411 Borel Ave., San Mateo, CA 94402
- (415)358-9500
Electronic Engineering Times
- industry announcements and trends
- 500-B Bi-County Boulevard, Farmingdale, NY 11735
- (516)293-3000
Electronics Now
- construction articles
- Box 55115, Boulder, CO 80321-5115
- $19.97 one year
Elektor Electronics
- programming and construction articles
- World Wide Subscription Service Ltd
Unit 4, Gibbs Reed Farm, Pashley Road
Ticehurst TN5 7HE, England
- 27 UK pounds
or
- Old Colony Sound Lab,
- P.O. Box 243, Peterborough, NH 03458
- Tel. (603) 924-6371, 924-6526
- Fax: (603) 924-9467
- $57 USA and Canada per year
Embedded Systems Programming
- programming and systems design articles
- Miller Freeman Publications
- 500 Howard St., San Francisco, CA 94105
- (415) 397-1881
Microcomputer Journal (formerly Computer Craft)
- programming and constructions articles
- 76 N. Broadway, Hicksville, NY 11801
- $18.95 one year, foreign $23.00, foreign air mail $76.00
Midnight Engineering
- 1700 Washington Ave., Rocky Road, CO 81067
- (719)254-4553
4.2) Books on the PIC
I don't have much information on this, only that one exists. I
would greatly appreciate it if someone could provide a short
synopsis and the complete book name, as my copy has not
been delivered yet. [it's in the post, honest !]
I would like to thank the following individuals who have
contributed to this accumulation.
Jory Bell
Don Lekei
NOTE: .......If your name should be here, apologies. some of the
above has been dredged from Jory's archives in such a fashion as to
make it less than convenient to work out with whom it originated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (c) 1994 by T.A.Kellett, all rights reserved.
_______________________________________________________
Tom Kellett < TomspamBeGonetakdsign.demon.co.uk >
Hong Kong:
Microchip Technology Inc.
Unit No. 2520-2525
Tower 1, Metroplaza
Hing Fong Road, Kwai Fong
N.T., Hong Kong
tel: 852 410 2716
fax: 852 418 1600
Italy:
tel: 39 039 689 9939
Japan:
Microchip Technology International Inc.
Shinyokohama Gotoh Bldg. 8F, 3-22-4
Shinyokohama, Kohoku-Ku, Yokohama-Shi
Kanagawa 222 Japan
tel: 81 45/471-6166
fax: 81 45/471-6122
Korea:
tel: 82 2 518 8181
Singapore:
tel: 65 222 4962
Taiwan:
tel: 886 2 760 2028
United Kingdom:
Arizona Microchip Technology LTD.
Unit 3, Meadow Bank, Furlong Road
Bourne End, Bucks SL8 5AJ
tel: 44 062-885-1077
fax: 44 062-885-0178
United States:
Microchip Technology Inc.
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
tel: (602) 786-7200
fax: (602) 899-9210
=============================================================================
Other useful contacts:
Parallax - makes programmers, downloaders, emulators, etc.
tel: (916) 624-8333
fax: (916) 624-8003
bbs: (916) 624-7101
Advanced Trans Data - makes programmers, emulators, etc.
tel: (214) 980-2960
fax: (214) 980-2937
Micro Engineering Labs - makes PIC-Proto boards
tel: (719) 520-5323
Myriad Development - C compiler
tel: (303) 692-3836
CCS - C compiler
tel: (414) 781-2794 extension 30
Needham Electronics - I don't think they make PIC stuff, but they make a great
inexpensive EPROM programmer, the PB-10
tel: (916) 924-8037
fax: (916) 972-9960
bbs: (916) 972-8042
=============================================================================
For section 2.2:
PIC processors are available in three families, which Microchip refers to as
the PIC16C5x, PIC16Cxx, and PIC17Cxx families.
PIC16C5x: 12 bit program word size, 33 instructions, 2 level stack,
no interrupts
PIC16Cxx: 14 bit word size, 35 instructions, 8 level stack
Program Data Max. Voltage Typical Digikey
memory memory I/O freq. Range Current Price
(words) (bytes) pins (MHz) (Volts) (mA) (US $)
---------- --------- --------- ----- ----- -------- ------- -------
PIC16C64 2048 128 33 20 2.0-6.0 3 11.05
PIC16C71 1024 36 13 16 3.0-6.0 2 14.38
PIC16C74 4096 192
PIC16C84 1024 EE 36 + 64 EE 13 10 2.0-6.0 2 10.15
PIC17Cxx: 16 bit word size, 55 instructions, 16 level stack:
Program Data Max. Voltage Typical Digikey
memory memory I/O freq. Range Current Price
(words) (bytes) pins (MHz) (Volts) (mA) (US $)
---------- --------- --------- ----- ----- -------- ------- -------
PIC17C42 2048 256 33 25 4.5-5.5 6 15,15
PIC17C44 8192 480 33 25
Notes:
1. Program memory is EPROM unless otherwise noted.
2. Data memory is number of usable bytes, not including special function
registers.
3. Digikey prices are quantity 10 prices for 4 MHz DIP packaged OTP parts
with RC oscillator option (where applicable), except that the 16C84 uses
EEPROM program memory, and the slowest speed 17C42 is rated at 16 MHz.
Prices are from Digikey catalog number 943 for May/June 1994.
Other distributors often have lower prices, but typically also have
high minimum order requirements. Digikey also usually has plenty of
parts in stock. Windowed EPROM parts cost substantially more.
=============================================================================
Notes for programmers:
All PIC instructions are a single word. The equivalent of the immediate
address mode of other processors is the literal mode, used by instructions
ending in "LW", such as MOVLW, ADDLW, SUBLW, ANDLW, IORLW, XORLW, and RETLW.
The byte of data used by these instructions is directly encoded in the
instruction itself.
All PIC instructions take a single instruction cycle (four oscillator cycles)
to execute, except instructions which can cause a change of flow or have PCL
as their destination, which take two instruction cycles. The Microchip
documentation is misleading in that they claim that two cycles are taken
only if the PC changes. Actually any instruction which potentially could
change the PC takes two cycles. For example:
movlw 37
goto next
next: movwf porta
The goto instruction takes two cycles even though the PC doesn't change.
This is useful as a two-cycle NOP, and is often written as "goto .+1" to
avoid the need for a label.
The W register is equivalent to the accumulator on other processors. Almost
all data movement, arithmetic, and logic operations use W.
Instructions that operate on W and a register (i.e., instructions ending in
"WF", like ADDWF and MOVWF) allow the result to be placed in either W or the
register (but not both). This is specified by a ",W" or ",F" after the
operand. The default is ",F", which will place the result in the register.
This can cause a lot of confusion if you're not careful, so I recommend
always specifying the destination explicitly. An example of a confusing
instruction:
incf foo,w ; w := foo+1 note that foo is unchanged!
If you want the result in both W and the register, you can use either:
incf foo,w
mowwf foo
or:
incf foo,f
movf foo,w
The stack is not accessible to the programmer in any way other than the
call and return instructions. There is no way to push or pull data, or even
to examine the stack pointer. On the 16C5x family the stack has only two
levels, so it is frequently necessary to write code in a different style than
would be used on a typical processor; you can only call subroutines from your
main code, or from a subroutine called from main, but no deeper.
The 16C5x family doesn't have a normal return instruction; instead it has
RETLW, which stands for RETurn Literal Word. RETLW loads an eight bit
constant into W (just as a MOVLW instruction would), then returns from the
subroutine. This can be useful, but is agravating if you want to return a
computed value. On the newer PIC families there is a normal RETURN
instruction.
With the exception of the 17Cxx family, there is no way for software to read
an arbitrary location of program memory. In order to implement lookup tables,
it is necessary to combine the use of the ADDWF and RETLW instructions. For
example, the following code implements a lookup table of the first four odd
prime numbers:
To use the table, load the appropriate index (in this case, 0 to 3) into W,
and "call primes". The addwf instruction adds the contents of W to the PC,
which has already been incremented to point to the "retlw 3". The table will
return with the value in W. The total time taken is 6 instruction cycles, or
24 oscillator cycles.
Note that while on most processors the use of an out-of-range index will
result in the use of incorrect data, but the program execution will continue
normally, on the PIC a bad index value will cause the execution of arbitrary
instructions!
Normally the index would range from 0 to the size of the table minus one,
but it is possible to use other ranges by putting the retlw instructions
somewhere other than immediately following the "addwf pcl". It is also
possible to implement tables using a "subwf pcl", or perhaps other instructions
with pcl as the destination.
The subtract instructions (SUBWF and SUBLW) work differently than most people
expect. SUBWF subracts W *from* the contents of the register, and SUBLW
subtracts W *from* the literal. (SUBLW is not available on the 16C5x family.)
If you want to subtract a literal from W, it is easiest to use the ADDLW
instruction with the two's complement of the literal. For example:
addlw 0feh ; w := w - 2
Some assemblers allow this to be written as:
addlw -2
There is no instruction to take the two's complement of W (like the NEG
instruction on Motorola processors), but because of the way the subract
instructions work you can use:
sublw 0
On the 16C5x family, the CALL instruction can only address the first 256 words
of a bank of program memory. It is common practice to use "call extenders",
which are simply GOTO instructions in the first 256 words with a target in
the last 256 words.
On the 16C57 and 16C58, if you plan to use indirect addressing (via the FSR
and IND registers), it is vitally important that your reset code clear FSR
before using any other RAM locations. Otherwise you may start up in an
arbitrary bank, and as soon as you change FSR all your carefully set up
variables will effectively disappear.
It is very useful during debugging to hook up a piezo beeper to a port pin,
and beep it after initialization and at other strategic times. Here's some
useful code from Rich Ottosen (the delay function is not needed but is thrown
in as a bonus):
If you don't mind, I'll happily add your positive comments to the
FAQ but I think at this early stage, I'll reserve the negatives to
avoid starting any "my choice is better than your choice" wars. :-)
On the code library front, what I suggest is this ;
We define a communal "header file" so that all code snippets can
refer to the same set of "fixed variables" So that Timer_1,
Timer_2, Temp_1, et. al. are defined as to address in the
header file and as to function in a seperate specification sheet
which we can expand to cover most eventualities.
My reasoning is that we all at some time or other need a bit of
code to, for instance, Interface to an E2prom, read a keyboard or
whatever else you can think of.
Now there are almost as many different ways of doing each of
these as there are people wanting to do them. One routine will be
fastest, the next will use fewer mem. locs. the next will take
up less prog. space, while another will use fewer input pins.
Now, would'nt it be nice if all these routines were available by
e-mail and you had a copy of an index for them ? I mean not only
the best routine that you could come up with, when the job was
required `yesterday', but the best that the distilled wisdom of
the pic-literate world is capable of !
I'm setting up an automatic mailling service to do just that. The way
it will work is as follows ;
You need a routine for a specific function say "function_X"
The latest version of "function_X" will be e-mailled to you.
If while working with it you come up with a mod to the
function, you re-write it and mail it back with your
justification for the mod and I add it to the list.
If all the pic users do this............!!!
Think of it as "electronic software evolution" :-).......OR if you
think the idea is a load of cr*p, let's hear your suggestions.
The problem wiht the emulator is that unlike a real target, it has an
alternate clock & source of power. Try selecting external clock on the
emulator & relying on an external clock circuit.
Limitation: You can't "talk" to the emulation circuitry (to dump
registers & trace buffers) when it is sleeping.
Seems to work with my Transdata Rice-16 (real time ICE) in the above mode.
PIC users (YOU) send routines in by e-mail. I classify and index
them.
If a user wants a routine to do X, they send e-mail specifying X and
the mailler here does the obvious.
If the said user improves the routine, or performs the function in a
different fashion, they improve the library by sending their version.
etc. etc. I assume you get the picture. <g>
So, what can _you_ offer ?
~~~~~~~~~~~~~~~~~~~~~~~~
We need routines of every complexity from basic in/out and timing
etc.
for brand new users upto whatever you can legally part with. :-)
SO, dig out the early stuff you did when you were first play^H^H^H^H
experimenting with the PICS and e-mail it ;-
As an extension to this it would be nice to offer complete packages.
i.e. circuit diag. + board layout ready to produce a board to
go with the software.
So, if you include a circuit diag, I'll lay out the boards and we'll
find an ftp site to hold them.
--
Cheers
Tom
The following is an excerpt from a recent message posted to the DS-750 mailing
list by Dave Dunfield (of Micro-C fame). I haven't tried it, but is sounds
pretty neat.
I have (in a joint venture with another company) just released a new
product which might be of interest. It is called the P57-MUSTANG, and
consists of a PIC 16C57 pre-programmed with a virtual machine
interpreter, and an 8K (byte) serial EEPROM. A socket for a second
8K EEPROM is provided, and EEPROM can be expanded to a total of 64K
by adding chips to the prototyping area. The serial EEPROM can be
used for both CODE and DATA storage, allowing you to permanently record
configuration etc. from within your program.
The board is 3" by 2" and includes a 1" by 2" prototyping area. The
development kit which includes: 1 board, C compiler, Assembler, Library
(with source code), In-circuit Simulator/Emulator (supporting C source
level debugging), and LOTS of other utilities is priced at $150 US
Individual boards are priced at: $59 US
The U.S. Distributor is:
P&E Microcomputer Systems Inc.
P.O. Box 2044
Woburn, MA 01888
Tel: (617) 353-9206
Fax: (613) 353-9205
>
> Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> PIC chips?.
Don't know. What revision do you have? I have the 16B. No 40pin
socket at all.
Both of the 40 pin offerings can be programmer serially. Maybe it's
possible to create the 5 pin interface necessary to do that on a
daughterboard?
BTW can someone make the MPSTART.EXE software (V3.04) available to me?
I went to the Microchip seminar yesterday and got a PICSTART 16B but
I don't have a 1.44 3.5" floppy at home and of course the software is
on a disk of that format. Bummer. The BBS has the assembler and the simulator
but not the MPSTART software. I can get it ftp or you can mail it to me
in most any format. THe former would be preferable.
> spamBeGonebyronKILLspam@spam@cc.gatech.edu (Byron A Jeff)
>
>>BTW can someone make the MPSTART.EXE software (V3.04) available to me?
>
>You can ftp it from ftp.sics.se in the pub/mchipsoft/picstrt16 directory or
similar.
>
>Hope that helps.
>
>Rafe
>
----------------------------------------------------------------
Rafe Aldridge - rcaspam_OUT@spam@sirius.tn.rl.ac.uk
R65, Rutherford Appleton Lab, wwWWww
Chilton, Oxon, OX11 OQX, UK. o o
------------------------------------------------ooO--(__)--Ooo--
> >
> > Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> > PIC chips?.
>
> Don't know. What revision do you have? I have the 16B. No 40pin
> socket at all.
>
> Both of the 40 pin offerings can be programmer serially. Maybe it's
> possible to create the 5 pin interface necessary to do that on a
> daughterboard?
My board is marked 04-01315 rev2. The Firmware chip is marked
Picstart-16B firmware rev 1.4. The copyright is 1992. The location
of the 40pin socket is market u8. Can serial programming be done
using the Picstart Board as the programmer?. (Perhaps this is
refrasing your last question).
I have to admit that I am getting very curious about the PIC series of
chips. I am becoming increasingly frustrated by the availability problems
that daunt Motorola products. The idea of being able to order chips from
Digi-Key really sounds nice....
Sorry if this is an FAQ, but what's available to support us Mac users
who want to use the PIC? What else do I need to get started?
Mike Harpe
University of Louisville
--
Michael Harpe, Communications Analyst III Information Technology
Internet: spamBeGonemike@spam@hermes.louisville.edu University of Louisville
(502) 852-5542 (Voice) (502) 852-1400 (FAX) Louisville, Ky. 40292
"He's not a man, he's a remorseless eating machine!" - The Simpsons
> >
> > Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> > PIC chips?.
>
> Don't know. What revision do you have? I have the 16B. No 40pin
> socket at all.
>
> Both of the 40 pin offerings can be programmer serially. Maybe it's
> possible to create the 5 pin interface necessary to do that on a
> daughterboard?
My board is marked 04-01315 rev2. The Firmware chip is marked
Picstart-16B firmware rev 1.4. The copyright is 1992. The location
of the 40pin socket is market u8. Can serial programming be done
using the Picstart Board as the programmer?. (Perhaps this is
refrasing your last question).
Thanks, Jory! I should have thought of Micro Dialects. I have their 68HC11
assembler. I think I may give MicroChip a call.
Mike
BTW. Your 'F1's are getting used, I am just looking for a more available CPU
for a project I am working on for possible publication in QST.
--
Michael Harpe, Communications Analyst III Information Technology
Internet: RemoveMEmikeEraseMEKILLspamhermes.louisville.edu University of Louisville
(502) 852-5542 (Voice) (502) 852-1400 (FAX) Louisville, Ky. 40292
"He's not a man, he's a remorseless eating machine!" - The Simpsons
> Can the unused 40 pin pickstart socket be used forprogramming 40 pin
> PIC chips?.
Based on partially tracing the connections, it appears that the extra 40 pin
footprint on the PICSTART-16B was intended for use in programming the 17C42.
The firmware on the board probably doesn't support it, and the MPSTART program
on the PC certainly doesn't. They probably planned to sell a board with the
40 pin socket as a PICSTART-17, but they haven't done so (yet).
The 40 pin pads would not work at all for programming the 16C64 and 16C74.
You might be able to wire an adapter to program these parts, and tell the
software that you're programming a 16C71. You would only be able to use the
first 1K words of program though.
The PICSTART-16B1 doesn't have the extra 40 pin pads at all.
The PICSTART-16C will program the 16C64 and 16C74, and is rumored to program
the forthcoming 28-pin 16C63 and 16C73 as well.
By the way, the latest firmware for the PICSTART-16B and PICSTART-16B1 is
version 1.7. If you use the 16C84 I would strongly recommend upgrading, and
if you use the 16C58A you _must_ upgrade. The upgrade should be available
free from your Microchip representative.
I just bought a Parallax programmer(its much better then my old microchip
one). Anyway i really dont have money to buy the adapter(yes i know is
only $50). I have a couple enginnering samples of the 64 and would like
to program them. Does anyone have this adapter and would you give me the
pinouts on it. That is what pin on the header goes to which pin on the
16c64.
later
John
_____________________________________________________________________________
John Johnson |If it's not OS/2.|spamBeGonejohnsonjspam_OUTRemoveMEccwf.cc.utexas.edu
|It's crap! |.....johnsonjRemoveMEghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
1 ) ABOUT THIS FAQ
1.1) Who put this FAQ together?
1.2) How can I contribute to this FAQ?
1.3) What newsgroups will this FAQ be posted to?
1.4) Mailing lists of interest to PIC fettlers
1.5) Other FAQs of possible interest
1.6) Can I distribute this FAQ or post it somewhere else?
2 ) ABOUT THE PIC
2.1) The PIC microcontroller
2.2) PIC variants
2.3) Notes for programmers
2.4) PIC contacts and representatives
3 ) PIC Utilities
3.1) FTP sites for the PIC
3.2) BBSs that support the PIC
3.3) Programming languages (3rd Party)
3.4) Programming hardware (3rd Party)
4 ) PIC DOCUMENTATION
4.1) Periodicals that cover the PIC
4.2) Books on the PIC
4.3) Miscellaneous documentation on the PIC
This FAQ will be posted to the following newsgroups:
sci.electronics Y
comp.robotics Y
comp.realtime Y
comp.answers Y When it's compliant
alt.comp.hardware.homebuilt ?
PIC16Cxx: 14 bit word size, 35 instructions, 8 level stack
Program Data Max. Voltage Typical Digikey
memory memory I/O freq. Range Current Price
(words) (bytes) pins (MHz) (Volts) (mA) (US $)
---------- --------- --------- ----- ----- -------- ------- -------
PIC16C64 2048 128 33 20 2.0-6.0 3 11.05
PIC16C71 1024 36 13 16 3.0-6.0 2 14.38
PIC16C74 4096 192
PIC16C84 1024 EE 36 + 64 EE 13 10 2.0-6.0 2 10.15
PIC17Cxx: 16 bit word size, 55 instructions, 16 level stack:
Program Data Max. Voltage Typical Digikey
memory memory I/O freq. Range Current Price
(words) (bytes) pins (MHz) (Volts) (mA) (US $)
---------- --------- --------- ----- ----- -------- ------- -------
PIC17C42 2048 256 33 25 4.5-5.5 6 15,15
PIC17C44 8192 480 33 25
Notes:
1. Program memory is EPROM unless otherwise noted.
2. Data memory is number of usable bytes, not including special function
registers.
3. Digikey prices are quantity 10 prices for 4 MHz DIP packaged OTP parts
with RC oscillator option (where applicable), except that the 16C84
uses EEPROM program memory,the slowest speed 17C42 is rated at 16MHz
Prices are from Digikey catalog number 943 for May/June 1994.
Other distributors often have lower prices, but typically also have
high minimum order requirements. Digikey also usually has plenty of
parts in stock. Windowed EPROM parts cost substantially more.
All PIC instructions are a single word. The equivalent of the immediate
address mode of other processors is the literal mode, used by instructions
ending in "LW", such as MOVLW, ADDLW, SUBLW, ANDLW, IORLW, XORLW, and
RETLW.The byte of data used by these instructions is directly encoded in
the instruction itself.
All PIC instructions take a single instruction cycle (four oscillator
cycles) to execute, unless a conditional test is TRUE or the program
counter is changed as a result of an instruction, in this case the
execution takes two instruction cycles.
For example:
movlw 37
goto next
next: movwf porta
The goto instruction takes two cycles (1 to get the value of label "next"
and 1 to load that value into the program counter) This is useful as a
two-cycle NOP, and is often written as "goto .+1" to avoid the need for a
label.
The W register is equivalent to the accumulator on other processors.
Almost all data movement, arithmetic, and logic operations use W.
Instructions that operate on W and a register (i.e., instructions ending
in "WF", like ADDWF and MOVWF) allow the result to be placed in either W or
the register (but not both). This is specified by a ",W" or ",F" after the
operand. The default is ",F", which will place the result in the
register. This can cause a lot of confusion if you're not careful, so I
recommend always specifying the destination explicitly. An example of a
confusing instruction:
incf foo,w ; w := foo+1 note that foo is unchanged!
If you want the result in both W and the register, you can use either:
incf foo,w
mowwf foo
or:
incf foo,f
movf foo,w
The stack is not accessible to the programmer in any way other than the
call and return instructions. There is no way to push or pull data, or
even to examine the stack pointer. On the 16C5x family the stack has only
two levels, so it is frequently necessary to write code in a different
style than would be used on a typical processor; you can only call
subroutines from your main code, or from a subroutine called from main, but
no deeper. If you try to make a 3rd CALL, the 2nd return address is
over-written so that the return from the 3rd CALL is OK but the return from
the 2nd CALL ends up where the 1st CALL should return to.
The 16CXX parts which implement an 8 level stack do so in a circular
fashion, so that the 9th CALL over-writes the return address for the 1st
CALL.
The 16C5x family doesn't have a normal return instruction; instead it has
RETLW, which stands for RETurn Literal Word. RETLW loads an eight bit
constant into W (just as a MOVLW instruction would), then returns from the
subroutine. This can be useful, but is agravating if you want to return a
computed value. On the newer PIC families there is a normal RETURN
instruction.
With the exception of the 17Cxx family, there is no way for software to
read an arbitrary location of program memory. In order to implement lookup
tables, it is necessary to combine the use of the ADDWF and RETLW
instructions. For example, the following code implements a lookup table of
the first four odd prime numbers:
To use the table, load the appropriate index (in this case, 0 to 3) into
W, and "call primes". The addwf instruction adds the contents of W to the
PC, which has already been incremented to point to the "retlw 3". The
table will return with the value in W. The total time taken is 6
instruction cycles, or 24 oscillator cycles.
Note that while on most processors the use of an out-of-range index will
result in the use of incorrect data, but the program execution will
continue normally, on the PIC a bad index value will cause the execution of
arbitrary instructions!
i.e. the computed address must be in the top 1/2 of page.
Normally the index would range from 0 to the size of the table minus one,
but it is possible to use other ranges by putting the retlw instructions
somewhere other than immediately following the "addwf pcl". It is also
possible to implement tables using a "subwf pcl", or perhaps other
instructions with pcl as the destination.
The subtract instructions (SUBWF and SUBLW) work differently than most
people expect. SUBWF subracts W *from* the contents of the register, and
SUBLW subtracts W *from* the literal. (SUBLW is not available on the 16C5x
family.)
If you want to subtract a literal from W, it is easiest to use the ADDLW
instruction with the two's complement of the literal. For example:
addlw 0feh ; w := w - 2
Some assemblers allow this to be written as:
addlw -2
There is no instruction to take the two's complement of W (like the NEG
instruction on Motorola processors), but because of the way the subract
instructions work you can use:
sublw 0
On the 16C5x family, the CALL instruction can only address the first 256
words of a bank of program memory. It is common practice to use "call
extenders", which are simply GOTO instructions in the first 256 words with
a target in the last 256 words.
On the 16C57 and 16C58, if you plan to use indirect addressing (via the FSR
and IND registers), it is vitally important that your reset code clear FSR
before using any other RAM locations. Otherwise you may start up in an
arbitrary bank, and as soon as you change FSR all your carefully set up
variables will effectively disappear.
-----------------------------------------------------------------------------
2.4) PIC contacts and representatives 12/06/94 12:12:51
I don't know where these are for sure.
Advanced Trans Data tel:(214) 980- 2960
Programmer PGM16 & PGM 16x8 Gang Prog. fax:(214) 980-2937
No further information is available at this time
Micro Engineering Labs tel:(719) 520-5323
makes PIC-Proto boards
Myriad Development tel:(303) 692-3836
CCS - C compiler
tel: (414) 781-2794 extension 30
Digi-Key tel:1-800-344-4539
Order electronic parts, carry 16C54,55,56,57,&71.
ED Teck. Pubs tel:407-454-9905
Fred Eady BBS:407-454-3198
Writes articles for popular magazines.
Has a PIC programmer kit for $70.
BBS good source of information, very helpful.
FAI tel:1-800-303-5701
Ask for Chris
Electronics distributer, carry PIC's,
Needham Electronics tel:(916) 924-8037
I don't know if they make PIC stuff, fax:(916) 972-9960
but they make an EPROM programmer, the PB-10 bbs:(916) 972-8042
Their emp-20 is great for Pics,Pals,Gala,EEproms etc but is ~$500
It can be set to auto program on start up. It takes about 4 seconds
for a bat file to reassemble the source with new EQU's from the
command line, recompile and program a part.
Protel tel:1-800-544-4186
Builder of EASYTRAX, which is free-ware and a bunch of new stuff.
Call Ext 225 ask for Louise Markham. bbs:1-408-243-0125
Bell Industries tel:1-800-525-6666
Electronic Distributor, including PIC's
.........................................................................
Australia
Microchip Technology tel:61 03 890 0970
Product information
No further information is available at this time
Canada
AP Circuits
BBS 1-403-291-9342 (Canada)
Can download EASYTRAX(V2.06), various utilities, GERBER file
proofers, etc. You can upload PCB files and they will make
boards and ship to you in about week. (about $100)
Baradine Products Ltd tel:604-988-9853
Programmer Micro-Burner
No further information is available at this time
.........................................................................
Europe
Data I/O Corp. tel:31(0)-6622866
Programmer Unisite with Site-48 module
No further information is available at this time
.........................................................................
France
Arizona Microchip Technology SARL tel:33 01 6930 9090
2, Rue Du Buisson aux Fraises fax:33 01 6930 9079
F-91300 Massy, France
Product information
SMS tel:49-7522-4460
Programmer Sprint Expert
No further information is available at this time
.........................................................................
Hong Kong
Microchip Technology Inc. tel:852 410 2716
Unit No. 2520-2525 fax: 852 418 1600
Tower 1, Metroplaza
Hing Fong Road, Kwai Fong
N.T., Hong Kong
Product information
.........................................................................
Italy
Microchip Technology tel:39 039 689 9939
Product information
No further information is available at this time
.........................................................................
Japan
Data I/O Corp. tel:(03) 432- 6991
Programmer Unisite with Site-48 module
No further information is available at this time
Microchip Technology International Inc. tel:81 45/471-6166
Shinyokohama Gotoh Bldg. 8F, 3-22-4 fax: 81 45/471-6122
Shinyokohama, Kohoku-Ku, Yokohama-Shi
Kanagawa 222 Japan
Product information
.........................................................................
Korea
Microchip Technology tel:82 2 518 8181
Product information
No further information is available at this time
.........................................................................
Singapore
Microchip Technology tel:65 222 4962
Product information
No further information is available at this time
.........................................................................
Taiwan
HI-LO tel:(02) 7640215
Programmer ALL-03
No further information is available at this time
Microchip Technology tel:886 2 760 2028
Product information
No further information is available at this time
.........................................................................
U.K.
Arizona Microchip Technology Ltd tel:44 062-885-1077
Unit 3, Meadow Bank, Furlong Rd fax: 44 062-885-0178
Bourne End, Bucks SL8 5AJ
Product information
Application Solutions Ltd tel:273-476608
Programmer PIC Programmer
No further information is available at this time
Citadel Products Ltd. tel:44-819-511-848
Programmer PC-82
No further information is available at this time
Maple Technology Ltd tel:44-666-825-146
Programmer MQP-200
No further information is available at this time
Stag Microsystems tel:44-707-332-148
Programmer PP39
No further information is available at this time
.........................................................................
U.S.
ADVIN Systems Inc tel:408-984-8600
Programmer PILOT U40
No further information is available at this time
BP Microsystems tel:800-225-2102
Programmer CP-1128 tel:713-461-4958
No further information is available at this time
Data I/O Corp. tel:800-288-4965
Programmer Unisite with Site-48 module
No further information is available at this time
Elan Digital Systems Ltd tel:(408) 946-3864
Programmer EF-PER 5000 Series Gang Programmer
No further information is available at this time
Link Computer Graphics tel:301-994-6669
Programmer CLK-3100
No further information is available at this time
Logical Devices Inc tel:800-331-7766
Programmer ALLPRO 88 tel:305-974-0967
No further information is available at this time
Micro Engineering Labs tel:719-520-5323
Box 7532 Colorado Springs, CO 80933
Has proto-type boards and demo kits,
Good source of info, can do manufacturing, etc
Microchip Technology Inc. tel:(602) 786-7200
2355 West Chandler Blvd. fax: (602) 899-9210
Chandler, AZ 85224-6199
Product information
Parallax Inc tel:916-721-6669
6359 Auburn Blvd., Suite C fax: (916) 624-8003
Citrus Heights, CA 95621 USA bbs: (916) 624-7101
Assembler / Simulator Help 916-624-8333
The assembler takes either the standard instructions
or parallax's 8051-like pseudo instructions
Parallax Inc tel:916-721-6669
6359 Auburn Blvd., Suite C fax: (916) 624-8003
Citrus Heights, CA 95621 USA bbs: (916) 624-7101
Programmer PIC 16C5X-PGM Help 916-624-8333
If you call the BBS you can order info by mail.
Features
Supports only 16C5x,16C71 and 16C84,(INHX16, INHX8S, INHX8M, PICICE)
compatible with a wide range of file formats
comes with chips to play with.
has a zif socket
assembler has powerful macro capabilities
also includes a powerful debugger
PARALLAX
--------
Features
Parallax's own instruction set Their assembler takes either the
standard instructions or parallax's 8051-like pseudo instructions.
needs only a 360k floppy, MSDOS 2.1, 128K RAM, mono.
simulator software
The files here are publicly available from the Microchip BBS via
Compuserve. Since many people interested in these files have an
internet connection, the files have also graciously been made
available at SICS by Anders Nobinder of Memec Scandinavia,
Microchip's Swedish agent.
ftp.funet.fi (nic.funet.fi) /pub/microprocs/PIC
wpi.wpi.edu /stamp
basic stamp information PLUS PIC "C" compiler
Microchip BBS
Contact by dialing the same number you would use to get to
Compuserve at 19200,n,8,1, except that you press +<CR> at the
(garbage)
prompt, followed by MCHIPBBS as the host (instead of CIS).
Prog. Name ASPIC Shareware PIC assembler (reg = $100 CDN ($69 US))
**DESIGNED** for embedded controller design
the shareware license has an unusual clause absolving
those who only use it for non-commercial purposes
Features - One assembler for 16c5X, 16c6X, 16c7X, 16c8X, 17c42
- Compatable with PICSIM (MPSIM)
- Compatable with MAKE, and with auto-error tracking editors
- Many times faster than PICALC (MPALC)
- Standard base notation (Intel & Motorola format)
- CODE and FUNCTION macros
- Auto register bank management
- Text/data translation
- Automatically generates RETLW tables for text / data tables
- Built-in version management and assembly control functions
- user command-line switches
- many other features
-character set translation (eg. for LED,LCD,On Screen Displays)
- bit labels, environment labels, etc.
Prog Name B.LO.C release 1.0, version 4.0
Available for the PIC16CXX and PIC17CXX
Supplier Butterfly Signal Processing Inc.
131 Bloor Street West #200-154
Toronto, Ontario, Canada M5S 1R8
Tel: (416) 929-5754
Fax: (416) 929-5744
Features `C-like' syntax
Locally optimal code generation
Superfast, one-pass compilation
Zero stack and memory space used
Produces fully annotated, easy-to-read -
- assembly code to facilitate simulation
Regular and in-line functions supported
B.LO.C and assembly routines can be mixed
In-line assembly code inclusion
For more information contact asmspam_OUTkalam.butterfly.com
Features: An integrated text editor, assembler
and communications modules. fully supports macros,
automatic labels, local labels, conditionally assembly,
includes to 10 level deep.
The editor supports up to 10 open files at a time, full
search and replace including grep searches,
file size limited only by RAM available.
The emulator supports data transfer up to 38,400 baud.
NOTE: The uASM code is incompatible with the MicroChip Simulator
<unless you know better ? >
The Computer Applications Journal (Circuit Cellar Ink)
- programming and construction articles
- POB 7694, Riverton, NJ 08077-8784
- FAX: (203)872-2204
- Voice orders: (609) 786-0409
- On-line orders (BBS): (203) 871-1988
- Email orders: ken.davidsonspamBeGone.....circellar.com
- $21.95, $31.95 surface Canada and Mexico,
$49.95 air all other countries
Computer Design
industry announcements and trends
One Technology Park Drive,
P.O. Box 990, Westford, MA 01886
(508)692-0700
The Computer Journal
- programming and construction articles
- PO Box 535, Lincoln 96648
Dr. Dobbs Journal
- programming articles, concepts and designs
- 411 Borel Ave., San Mateo, CA 94402
- (415)358-9500
Electronic Engineering Times
- industry announcements and trends
- 500-B Bi-County Boulevard, Farmingdale, NY 11735
- (516)293-3000
Electronics Now
- construction articles
- Box 55115, Boulder, CO 80321-5115
- $19.97 one year
Elektor Electronics
- programming and construction articles
- World Wide Subscription Service Ltd
Unit 4, Gibbs Reed Farm, Pashley Road
Ticehurst TN5 7HE, England
- 27 UK pounds
or
- Old Colony Sound Lab,
- P.O. Box 243, Peterborough, NH 03458
- Tel. (603) 924-6371, 924-6526
- Fax: (603) 924-9467
- $57 USA and Canada per year
Embedded Systems Programming
- programming and systems design articles
- Miller Freeman Publications
- 500 Howard St., San Francisco, CA 94105
- (415) 397-1881
Microcomputer Journal (formerly Computer Craft)
- programming and constructions articles
- 76 N. Broadway, Hicksville, NY 11801
- $18.95 one year, foreign $23.00, foreign air mail $76.00
Midnight Engineering
- 1700 Washington Ave., Rocky Road, CO 81067
- (719)254-4553
A Beginners Guide to the Microchip PIC Nigel Gardner
ISBN: 1 899013 00 8 Printed in the UK by Character Press Ltd.
Software (on floppy) and hardware guide. Debugging techniques...
Available from Polar Electronics in UK 19.95 UK Pounds
ED Teck. Pubs
Fred Eady
407-454-9905
BBS 407-454-3198
Writes articles for popular magazines. Has a PIC programmer kit for $70.
BBS available, good source of information, very helpful.
Parallax
Stamps and programmer, etc.
BBS 916-624-7101
Help 916-624-8333
AP Circuits
BBS 1-403-291-9342 (Canada)
Can download EASYTRAX(V2.06), various utilities, GERBER file proofers, etc.
NOTE: .......If your name should be here, apologies. some of the above has
been dredged from Jory's archives in such a fashion as to make it less than
convenient to work out with whom it originated.
______________________________________________________________________________ spamBeGonepicstakdsign.demon.co.uk Home of the PIC CODE LIBRARY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disclaimer: Inclusion of any code samples in this document does NOT imply
any approval or guarantee as to the suitability of said samples for any
purpose whatsoever other than as a self-training aid. I.E. If it blows
your ICE, trashes your hard disc, wipes your backups, burns your building
down or just plain don't work, #### IT AIN'T MY FAULT #### In the event of
judicial ruling to the contrary, any liability shall be limited to the sum
charged on you by me for the aforementioned document OR nothing, whichever
is the lower.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (c) 1994 by T.A.Kellett, all rights reserved.
_______________________________________________________________________________
Tom Kellett < spam_OUTTomSTOPspamtakdsign.demon.co.uk >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TRISYS, Inc has placed two shareware packages 'idesw.zip' and 'mvsw.zip'
on ftp server ftp.sics.se in the /pub/mchipsoft directory area. (they
should be made available for download by the sysop in a day or so, after
he checks them out) Give them a try.. mail any comments to the
email server RemoveMEpicspamfigment.mit.edu, or directly to TRISYS, Inc at TakeThisOuTtrisysspamRemoveMEramp.com
If you are not interesed in these environments.. Some windows
help files for the PIC processors have been uploaded there also.
If you are downloading the environments, do not download the help
files also because they are zipped with 'idesw.zip' and 'mvsw.zip'
idesw.zip - This is a shareware Windows 3.1 MDI compliant integrated
editor and assembler for the Microchip PIC family of parts.
It supports the PIC16C5X, PIC16C6X, PIC16C7X, PIC16C8X, and PIC17C42
processors.
mvsw.zip - this is a shareware Windows 3.1 MDI compliant editor,
assembler, and simulator for the Microchip PIC16C 54, 55, 56,57, & 58
processors. It provides the following capabilities.
* Integrated editor/assembler/error windows.
- Editor provides Undo, Cut, Copy, Paste.
- Supports multiple fonts & Windows printer driverrs.
- All windows (error, listing, and memory) updated after
assembly automatically.
- Double click on error line takes you to the source
code line with the error.
* Simulation
- Quadrature based simulation. Single step by quadrature.
- Allow modification of any file register or special
function register at any quadrature, as well as the
instruction pipeline, stack, prescaler etc.
* Timing/Stimulus
- Set and display testpoints on processor pins.
- Create stimuls for processor pins.
- Does not support printing at this time.
- Connect output from one pin to input of another.
- Registered version supports simultaneous multiple processor
simulation. Useful for testing/simulating communication between
processors.
- Registered version supports connection of one processorr pin
to another processor pin.
* Breakpoints on.
- Read or Write
- Register value 'is greater than', 'is less than', and
'masked with' a value is true.
- Break on line in listing window.
The registered version will support COD output format for compatiblity
with Microchips burners and emulators. The shareware version supports
only the PIC16C54 processor while the registered version supports the
entire PIC 16C5X processor family. The registered version supports
multiple processor simulations.
Additional processor families will be developed to support the entire
Microchip PIC processor families. Registered users will be notified
when these processors additions are available.
All the documentation for both the Assembler and MicroView environments
is online.
We are currently working on native language versions of these products
and will have them available soon. If you would be interested in
assisting language conversions to your native language, please contact
TRISYS at KILLspamtrisysspamspam_OUTramp.com
Please send any questions or comments to: trisysRemoveMEramp.com.
We can also be reached on the Microchip bulletin board. Post messages
in the 3rdparty forum or send mail to trisys.
Hi netters, I'd like to know what kind of documentation should I read to
start using the PIC microcontrollers and where I can get it (american
distributors are good too, phone numbers please)
I need some beta testers for a piece of software I will be releasing to the net.
The program is a fairly basic pic disassembler, and I need to have as much code
run through it and checked as possible.
Now I realise this is NOT the most useful piece of software around (but it may
be useful to decode programs that have been "lost" in .asm format).
It is however a start on the road to an assembler/debugger system. The major
_feature_ of these tools being that they may be compiled/run on any machine
or OS having a C compiler capable of building them.
The disassembler decodes from an INHX16 style file (default output of MPALC) and
produces Microchip standard mnemonics. It will decode either 12 or 14 bit pic
code.
The beta testers in return for testing and suggestions will receive the huge kudos (?)
of having their names in the readme file :-) and some input on the final release
version of this and any other code.
The final bugs^H^H^H^Hfeatures are currently being hammered out, but the code should
be delivered (via e-mail) early next week to those lucky people who want it.
=%-)
Ian
p.s. I will just be supplying the C code, so beta testers must have a compiler
for their platform! The code has been developed on a Sun (Solaris 2.3) using Sun's own
compiler. I can produce MS-DOS and Linux targets (I hope ;-) for a final release but
others (amigas and macs) will require someone else to build them for me (hint hint).
p.p.s. The final release will probably be released as "postcard-ware" i.e. licence to use
requires the sending of a postcard of your hometown to me...
I am programming an 71' series and whenever I issue a clrb ra.4 which is
the open collector pin all of the RA ports are set to 0. This is really
screwing me over hard as the other RA ports are control lines that
respond 4x as fast as my PIC thus I end up over driving my lines. Any
ideas? is this a flaw with the 71? If you think you know what i am
talking about and want more info email me. I really could use some help.
later
John
_____________________________________________________________________________
John Johnson |If it's not OS/2.|spam_OUTjohnsonjRemoveMEEraseMEccwf.cc.utexas.edu
|It's crap! |TakeThisOuTjohnsonjRemoveME@spam@ghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
>The above statements by you caught my attention as I have done
> both of these things in my one and only (so far) PIC project.
> Could you please elaborate on why the code shouldn't start at 0
> and why EQU shouldn't be used to define data addresses?
Thanks, I was hopping those comments would start a thread on programming
styles.
>>... It is right up there with starting
>>your code at location zero in any PIC (other than an '84)!
On 5X PICs, the locations <100H (in each bank) are precious for callable
finctions and computed goto's. There is no reasion to start your code
there, as
the GOTO at the ind of code space can point anywhere (I usually use 100H).
Secondly, the first 40H locations are subject to attack in 5X's and 71's,
so if
you have your start-up code there, it makes it subject to interception by
revengers. For this reason, all unused locations in 00-3FH should be also
be
filled with zero, to prevent down-programming.
>>PS. Another handy way to start a lively thread is to mention using EQU
>>to define data addresses.
Using EQU's to define data memory locations an I/O ports is a style of
which I am
not fond.
If you use the porgram counter and .DS (aka. RES) to define all storage, it
makes
memory and IO usage clearer and more portable (adding or deleting routines
which
require stored data is automatic).
Here are a couple of excerpts from REGS.ASM in DEMO.ZIP which is available
on
my BBS, Microchip's BBS and a few ftp sites:
.seg REGS ;org for register declarations
ind .ds 1 ;Pseudo-reg 0 for INDIRECT (FSR)
RTCC .ds 1 ;Real time counter
PCL .ds 1 ;PC
STATUS .ds 1 ;STATUS REG
FSR .ds 1 ;File select reg 0-4=indirect add.dss
;************************************************************************
;* PORT A Definitions
;************************************************************************
B.PROBE = 0,* ;Probe input / AN0 (MUST BE BIT 0)
B.BP2 = 1,* ;LCD backplane bit (3 level)
B.BP1 = 2,* ;LCD backplane bit (3 level)
B.BP3 = 3,* ;LCD backplane bit (3 level)
B.SCALE = 4,* ;Scale / Bias for Probe, RTCC IN, schmitt
PORTA .ds 1 ;Port A I/O register (4 bits)
TAINIT = ^B.PROBE|^B.BP1|^B.BP2|^B.BP3 ;initial TRISA value 1=in
PAINIT = ^B.SCALE ;port A init
-----------------------------------------------------------------------
| Note how the above coding forces you to consider initialization values.
| It also makes the bit label definitiions more portable as they can be
| easilly moved from port to port (eg. B.PROBE is currently defined as
| BIT 0 of PORTA.
|
| Then, later in the code...
-----------------------------------------------------------------------
.seg REGS
;**********************************************************************
;* Start of program-specific registers. More are defined in the modules
;* in which they are required.
;**********************************************************************
REGBASE: ;first reg cleared by RESET code.
TEMP: .ds 1 ;General temporary reg. for LOCAL USE ONLY.
TEMP2: .ds 1 ;General temporary reg. for LOCAL USE ONLY.
VALUE: .ds 4 ;Working value from display (long)
MISCFLAGS: ;miscelaneous flags
B.RA5ON = 0,* ;Flag - RA5 (attenuator) is ON (set to 0)
B.NEWLOGIC = 1,* ;Flag - new logic cycle
B.ZEROENAB = 2,* ;Flag enable zeros for display (0=trim leading 0's)
B.PULSE = 3,* ;Probe detected a pulse
B.PULSE2 = 4,* ;Time delayed PULSE detect
B.SLOPE = 5,* ;Flag - negative slope on waveform
B.NUMPROC = 6,* ;FLAG - enterring a number (LCD and VALUE are
valid)
B.ONETRIG = 7,* ;Flag - Single trigger only
.ds 1 ;
-----------------------------------------------------------------------
Even if you change processors, REGBASE, and all of the flags in
MISCFLAGS are automatically moved.
Yes, there are ways to use EQU for this, but they invite errors, like
not reserving enough space for VALUE if the code is re-used in another
project.
> frame and the number is 244364266 not 144 as I mentioned in another
> letter. If you can check out the year for me I would appreciate it. I
Howdy,
it so happens that we are in possession of a complete stack of genuine
old British Leyland microfilms picked up at a bankruptcy auction (they
were stashed away in the drawer of a desk we took along!). So, courtesy of
(now defunct) BRANDO Automotives of Holland, here are the details for
your serial number #244364266 :
> Is "CLRB" one of the Parallax instructions? What does it actually assemble
> into? Hopefully a "BCF"? I avoid the Parallax instructions like the plague;
> IMHO all they do is obfuscate the code. Sometimes I define macros, but
> certainly not to make it look like an 8051.
I actually like them. While not true Microchip instructions, I think they
read better. In actuality all they are are macros. Plus I am overly fond of
their simulator, Microchips is better in some places though, well most
actually.
>
> There are various wierd problems that can occur when you try to use BCF and
> BSF (or any other read/modify/write instructions, such as INCF) on I/O ports.
> I can't be sure exactly what's happening without knowing more about how you
> are using the other port A pins.
I called microchip and they knew of the problem. It deals with the fact that
ra.4 does not have tris bit for it. Screw up in the mask. If i had
taken time to dl the eratta sheets on teh 71 I would have found this out.
And yes it does stim directly from your above statement. when you bcf
5,4 the whole tris reg gets messed up and you can end up driving the pin
w/o any output(ouch)
>
> A common problem (but not necessarily the one troubling you) is that the the
> read/modify/write instructions read the actual voltage level at the pin, not
> the bit in the output latch. If external hardware drives the lines this
> can cause unexpected behavior. For instance, if you write $ff to the port, and
> external hardware is forcing PA0 low, and then you do a BCF porta,4, the output
> latch for PA0 will be set to 0, and the chip will start driving it low.
ummm yup exactly what happend. Ended up sucking a whole lot of current.
Almost 200mA.
>
> I'd recommend writing the entire port with a MOVWF when you want to change it.
> (Microchip recommends this also for a different reason).
wheter you recommend it or not is irrelevent :) its the only way around
my problem. So in fact your suggestion is not mearly a suggestion but
law..
thanks for your help. and to all of the others who offered me help too..
live long and PIC, sorry I just had to say it
_____________________________________________________________________________
John Johnson |If it's not OS/2.|spamjohnsonj.....spamccwf.cc.utexas.edu
|It's crap! |johnsonjspam_OUT@spam@ghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
> However, I still feel that the EQU approach is preferable to define the
> special-function registers. The location of these is immutable, so it is
> better (in my mind) to assign them a fixed value.
(actually they are not... Note that they have been known to change from
PIC to PIC (especially when moving from 16cXX to 17CXX parts!)
> If you use .DS/RES and
> make a mistake (i.e. forget a line) then the error will propagate to all
> the other SFRs.
Actually, I (personal "religion" here) prefer the fact that using DS forces
me to check that I have dealt with all registers. The segment management
macros profided with ASPIC take care of boundary checking automatically.
And in the same therad, Chuck McManis (and others) asked:
>> Secondly, the first 40H locations are subject to attack in 5X's and
>> 71's, so if you have your start-up code there, it makes it subject
>> to interception by revengers.
> What does this mean? What is a "revenger?"
A revenger is a person who reverse engineers products or systems. The fact
that
the first 40H words of program memory are re-programmable even while code
protected on some of the PIC parts is fertile ground for revengers. The
security concious programmer must therefore be aware of this and take the
appropriate precautions.
The problem is that no one will openly talk (see how we dance arround it)
about these things (even though it's right there in white-on-white in the
spec sheet). The security precautions are simple and effective.
Hello, does anybody know if it is possible to erase the OTP-versions
of the PIC 16C54 by X-rays? And if, how long does it take at what kind
of x-ray have I to use?
"reasonable sources" say it won't work. Xray frequencies "hot" enough
to get through the package go right through the silicon as well...
BillW, whose company was once stuck with a lot of obsolete microcode
in expensive, high speed, OTP EPROMS...
Hello, does anybody know if it is possible to erase the OTP-versions of the
PIC 16C54 by X-rays? And if, how long does it take at what kind of x-ray
have I to use?
Listen up, folks. From an old physicist here of no particular note: The thing
we wish to accomplish is to erase EPROM cells in OTP's, which, near as I can
tell are just the die without the quartz window and more expensive ceramic
package. Now, I'll agree that most of all x-rays will pass right through,
(although a heavy bombardment over a long period of time might work), the
best way to erase EPROM is by the production of <273nm photons on the die
by x-ray flourescence. Now this may take finding the right energy x-rays
by fiddling the voltage up and down till you find the threshhold of best
flourescent conversion at that frequency. Another thing which might need to
be explored is whether another sheet of x-ray flourescent material might be
placed over and under the OTP's which would bring the x-rays down to the level
needed to further flouresce downward toward 273nm. It is possible that the
x-ray tubes commonly used are higher energy than will properly or most
efficiently flouresce. A good bet is metals and heavier elements. These are
options that someone with an industrial x-ray machine might attempt. It very
well could be that x-rays at some common medical or inustrial voltage could
do it. If it hasn't been researched, it sure sounds like it would be worth
exploring. Geez, you could start your own business erasing them for a song,
if it worked!
-Steve Walz .....rstevewspam.....armory.com
---------------------------------------------
Hello, does anybody know if it is possible to erase the OTP-versions
of the PIC 16C54 by X-rays? And if, how long does it take at what kind
of x-ray have I to use?
"reasonable sources" say it won't work. Xray frequencies "hot" enough
to get through the package go right through the silicon as well...
BillW, whose company was once stuck with a lot of obsolete microcode
in expensive, high speed, OTP EPROMS...
> TRISYS, Inc has placed two shareware packages 'idesw.zip' and 'mvsw.zip'
> on ftp server ftp.sics.se in the /pub/mchipsoft directory area. (they
> should be made available for download by the sysop in a day or so, after
This is now available; Has anyone managed to get a run out of it yet ?
I tried to run the demo progs and get errors like;
can't POP - stack full
Or words to that effect.
I also get run time errors <stack overflow> Same problem ??
Comments anyone ?
--
Cheers
Tom
Tom:
I have gotten one other report of a <stack overflow>. I cannot
duplicate this on my machine. Could you tell me what you are
doing to generate this? I'll upload a updated version soon, with
a larger stack, maybe this will help.
The error can't POP stack full? This does not exist in
the software (I assume you are using MicroView). But to you
get these kinds of errors while running the simulation or
is it just a Windows message?
I have gotten a bug report on the assembler (The same is
use for both Assemble and MicroView) It is:
A bad mnemonic after a lable is skipped over. It should
be flagged as an error! The work around is to not put
a mnemonic on the same line as a label. (Or just write
perfect code the first time :-).
It has already been fixed but we are adding a few other
upgrades to the assembler before putting it back on
the MicroChip BBS and the ftp.sics.se sites.
Any other comments, error reports, and suggestions are
greatly appreciated.
Another note. There are supplemental instructions
discussed in some Microchip documentation. (like clrb)
which are not discussed in the part data sheets.
We have created an include file which has these defined
as macros. It can be downloaded from the Microchip BBS.
We will include it with the new zip file when we upload
the new version. (comming SOON).
To get to the Microchip BBS:
- Call your compuserve access number. There is a
toll free number to find out what it is (I don't
know it)
- When you connect. It plus then return.
- At the prompt type : MCHIPBBS
That all!! Trisys files can be found in the /3rdparty
forum and library.
Thanks (Please keep comments comming)
David Foringer (TRISYS, Inc.)
Hi.
On stack overflow problem reported with the TRISYS
assembler and MicroView.
The assembler does not currently process the '.' (period)
operator. (Don't use it!) The next version will support
the period for bit representations. (i.e. BTFSS STATUS.C)
Hope this helps. If you are having any other problems
Let us know and we will fix them ASAP!
David Foringer (TRISYS, Inc).
Hi, I'm interested in use the PIC microcontroller for one of my
projects so I'd like to explore the different languages that I can use.
What exactly is the BASIC stamp? Compiler? Interpreter?
Hi guys,
I've just started playing with these parts and they look great!!.
I have made the programmer for the 1684 that uses the parallel port,
but unfortunately the assembler I have appears to be only for the 17xx
family (its called asm17). Is there a PD assembler for the 1684 and if
so where can I track it down. TIA.
I4ve had some problems unzipping the file
"/pub/mchipsoft/mchipsoft/picapp/apnset02.zip" at ftp.sics.se.
(double-zipped file math.zip is corrupted)
Could anybody unzip it ??? I used the newest version (2.04g) of PKWARE's
pkunzip.exe for DOS. PKZIPFIX didn't work either. Perhaps this file should be
renewed! Others are OK.
Does anybody already have some experience with the MPASM (by Byte Craft Limited
of Waterloo and MCHIP itself)??? I got MPASM___.ZIP from the MCHIP BBS.
It seems to become the new enhenced general assembler for the PIC families or
is it already destributed along with any HW-tools? I'm just working with
the PICSTART-16B. There should also be a C-Compiler (MPC) soon! Am I right?
Please give me some respond about it...
By the way, for my research (MEMS) I designed a simple "Multi process Kernel"
for the PIC 16C71. All my programms (3 to be exact) now base on it. The main
part is an interrupt manager which branches to several processes (subroutines)
and it supports a serial line (RS 232/485 - half or full duplex) by interrupt
up to 19.6kB (8N1). A simple protocoll is suggested and only 7 file registers
are used for its minimum running (CRCs and double FSRs are also available
(+4bytes)).
The kernel exchanges serial data via two fileregisters and Ready/Send flags.
Errors are also flagged.
The usage of this "MpK" is fast and easy: fill up the empty structure with your
own code, data and initialization.
>
>Hi guys,
> I've just started playing with these parts and they look great!!.
>I have made the programmer for the 1684 that uses the parallel port,
>but unfortunately the assembler I have appears to be only for the 17xx
>family (its called asm17). Is there a PD assembler for the 1684 and if
>so where can I track it down. TIA.
>
>- sean
>
Get PASM from the microchip bulletin board. It supports the
microchip family. It can also be found at ftp.sics.se in the
/pub/mchipsoft/mchipsoft directory. This is BASED.
If you want windows, get 'idesw.zip' from ftp.sics.se in the
/pub/mchipsoft/trisys directory. This is shareware.
David Foringer. (TRISYS, Inc.)
>
>Hi folks,
>
>I4ve had some problems unzipping the file
>"/pub/mchipsoft/mchipsoft/picapp/apnset02.zip" at ftp.sics.se.
>(double-zipped file math.zip is corrupted)
>Could anybody unzip it ??? I used the newest version (2.04g) of PKWARE's
>pkunzip.exe for DOS. PKZIPFIX didn't work either. Perhaps this file should be
>renewed! Others are OK.
>
>Does anybody already have some experience with the MPASM (by Byte Craft
Limited
>of Waterloo and MCHIP itself)??? I got MPASM___.ZIP from the MCHIP BBS.
>It seems to become the new enhenced general assembler for the PIC families or
>is it already destributed along with any HW-tools? I'm just working with
>the PICSTART-16B. There should also be a C-Compiler (MPC) soon! Am I right?
>Please give me some respond about it...
Yes there will be a C compiler out soon. I think it already is.. from BYTECRAFT.
There was a mail message earlier in this mail forum which had much better
detail about what was available.. But I did not save it sorry... Maybe
somone else will repost it?? (hint)
>
>By the way, for my research (MEMS) I designed a simple "Multi process Kernel"
>for the PIC 16C71. All my programms (3 to be exact) now base on it. The main
>part is an interrupt manager which branches to several processes (subroutines)
>and it supports a serial line (RS 232/485 - half or full duplex) by interrupt
>up to 19.6kB (8N1). A simple protocoll is suggested and only 7 file registers
>are used for its minimum running (CRCs and double FSRs are also available
>(+4bytes)).
>The kernel exchanges serial data via two fileregisters and Ready/Send flags.
>Errors are also flagged.
>The usage of this "MpK" is fast and easy: fill up the empty structure with your
>own code, data and initialization.
>
>Is there any interest for it ???
Yea! sounds like a good start for a lot of projects!! Microchip should use
code pieces like that for their app notes..
> I4ve had some problems unzipping the file
> "/pub/mchipsoft/mchipsoft/picapp/apnset02.zip" at ftp.sics.se.
> (double-zipped file math.zip is corrupted)
> Could anybody unzip it ??? I used the newest version (2.04g) of PKWARE's
> pkunzip.exe for DOS. PKZIPFIX didn't work either. Perhaps this file should be
> renewed! Others are OK.
You are right. We are hoping for Alex Baker from Microchip to upload
new versions. We just got the following message at SICS:
> First of all I should introduce myself properly - my name is Alex
> Baker, and I am Northern European Field Applications Engineer for
> Arizona Microchip, based in their Bourne End, Bucks, UK office. The
> geographical area I cover includes all of Scandinavia, Benelux and
> the UK.
>
> One of my current objectives is to start publicising the fact that I
> have an Internet email address, which people can use to communicate
> tech problems, comments etc. to Microchip in general; this is
> particularly following comments from you guys (the customers) during
> a seminar series I did in Sweden with Anders and the guys from Memec.
> You all apparently want Internet access to our BBS system and I feel
> that this is the first stage.
>
> To bring you up to date, full Internet access to the Microchip BBS is
> under consideration, but I notice from using archie that you are one
> of the sites across the world who already has a major portion of the
> files on the BBS available for anonymous FTP. My concern is that
> maybe you possibly don't have all the latest files. What follows is a
> list of files, pulled off the BBS yesterday. I have all of these
> available on my local PC, which I can upload via FTP to you.
<text skipped>
> Alex Baker Phone: +44 628 851077
> Norther European Field Applications Engineer Fax: +44 628 850259
> Arizona Microchip Technology Car: +44 831 494921
> Email: Alex Baker on Microchip BBS or spamalexmicrochp.demon.co.uk
So hopefully, the complete set of Microchip BBS files will soon be
available by anonymous ftp from ~ftp/pub/mchipsoft/ at sics.se. Let's
keep up the pressure on Microchip becoming a full internetter!
Martin Nilsson
Swedish Institute of Computer Science E-mail: mnSTOPspamsics.se
Box 1263, S-164 28 Kista Fax: +46-8-751-7230
Sweden Tel: +46-8-752-1574
Sean,
You can find ASPIC, a shareware assembler for ALL microchip processors in
the 3rdparty area on Microchip's BBS and allegedly at the ftp site as well.
It is 5 to 20 times faster than MPALC and far more powerful (for example
you can define BIT labels) allowing code like:
BCF WREN ;(most processor dependant labels are predefined)
BTFSS MYBIT ;define individual IO / File bits.
- Don
PS: Does anyone out there know how to get a file list of an FTP site
through Compuserve? Allegedly there is also a way to request files from
here too.
It was great. If you havent gotten to go to it and its still comming to
your city GO! I got tons of loot from them. New data books, EEPROMS,
and a $100 programmer whith $30 of chips in it and another one of those
niffty litle screwdrivers(that i always loose). They also gave me a free
copy of there MPASM.EXE and the manual to it. It was really
interesting to hear about their new products that they are comming out with.
Plus I learned a lot about their product line. All of my local venders
where there too. I talked to all of them and sucked up really hard(they
did too). I got them ALL to send me samples of teh whole product line.
Pioneer already sent me the entire set(seminar was WED). I have a
EEPROM of everything: 54,55,56,57,64,71 and the EE 84. Plus she also gave
me two of each of the OTP's. For $100 i got 10x what it cost me to go.
later
John
Companies like Microchip and Maxim are generous, and they bend over
backwards to treat little guys (onesy-twosy quantity users) like us just
like they do their large quantity consumers. We should not abuse that
all-too-often-missing respect by being pigs. I say this with no venom
toward John. I used to be EXACTLY the same way. I've been to many
seminars (including this one), some free, others for cost. Distributor reps
are happy to give samples, especially if your project might lead to volume
purchasing, but they do have finite sample budgets. They would rather give
a sample to 10 different developers than give one guy 10 parts, and two
years later have nine of them still be on his shelf. I've been told by
several to ask for what you really need when you really need it, but don't
get parts just because you can get them. Remember, we're all in this
together. Abuse of generosity leads to less generosity. We have to give
respect in order to get it. Don't kill the goose for us all.
As for the seminar itself, it was good, but I thought something was
missing. The presentation only had one viewgraph showing the architecture
of the PIC processors, and very little discussion of their Harvard
architecture implementation. I had the feeling that I must have been the
only one in the room who had never written a PIC program before, and that
the seminar was more intended to show new parts to current users than to
introduce users of competitor parts to the PIC. Coming (NOT comming) from
Motorola 6801/05/11 programming, the PIC seems a bit strange. I know it's
just a matter of digesting the material in the data book and getting a PIC
program under my belt, but I was surprised that the seminar "loot" did not
include a PIC software programmer's reference/guide. A thirty minute
discussion of the architecture, registers, and instructions would have saved
me a lot of time getting started. I second John's opinion, though, that the
seminar is well worth the price of admission.
----------------------------------------------------------------
In message Sun, 26 Jun 1994 12:12:45 -0500 (CDT),
John Johnson <johnsonjSTOPspamKILLspambga.com> writes:
> It was great. If you havent gotten to go to it and its still comming to
> your city GO! I got tons of loot from them. New data books, EEPROMS,
> and a $100 programmer whith $30 of chips in it and another one of those
> niffty litle screwdrivers(that i always loose). They also gave me a free
> copy of there MPASM.EXE and the manual to it. It was really
> interesting to hear about their new products that they are comming out
> with. Plus I learned a lot about their product line. All of my local
> venders where there too. I talked to all of them and sucked up really
> hard(they did too). I got them ALL to send me samples of teh whole
> product line. Pioneer already sent me the entire set(seminar was WED).
> I have a EEPROM of everything: 54,55,56,57,64,71 and the EE 84. Plus
> she also gave me two of each of the OTP's. For $100 i got 10x what it
> cost me to go. later
> John
>
----------------------------------------------------------------------
Michael L. Blyler | @spam@michael.blyler.....spamgtri.gatech.edu
Georgia Tech |
GTRI/EOEML | Georgia Tech Research Institute
Baker Building Room 214 | VOICE (404) 894-3324, 874-4987
Atlanta, Georgia 30332-0800 | FAX (404) 894-5073, 894-6285
======================================================================
I have a problem with the program mpsim and the watchdog-generator at the
PIC 16c54. My program is resetet by the watchdog only the first time after I
called the sleep comand. There is no time-out after the second sleep comand.
Is it an error of mine or a bug in the mpsim?
Hi, I have seen in the PIC data book that many starter kits are available
from Microchip. Since I'll go to the USA next month and have some free time,
I'd like to know what are the prices of these kits and where to get them.
Here is the the first release of my pic dissassembler.
If you can't handle uudecodeing, uncompressing and untaring then
mail me and I will see what I can do.
Thanks
=%-)
Ian
P.S. The code is in unix standard ascii so DOS users will have to add
^M's to the end of all the lines (use the unix2dos command if you
have it).
i will be driving to california from boston during the coming week. during
this time list maintainence duties may lag depending on my ability to gain
net access while on the road.
soooo: if you send an unsubscribe, or someone not on the list tries to
subscribe, it could be up to a week before that request is processed.
Can anyone point me at a description of the PicBuster contraption
which I've been reading about on the MicroChip BBS? I have read about
this gizmo - and remain unable to tell what it is or how it does
its putatively nasty task of dumping eprom in secured pic 54 series
parts. Has there been any discussion of the picbuster here?
It is a very nice name though, given its function. - JGN
Here are a couple of MPALC macros I found useful for storage
allocation on PICs. They're for when you wat a register allocated
but don't care which; you can choose whether to allocate from the
top or bottom end of the register set. The parameters given here
do for 16C71 and 16C84 PICs, for others change RAM_Start and MAX_RAM.
If you like these, I also have some code for implementing timed finite
state machine dispatch (a machine is a set of states; the current state
is executed after a delay specified as a number of calls of the dispatcher;
states can set the next state and next delay to dispatch to; for N instances
of machines, it uses 2N+2 registers, 2N of them permanently and 2 as temps
for dispatch). I also have a master transmitter and slave receiver I^2 C
implementation for PICs (16C84 or 16C71) running at > 6MHz that supports
multimaster operation (in theory). If you are interested, say so, and I'll
post the code.
John Hallam, AI Dept., Edinburgh University.
-------------------cut here for MPALC code---------------------------
;******************************** Register File Store Allocation
;
; These macros allocate store from the register file. If there is
; enough store they succeed, defining the specified label. If not,
; they fail, leaving the label undefined and so inducing errors.
RAM_Start equ 0Ch ; First GP Register
MAX_RAM equ 30h ; Last GP Register + 1
RAM_Lo set RAM_Start ; Current low water mark
RAM_Hi set MAX_RAM ; Current high water mark
AllocHi macro label,amount ; Allocate store called <label>
if RAM_Lo+amount > RAM_Hi ; Not enough registers
exitm ; ERROR EXIT
else
RAM_Hi set RAM_Hi-amount ; Adjust mark
label equ RAM_Hi ; Allocate at high end
endif
endm
AllocLo macro label,amount ; Allocate store called <label>
if RAM_Lo+amount > RAM_Hi ; Not enough registers
exitm ; ERROR EXIT
else
label equ RAM_Lo ; Allocate at low end
RAM_Lo set RAM_Lo+amount ; Adjust mark
endif
endm
I bought the PIC C compiler from CCS (The guy in Milwaukee) thinking it
would make programming 16c5x's even easier. (I also have the Parallax
PGM & EMU) And reallly I can only say positive things about the compiler.
It is a simple TurboVision app, and truly easy to use and convenient. So
I have a question for anyone who may also be using this compiler. I am
using the serial library to do printf()'s getchar()'s etc, and of course
the code works fine when I use an RS232 chip, but I would like to take the
signal directly off the PICs pin. The problem with this is that I need to
send the complement of each bit if I do it that way. I could use a 7404,
but then I might as well use an RS232 chip. Does anyone know how to change
how the serial library works so I can do it this way?
----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Content-Lines: 27
Hello folks,
there was some (good) response about my new "Multi process Kernel". So I will
post it soon. Have some patient, because I have do some other jobs too.
To avoid too much questions later I'm describing details more precise
in the source now.
I intend to post the MpK next week. (Put the ZIP-files onto our public
server ftp.ntb.ch and to takdsign). BTW: MpK sounds a little bit too proud!
So don4t blame me afterwards...
PS: The first introduction of MpK I will add...
----------
X-Sun-Data-Type: default
X-Sun-Data-Name: MPK.DES
X-Sun-Content-Lines: 127
;
; #.ASM
; =============
; -MpK 1.0- with interrupt handler for PIC16LC71
;
;**************************************************************************
;
;Creator : M.Kellenberger, 18.11.93, IMS, Neu Technikum Buchs,CH-9470 Buchs
;System : Boxer Editor, MPALC, MPSTART, PDC.BAT(4DOS)
;Target : Microchip PIC 16C71
;
;History MpK:
;V 0.0 21.10.93 mik Definitions, systemlabel start with "_"!
;V 0.1 22.10.93 mik System design and description
;V 0.1a 25.10.93 mik Add "#" to user-changeable lines
;V 0.1b 15.11.93 mik Made systembody faster (20MHz)
;V 0.1c 16.11.93 mik MpK Kernel via simulater tested!
;V 0.2 25.11.93 mik RxError, RxBusy and Cmds!
;V 0.3 13. 1.94 mik RS-485 Enable implemented
;V 0.4 21. 1.94 mik Compiler flags _Tst,_MHz,_RS implemented
;V 0.5 27. 1.94 mik Compiler flags _Tst into TstDbg implemented
;V 0.6 28. 1.94 mik Compiler flags _WDT implemented
;V 0.7 8. 2.94 mik Ext_Cmd is 001T'0000 (Flag T is now also for EXT Cmds)
; 10. 2.94 mik reset condition into Cmd
;V 0.8 21. 2.94 mik CRC added, _Peven, _Parity deleted
;V 0.9 21. 2.94 mik CRCs/r added
;
; Tree projects were (are) launched with this body...
; - Intelligent sensor to messure thread tension. (sensation!)
; Gave the kick to design MpK!
; - Front end for a "laser pattern generator" (step tracker)
; - Switched capacitor controller. (->private company)
; ...beta test passed!
;
; Remarks: - "easy to learn and use" (J.Wagner)
; - "good programming philosophy"(L.Grecco)
; - "short time to release" (G.Staufert)
; - "don't bother about basic stuff,
; it's managed by the MpK" (L.Grecco)
; - "they got it" (M.Kellenberger)
;
;V 1.0 23. 6.94 mik Last test, more text, first public release!
;
;User programmers revision:
;V 1.0 ##.##.## ___ First attempt: #
;
;*******************************************************************
;
; Description:
; ============
;
; 1. Multi process Kernel System body (design and tested only for PIC16C71):
; --------------------------------------------------------------------------
;
; The MpK is designed as an (empty) programm body for several perposes:
; * Management of all interrupt launched processes.
; * Management for cyclic processes via RTCC (one timebase).
; * Usage of as little amount of PIC resources as possible for the MpK.
; * Serial communication up to 19.6kBd (half/full duplex).
; * Simple serial protocol. Ability to address 253 nodes (RS485) optionaly.
; * So far 1(or2)-byte-command supported -> may cause any action in the
; main process. (see chapter 2)
; * Quick realisation of user programms with that (and other) needs..
;
;
; The MpK consists of (a user defineable body for):
; * Predefined register- and macrosets (see also new "PicReg.equ" and
; "Pic71.mac")
; * Proper initialization of HW and status/option registers,
; * An INTerruptHANDLER (with simple priority managment),
; * One process for each interrupt source (managed by INTHANDLER),
; * 4 cyclic processes: (the cycle time base is managed by
; the RTCC-int.handler)
; - Tx, Rx0, Rx1:
; for a half/full duplex communication (RS232/485->driver needed)
; - Adjust- or user-process:
; for cyclic time adjustment or an other user defined cyclic
; process that base on that RTCC timebase.
;
; * May launch the AD-conversion repeatedly
; (calculated out of the cycle timebase)
; * One (empty) MAIN (user) process
; (suggestion: round-robin-scheduler, see chapter 2).
; * Serial communication is half/full duplex and may be setup easly.
; (acts almost like a built in SCI)
; * Semaphore (flags) for data transfer to/from MpK.
;
; Options:
; * One FSR during interrupt cycle and one other FSR during main cycle.
; * Simple implementation of a protokoll (-> chapter 2).
; * Simple implementation of CRC for sending and receiving line.
; * Simple implementation of 254 addressed nodes (RS485).
;
;
; Resources used by MpK:
; * INT interrupt as serial data receiver.
; * RB0,RB1 (and optional RB3 for TxEn) pin.
; * RTCC and its interrupt as cycle time base generator.
; * Prescaler (in some cases not, see calculations).
; * Unused Flags RP1, IRP and "ADCnused" (see PicReg.equ).
; * Ports RP0, RB1 for Rx and Tx.
; * Port RP2 TxEnable if "RS485-half duplex mode" is used, else free.
; * Only 7 Byte MpK reserved fileregisters including 1 command bytes.
; * Two more reserved bytes if two FSRs are desired.
; * Two more reserved bytes if CRC (Rx and Tx) is desired.
; * WDT is embedded.
; * All other interrupts are embedded.
;
;
;
;
;
;
; 2. Philosophy of the MpK
; ------------------------
; The idea for this MpK came up when I had to design a controller for
; my thread sensors. I wanted to create source code that is easy to
; expand and maintain. Also there was the idea to split up the
; whole problem into two parts:
; - The background running processes (put into MpK):
; SCI, AD sampler, MUX switcher, periodic actions, ...
; - The main program (pseudo processes):
; Protocol, cmd actions, data analising, ...
; All should be usable for other projects!
;
;
Has anyone networked several PICs (or STAMPs) together ?
Did you use RS-485 ? How about simply wiring toegether several
open-drain outputs on different PICs ? Are there any examples
of software for networking ?
Bob Armstrong (spam_OUTbobTakeThisOuTpoco-adagio.santa-clara.ca.us) wrote:
>
> Has anyone networked several PICs (or STAMPs) together ?
> Did you use RS-485 ? How about simply wiring toegether several
> open-drain outputs on different PICs ? Are there any examples
> of software for networking ?
>
Not yet, but I will be doing something pretty similar in the next couple
months. I've seen a neat wire-OR scheme for RS-485 where you use cheaper
RS-422 drivers ( a little, I think) and hook data input up to the driver
enable pin. Essentially allows wire-or with simpler protocols.
I'll post anything interesting that comes up.
/s/ Bill
Yes, we (Custom Hardware Engineering) have been networking the PIC for
home-automation products using our "RS232-BUS". It's simple, easy to use,
and an open protocol. We simply connect multiple PICs together on an RS232
line. Their is a transmit and a recieve line (just like RS232). The
transmit line connects to one of the data lines of multiple PICs through a
large resistor (1meg). So, there isn't much drain on this line. The
receive line is tied to -12V through a 2.2K resistor somewhere on the bus
and is tied to an opto-isolator which can pull the line to +12V by a normally
off pin on each PIC. When the communication is only between a "host"
(normally a PC), and the other devices on the bus, the data protocol is
simply two bytes of address data followed by two bytes of command/data. The
devices then return their address followed by two bytes of response data
(if needed). It is possible for devices to speak to one another on the bus
but in this case, it is required that the device respond in some manner, so
the sender knows that a collision has not occured.
For more specifics, feel free to write me back. Also, a quicky - we are
offering a line of home-automation products that work over our RS232-BUS
protocol. At present, we have a temperature sensor and a thermostat based
on the PIC and this protocol but we will have much more in the coming months.
We are also looking at offering kits if anyone is interested. To get on our
mailing list, just respond to this note asking to be placed on it and I'll
add you. We won't send out lots of mail - just notify you of new products
and any information you may want/need concerning out RS232-BUS devices.
*****************************************************************************
* Paul Greenwood -> -> -> -> -> -> -> Custom Hardware Engineering *
*---------------------------------------------------------------------------*
* "Any sufficiently advanced technology is indistinguishable from MAGIC." *
* - Arthur C. Clarke *
*****************************************************************************
>From: Mark <.....mbmoore.....RemoveMEbga.com>
>and an open protocol. We simply connect multiple PICs together on an RS232
>line. Their is a transmit and a recieve line (just like RS232). The
This sounds a little like RS485. I am curious why you decided not to
take this route as this would make you more compatible with other products
(including the line of home automation modules from Circuit Cellar).
YOurs, Ed
+---------------------------------------+-----------------------------------+
| Edward Cheung, Ph.D. | The opinions expressed herein |
|Satellite Servicing Robotics Laboratory| do not necessarily reflect |
| NASA Goddard Space Flight Center | those of my employers' |
| Code 714.1, Bldg T11B | |
| Greenbelt, MD 20771 | |
| 301-286-1269(office) 286-1717(fax) | My next book: |
| Internet: spam_OUTcheungTakeThisOuTEraseMEasylum.gsfc.nasa.gov | Statistics, Demos and Other Lies |
+---------------------------------------+-----------------------------------+
A bug was just found yesterday in ASPIC: The internal definitions
of the bits in EECON1 are out by 1. As an interum fix, you should add
the following definitions to your declaration file (eg. REGS.ASM):
;REGS2 is defined as:
; DEFSEG REGS2,$80,$8C ;special regs - bank2
;
.seg REGS2
.ds 3 ;PCL,STATUS,FSR image
TRISA: .ds 1
TRISB: .ds 1
.ds 1 ;(tris C - UNUSED)
;******************************************************************
;** EECON1
;** *** NOTE *** WE NEED TO RE-DEFINE THE EECON1 BITS TO FIX A BUG
;** IN ASPIC 5.32! **DO NOT USE THE INTERNAL DEFINITIONS!!!
;**
;******************************************************************
--------------------------------------------------------------------
Use the bit B.RD whereever you would have used RD, etc. This will
not in any way interfere with automatic bank management etc.
Sorry for any inconvenience which may have been caused. Registered
users will be able to pick up the new beta in a couple of weeks. If
you need an update emailed to you, drop me an e-line.
Depending on how the pic programmer works, couldn't you just bust off
a data pin on the PIC? As long as you didn't need it in your product
this could add another layer of protection.
What's this I keep hearing about being able to break the protection on
a pic? This is definitely something I'll need to know about, as I
have a pic design that I will want to be able to protect in about 6
months when we're ready to go into production.
I'm also interested in the protection scheme for PIC chips, and how it
can be broken. However, I'm on the other side... how do I read out a
secured PIC chip? If anyone can offer me details, I'd be most estatic
and thankful!
Also, does anyone have a build-it-yourself schematic for a PIC 16C54
programmer? I have the 16C84 one.
Thanks.
Jason
|\\| Jason Miller |//| RemoveMEjmdkspamBeGonespamcmu.edu CALL (412)/325-2036
|//| Mathematics/Information Systems |\\| @spam@jcmspamsei.cmu.edu PAGE (800)/901-0840
|\\| Carnegie Mellon University |//| TakeThisOuTdynKILLspam@spam@cs.cmu.edu FAX (412)/268-5758
---
In the end we will conserve only what we love, we will love only what we
understand, we will understand only what we are taught.
The first $40 adresses can be read even if the PIC is protected.
The PIC is destroyed in the process.
I've only tested this on a windowed 16C54.
I've also written a program that does this automatically and generates
an INTEL dump file. (This is not the program called PICBUSTER)
I did this to be able to copy a cableTVdecoder, the code was more than
$40 words long so I didn't try it though.
No, you can't have my program and I won't tell you more than to read
the datasheets on how to program the PIC's.
The same decoding principal is said to work on some PAL's too...
Help!!
I`ve written my own compiler and serial com system for a BBC Micro
to communicate with a PIC16C84.
I got bytes written and verified, and thought all was hunky-dory.
BUT when I wrote the config word at 2007H, the security fuse blew.
The Microchip Data Book said to program that bit as a 1. I did.
I had one more chip, so I programmed that with a 0. It too blew
???????
Any ideas anyone?
The other problem is that the clock won't oscillate. I'm using a parallel
crystal with 15pF load at 4MHz. Should it be series resonant?
Will it oscillate on power-up or only after the config word is set up?
What should the lowest bits of the config word be? ie. what is the
difference between HS and XT set-up?
Yours hopefully,
Bryan Crotaz
---------------------------------
BRYAN CROTAZ - .....b.crotazEraseMEic.ac.uk
---------------------------------
TECHNICAL MANAGER
Student Television Of Imperial College
Beit Quad, Prince Consort Road
London SW7 2BB
Tel. 071-594-8104
Fax. 071-225-2309 attn. STOIC
A while ago I mailed the list with some storage allocation macros and
a threat to supply interested parties with code for I^2 C bus protocol
communications and timed finite state machines. Part of that is done:
but the code is moderately long so I suggest that you collect it, if you
are interested from ftp.dai.edinburgh.ac.uk, file /pub/user/pic-utils.tar.
You will find there the storage allocation macros I posted earlier, and some
other useful macros, e.g. a configuration macro that supports defaulting for
conditional compilation switches (the things that, when you forget to put
/D xxx=1 on the command line, MPALC says something like "line 1: Crit" and
crashes your machine ;-), as well as code for a multi-master I^2 C package
supporting master transmit and slave receive with interrupt detection of start
conditions (so your PIC doesn't have to spend all its time watching the bus).
The individual files in the directory in the tar file contain more information.
The finite state code will follow, as will other bits of the I^2 C stuff and
a neat UNIX c-shell script that calculates all the register values for a PIC
16C71 given clock rate, RTCC tick rate desired, and descriptions of the pin
functions (e.g. digital output, analogue input, digital tristate, etc.). I
didn't manage to do this today, 'cos I've got to go on holiday in about an hour.
The code is there for people in a hurry -- in a month there will be more.
Has anybody interfaced an AT-style keyboard to a PIC16C54 yet? I need
something that gives a (preferably bi-directional) translation between an
I^2 bus and a PC keyboard.
Is there an easy way to connect a PIC to a 68000? Preferably memory mapped.
The only way I can think of is putting a PIA like a 6820/68230 or a UART
like 6850/68901 in between. The serial solution is probably too slow, as I
need at least 20 KB/s data transfer.
Easy. Even without having to use PIA or UART. Use the asynchronous bus feature of 68k.
Have 2 PIC pins configured to sample the state of /CS (from decoder) and R/W (from 68k)
Have 1 PIC pin to drive the /DTACK (with OC driver). And have the PIC to place/read the data on
the bus at appropriate times. Note that your 68k will wait until it detects /DTACK asserted. The
danger is of course that if the PIC is not programmed properly in its response to 68k requests, so
that /DTACK never gets asserted in this bus cycle, then the system dies.
On Wed, 13 Jul 1994, Ben Stuyts wrote:
> Is there an easy way to connect a PIC to a 68000? Preferably memory mapped.
> The only way I can think of is putting a PIA like a 6820/68230 or a UART
> like 6850/68901 in between. The serial solution is probably too slow, as I
> need at least 20 KB/s data transfer.
>
What about a simple 2 line modified serial interface. Use one line to clock
data and one line for the data bit. I use that to commuicate on all of
my PICs. In short it hauls ass. but I have never had an application
where i had to get 20KB/s of data and send it. If any place thats where
you will loose your performace.
later
John
_____________________________________________________________________________
John Johnson |If it's not OS/2.|.....johnsonjEraseMEccwf.cc.utexas.edu
|It's crap! |spamjohnsonjspam_OUT@spam@ghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
I wrote to pic@figment this week concerning my problems getting a
PIC16c84 to run a program. I have now got the oscillator running, but
it won't run a program. The problem could be anywhere, as I wrote my own
compiler and serial programmer on a BBC Micro. I've checked the program code
against the data sheet from Microchip, and set up the configuration
register to &1A ie WDT off, PWRT on, code protect off, HS osc.
I set the reset vector to 2805H ie GOTO 5
My code starts at location 5 (I hope)
The first prog I wrote was:
0005 SLEEP 0063H
When turned on, the PIC did not sleep. Port A pins went high, Port B
stayed low.
The oscillator ran continously.
ie. set TRIS A = 0 - all outputs
Port A = &FF - all high
Port A = 0 - all low
repeat ad nauseam or until you feel sick...
Same symptoms on running as last program.
It is my feeling that I've not set up an important register or am not
programming from location 0. Data is being verified correctly, so
programming is correct.
Below is the command structure I used to program locations.
COMMAND DATA
000010 0xxxxxxxxxxxxxx0 ie. program data * 2
delay
001000
delay
000100 data read back is correct
000110
I no longer have access to the programming spec ie. the serial comm
stuff, but if anyone does have it, could they E-mail it to me or
fax it to 071-225-2309 (attn. STOIC). I'd be eternally grateful, and
might even write and say thanks....
I do have the data sheet by Microchip (DS30081A).
If anyone has any ideas why this chip might not be running a program,
I'd love to hear from you.
Thanks in advance...
Bryan
PS I'm working with Alan Barnett, if the double requests cause
confusion....
--
---------------------------------
BRYAN CROTAZ - spamb.crotaz@spam@STOPspamic.ac.uk
---------------------------------
TECHNICAL MANAGER
Student Television Of Imperial College
Beit Quad, Prince Consort Road
London SW7 2BB
Tel. 071-594-8104
Fax. 071-225-2309 attn. STOIC
Anyone interested in trading two UV erasable PIC16C57s for two UV
erasable 16C56s? I'll pay postage too - preferrably two-day US Post.
The two I'll give you haven't been used and I prefer that the 56s I get
to have not been erased more than 5 times.
--
------------------------------------------------------------------------------
If outside IBM network boundaries _^_ please pay attention to the following:
I speak for myself, not IBM. What (o o) I say MAY be wrong. No action should
be taken on my opinion alone. -oOO-(_)-OOo- (spamBeGonepablospamBeGone@spam@netmail.austin.ibm.com)
------------------------------------------------------------------------------
> A secondary piece of code runs fine in the simulator, but nevers runs on
> the hardware (same hardware that runs a simplier but similar program).
If you ever use indirect addressing at all, make sure you set the FSR to zero
before you initialize any other memory. The simulator probably starts with
zero in the FSR, but the chip doesn't. Since two bits of the FSR determine
which register bank is directly accessible, if you don't initialize it your
direct RAM accesses will be to a random bank. Then when you set the FSR
in preparation to use IND, you will lose all your data.
Then again, you might have an entirely different problem :-)
A secondary piece of code runs fine in the simulator, but nevers runs on
the hardware (same hardware that runs a simplier but similar program).
Is there any known traps that I particularly should watch when I goto the
hardware? I have spent the last two weekends on this problem, so any
advice would be appreciate. I am happy to send my code to anyone that
may help solve the problem.
regards
Gary Gaskell
DSTC
Cooperative Research Centre for Distributed Systems Technology
Queensland University of Technology
Ph +61-7-864 1051 FAX +61-7-864 1282
Email gaskellKILLspamspamdstc.qut.edu.au
Pitfalls I have run into that may or may not be what you're up
against:
1. FSR in a 57 may be pointing to any register bank on startup. The
simulator might assume bank 0 always. Clear the FSR at the start of
all 57 code that cares about the bank switching ability.
2. I've found SLEEP to not work sometimes if it's in the second half
of a page.
3. You may have code that spills over a page boundary and uses jumps,
in which case it jumps to the wrong page. My habit is to always
include org 0, org 100h, org 200h ... org 700h in every '57 program,
and put at least a nop at the top of each half page, so any time
anything spills over, the assembler will tell you.
4. Never compare RTCC directly with anything. Move it to W first, or
the PIC will give erroneous results. For instance, testing RTCC will
never set the Z bit, even though if you repeatedly move RTCC to W and
test W you'll see zero every 256 ticks.
5. Remember to reset page select registers after a call to a
subroutine not on the current page. Otherwise, local jumps aren't ;^)
Good luck finding your problem. I've discovered most of these by
putting checkpoints in where I flash LED's or whatever, until I figure
out what's wrong.
Don't know if this is what you want...
You can get the intel hex dump from your chip and then put it back in
the simulator. The simulator can then be made to show you the
assembler instructions.
I'm trying to design a keyless entry system using a magnetic card
reader. Has anyone out there done this using any of the PIC's? If so
which one and which card reader? Also what problems might I encounter
along the way.
> I'm trying to design a keyless entry system using a magnetic card
> reader. Has anyone out there done this using any of the PIC's? If so
> which one and which card reader? Also what problems might I encounter
> along the way.
If your card-reader is RS232, it won't be a problem because there is lots of
RS232 code around. Since it looks like you're still trying to pic (pun
definately intended) one out, then look for RS232 type readers. I have NOT
done this but it sounds pretty straight-forward. One thing that I CAN think
of is - where are you going to store the card numbers? You could hard-code
them into the PIC and re-program (use a UV erasable) them when needed. Or,
you could have an external memory chip to keep the data in. Or, you could
have all of them transmit back to a host computer. If you are interested
in the latter, we might be able to put something together for you to do
RS232 from the reader, and then have the info. transmitted back to the host
over an RS232-BUS. Write us back if you're interested and we'll talk about
the details.
*****************************************************************************
* Paul Greenwood -> -> -> -> -> -> -> Custom Hardware Engineering *
*---------------------------------------------------------------------------*
* "Any sufficiently advanced technology is indistinguishable from MAGIC." *
* - Arthur C. Clarke *
*****************************************************************************
There is a PIC disassembler available on the Microchip BBS that does
para-symbolic disassembly of 5X parts. It's probably on an ftp site
somewhere, but there is no way to find files or ftp sites from compuserve
that I know of.
> > Anyone come across a PIC16c5x decompiler?
> Don't know if this is what you want...
> You can get the intel hex dump from your chip and then put it back in
> the simulator. The simulator can then be made to show you the
> assembler instructions.
> /Anders
Yeah that will work, but it makes documenting the rev history a bitch,
(paperwork sucks) and I've got to have the record later on.
>I've seen replies to a few requests for help suggesting the use of
>either the 16C64 or 16C74. What I was wondering was whether the people
>suggesting using these ICs had ever used them themselves ? The reason I
>ask is because Microchip in the UK have been reluctant to make any
>promises of availability before Christmas for either, despite the fact
>that both have been advertised by distibutors already. I've heard
>rumours that Microchip have been having some production difficulties
>possibly due to their move to a new wafer fab facility for production of
>0.8 micron devices.
>I would be interested to hear if there is easier availability Stateside
>and if so, whether there have been any other problems with the new
>devices. I'm a bit reluctant to spend time developing a project based
>around either of these ICs only to find I can't get my hands on any or
>that there are problems with the device.
I telephoned Microchip UK the other to find out if I could get a sample
16c74 (or some) and they said that it was available, and I should contact my
dealer. I did so and several other dealers and they all said that they did
not have any in and did not expect any until October at the earliest. I
would also like to find out about programming tools for the '64 and '74 but
information seems to scarce.
Can anyone in the states get their hands on either tools or samples or both
and ship to the UK?
I am sure that there are other people here that would also like to get their
hands on these models - goodbye to those I/O pin blues!!!!.
Scott Colson wanted the Microchip BBS no.
For anyone lse who hasn`t got it...
They are a user of Compuserve.
To find your nearest Compuserve,
Set your modem to 7E1 (7 bit, even parity, one stop)
Dial (800) 848-4480 for 300-2400 baud, or
Dial (800) 331-7166 for 9600 baud
The system will respond with
Host Name:
Type NETWORK <enter>
Follow the instructions.
Alternatively, voice info is on
(614) 457-1550
To connect to the BBS,
Set your modem to 8 bit, No parity, One stop (8N1)
Dial Compuserve
Type <enter>
A garbage string will appear
Don't panic!
Type +<enter>
Host Name: will appear
Type MCHIPBBS<enter>
You will now be connected.
I take no responsibility for the above, it came from a Microchip
data sheet.
Bryan
--
---------------------------------
BRYAN CROTAZ - spamb.crotazKILLspamKILLspamic.ac.uk
---------------------------------
TECHNICAL MANAGER
Student Television Of Imperial College
Beit Quad, Prince Consort Road
London SW7 2BB
Tel. 071-594-8104
Fax. 071-225-2309 attn. STOIC
In message <Pine.3.89.9407180144.A13604-0100000@mary> Scott Colson writes:
> Could someone please send me the phone number for the Microchip BBS?
> Thanks in Advance...Scott
If you know how to get on to CompuServe, you know how to get onto
the Microchip BBS. use your local CompuServe access number, log on
8N1, wait for the garbage. At the end of the garbage, you will see
some that looks like Hoot Naie: - this is actually a 7E1 version of
Host Name:. At this prompt, enter MCHIPBBS - you are then into the BBS.
I NEED YOUR EXPERTISE!
I HAVE A PARALLAX CROSS COMPILED LISTING FOR A I BELIVE IS SOURCE FOR THE 8051
CONTROLLER. WHAT I NEED IS SOMTHING THAT WILL ETHIER LET ME COMPILE IN THE 8051 OR SOME WAY OF PRODUCING A LISTING OF 8051 CODES SO I CAN FIGURE OUT WHAT ALL
THE CODE IS DOING.
IM DO NOT HAVE ANY EXPERIANCE WITH THE 8051 AND DONT KNOW THE SYNTAX. TO SUM
IT UP A CROSS COMPILER TO COMPILE 8051 TO PIC CODE OR ANY IDEAS YOU GUYS MIGHT
HAVE.
THANKS FOR ANY SUGGESTIONS YOU CAN SEND.
JAMES.
CCK
I'm glad to see that the mail is starting to get out.
I'm new to this user group, and as a result I have a lot of questions.
I've tried out the floating point division provided in the float.asm
file contained in the an526 application note files, and it doesn't
seem to divide correctly for all numbers. I get a zero result in
many cases.
I'm using Parallax's assembler to target a 16C57. I noticed an
interesting behavior: When I use LCALL instruction to jump to a
sub-routine in another bank, subsequent jump instructions (JNZ, etc)
in the main code don't work correctly.
This is because the LCALL sets the bank select bits. When the RET
instruction is executed, these don't get reset back to the bank of the
LCALL. So any 9-bit jumps go to the bank where the subroutine was
located! This is easily fixed by using LSET just before the RET to set
the bank select bits back to the calling bank (which means you can only
call that subroutine from one bank).
Example:
org 00h ; bank 0
lcall other_sub ; call subroutine in bank 1
mov w, some_variable ; do something afterwards
xor w, #012h
jnz :not_twelve ; this jump will not work correctly! Bank select
... ; bits are set to 01.
..
:not_twelve ; this line will not be reached
... ; instead, jnz will jump to somewhere in bank 1
..
org 200h ; bank 1
other_sub ; bank select bits are 01 at this point
...
..
RET ; bank select bits do not change with this ret.
-------
Anyone have insight on this problem? The LSET workaround is OK, but I'm
wondering if I'm missing something.
--
Greg Bell | "Ever see a company's sales drop sharply due to an @spam@gregSTOPspamcqt.com | annoying ad campaign? You will."
-----------------------------------------------------------------------
CommQuest Technologies, Inc. (619) 633-1618 x133
You're right on top of the issue. I have noticed this too. My
current habit is to do this kind of thing:
lcall subroutine
lset $
The $ means the current address so that will always bring the page
select registers back to reality. I definitely take advantage of
optimizing situations, though. For example...
lcall subroutine
lset $
ljmp someplace
In the above you can remove the lset, since ljmp overwrites the page
select registers anyway. The same is true if there are no intervening
jumps in a string of code between "long" calls.
lcall subroutine
mov...
add...
or...
anything but a jump....
lcall someplaceelse
I'll usually put lset $ in anyway, then comment it out with an
additional comment that it is not needed any why.
My basic strategy to getting the most out of the '57 is the following:
and add code from there (replace nops as needed). That way if you
overflow a 256-word half-page, the assembler will tell you. You might
also want to change the order so all the legitimate call destinations
are together:
2. Using jump instructions, you can place subroutines at any location.
Of course, the actually destination of the call must be in the first
256 words of a given 512 word page.
For example
org 0h
Subroutine
ljmp Sub_body
org 100h
Sub_body
actual code here
ret
3. anything with a JMP PC+W (lookup table) must go in the first 256
words of a 512 word page.
4. Always explicitly clear FSR on startup. Initial register bank
selection is random! (Though it genuinely doesn't matter if you leave
FSR alone throughout your code.)
5. Unless you have grouped closely related subroutines, plan on using
LCALL always to call subroutines, and always follow with LSET $. That
way you can relocate code at will.
6. Certain optimizations beyond the above are easy. Long strings of
calls to the same routine can be one LCALL followed by a string of
simple CALLs and an LSET $ at the end, etc.
7. For some reason, I've had SLEEP fail when it's not in the first 256
words of a page. Just so ya know.
I'm curious to know if I'm using the right assembler for the pic 16c64.
Presently, I'm using the MPASM Assembler for PIC16/17, version 1.15.
I saw some notes about another assembler that I didn't know was available.
This caused me to wonder if I am using the best tool. Does someone have
a list of assemblers? What assemblers are you using?
I'm also interested in finding or writing a simulator for the pic 15/16
that will provide pin output and input with data tracking to a file.
Currently, I'm using the MPSIM Simulator for PIC16 v 4.16. Do others exist
for the 16c64?
I've done a project where I use only one data line on a pic16c54, it
is RA0 and it is set to output. All other pins are set to input (default),
as I set port_a by :
movlw 0eh
tris port_A
and don't init port_b. Ok everything is fine here. I am generating
a repeating pattern out of RA0, but the output is very dirty. Then I
tied RA1 to +5 through a 5k resistor and all my problems went away,
RA0's output cleaned up.
In the book it says for lowest current consumption in sleep mode all I/O
pins should be at VDD or VSS. I don't use sleep mode, but should I tie
all my unused pins to VDD or VSS? Do I need the resistor if I tie them
to VDD? Any other thoughts on what to do with unused pins?
Derrick Early asked:
> I'm curious to know if I'm using the right assembler for the pic 16c64.
> Presently, I'm using the MPASM Assembler for PIC16/17, version 1.15.
> I saw some notes about another assembler that I didn't know was
available.
> This caused me to wonder if I am using the best tool. Does someone have
> a list of assemblers? What assemblers are you using?
ASPIC, available as shareware from several ftp sites, Microchip BBS, and
the author's support BBS ((604) 597-3479), is 5 to 20 times faster than
MPALC or MPASM. It's powerful features allow considerable code compression,
since they make complex constructs much more maintainable.
It has some unique features such as character set translation, automatic
register bank management, text packing, true bit labels, full support for
IDE's like Brief, Codewrite, Winedit and Multiedit (even with multi-file
projects). It also works properly in makefiles, supports environment
variables, allows fuse and EEPROM data definition, automatically generates
RETLW tables, and more.
A complete working source code is provided as a code framework. It is
called DEMO.ZIP, and it is the complete source of a pocket logic analyzer
with LCD, KEYBOARD, etc. (Registered users also get the schematics and
block diagram).
Sorry if that sounded a bit biased, but I actually did try to use
restraint.
Are you sure that you are not trying to source to much out of the output
pin? I sometimes only use the lower 2 pins on port A, because I try
to make port A always RS232 pins, and I have no problems at all.
Try to put a pull-up resistor on the output pin and see if it works.
Check to make sure you are not trying to pulse the lines too fast, once
I tried to generate a 2 mhz clock from an output pin until I very
carefully figured out the capacitance in my 22 awg hook-up wire that was
7 inches long. :)
Anyone know of a command-line programmer which works with the PIC-START
system? I hate having to go through all those damn menus.....
--
------------------------------------------------------------------------------
If outside IBM network boundaries _^_ please pay attention to the following:
I speak for myself, not IBM. What (o o) I say MAY be wrong. No action should
be taken on my opinion alone. -oOO-(_)-OOo- (spam_OUTpablospam.....netmail.austin.ibm.com)
------------------------------------------------------------------------------
I have been struggling with floating point division, and I'm curious to see
if the code above is more efficient. I tried the an526 stuff, but I wasn't
very successful. I must be doing something wrong.
Thanks to David Thomas, Stuart Lea, Don lekei and Eric Smith for a some
previous advice. I am still having trouble, that I can't see how to attack.
My question then, was for help about why might a PIC16C57 program work fine
on the Microchip simulator, but never on the chip.
I believe that I have properly checked:
1. that the FSR is adjusted for the right data page
2. the status flags are set for the right program page
3. FSR has been initialised properly
4. All other registers that could affect this have been checked for initialisation
5. the RTCC is not compared directly but with the value in W
6. page select bit are properly maintained;
To describe the situation.
I wanted to extend code from the ap notes for provide me with 4
general purpose timers. these were designed to count down and
then trigger a flag (and action) when they timed out. The code
is yet to be modified for decimal rather than hex, but that is
just work for later.
The problem.
The timers never time out.
analysis:
If we set the timer with a value of 5 (seconds), but XORing
with constants it has been possible to trigger LEDs to indicate
that the value is decremented.
BUT,
the timer is decremented from 5 to 4, and then next time from 4
to 3, BUT it never seems to be decremented to 2 or to 1.
Hopefully you could help by:
1. Suggestions for further analysis
2. Suggestions of what might be wrong.
I am becomeing quite frustrated - it affects my confidence in
embedded programming. There are not spurious processes that
could be messing it up (it is not a DOS program!), so I am
failing to see where the difficulty could be.
Thanks for any advice. The code is appended.
PS the watchdog is not timeing out. The chips have been tried
with it on and off. I also have the chip blinking an LED (Port A
bit 3) to ensure that it is still ticking over, and that never
stops or fails.
I am including a listing file and a source file.
------------------------------------------------------------------------------
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 1
Line PC Opcode
0001 ; TST2.asm May 1, 1994
0002 ; modified to test PIC out and do demos. extra comments
added
0003 ; Insert BCD timers and test
0004 ; Original code from the Applications notes from Microchi
p.
0005 ;
0006 ; Gary Gaskell mods for count down timers.
0007 ;
0008 LIST P= 16C57
0009 ;
0010 ; Coding policy:
0011 ; A routine is a section of code. This defintion may be r
efined to two types
0012 ; of routines. The first is a PROCEDURE. Procedures may
be called
0013 ; using the stack of the PIC. The second is a "CODE SEQU
ENCE". This
0014 ; type of routine may not be called, only jumped/branched
to. The
0015 ; intention is to limit the likelihood to too many calls
resulting in
0016 ; an overflow on the stack.
0017 ; Level 0 This code is Base code (stack is empty)
0018 ; Level 1 Called from base code, may call another rou
tine. (stack=1)
0019 ; Displine and quality code requires that a r
eturn is
0020 ; executed.
0021 ; Level 2 Called from base or Level 1 code. The stack
is now full
0022 ; so no calls are allowed. branching only, b
ut a return
0023 ; is essential to unwind the stack.
0024 ; CONSTANTS will be in UPPERCASE, with variables in lowe
rcase.
0025 ;
0026 ;
0027 ; define equates:
0028 ;
0029 07FF PIC57 equ 7FFH
0030 ;
0031 ; external osc used = 4.096mHz. prescaler of 32 used, wh
ich gives a
0032 ; 31.25 microsec inc of the RTCC. If the rtcc is initial
ly loaded with 96
0033 ; it would overflow to 0 in 5.00ms. giving 0.00% error
0034 ; If the crystal is 4.000 Mhz (prototype Xtal), NB 4Mhz x
tal gives 1 Mhz
0035 ; internal clock. then overflow at 32usec,
0036 ; requiring 156.25 rtcc cycles, ie msecs should be 100, b
ut an error needs
0037 ; to be corrected. , Easier option is to decrease interva
l to 4 ms and to
0038 ; alter the constant for the seconds to 250 (249 actually
). NB gives
0039 ; 4000 instructions before the RTCC overflow must be caug
ht.
0040 ;
0041 ; MTICKS EQU d'96' ; for 4.096 Mhz xtal
0042 ; MTICKS EQU d'100' ; for 4.000Mhz xtal
0043 ; MTICKS equ d'131' ; for 4.000MHz xtal and
4msec overflow
0044 0001 MTICKS equ d'1' ; for testing
0045 ; Number of rttc timeouts to equal one second.
0046 ; NumRollover equ d'199'
0047 ; NumRollOver equ d'249'
0048 0001 NumRollover equ d'1' ; for testing
0049 ;
0050 ; needs fixing to right value
0051 0000 key_hit equ 0
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 2
Line PC Opcode
0052
0053 0001 same equ 1 ; register operation sourc
e=dest
0054 0000 C EQU 0
0055 0000 BEP EQU 0
0056 0000 RTATS EQU 0
0057 0001 DC EQU 1
0058 0001 HR10 EQU 1
0059 0002 Z EQU 2
0060 0002 HR EQU 2
0061 0004 MIN EQU 4
0062 0004 FLASH EQU 4
0063 0005 PA0 EQU 5
0064 0006 PA1 EQU 6
0065 0000 F0 EQU 0
0066 0005 LEDon EQU 5 ; is set if the LED is on. bit 5 of alflag
0067 0003 led equ 3 ; bit of portA for the le
d.
0068 0005 dataP1 equ 5 ; bit 5 of FSR (sets from
DP0 to dataPg 1)
0069 ;
0070 ; Constants for timers etc
0071 ; these are set if the timer is active
0072 0000 timer1 equ 0 ; bit numbers for flag "t
imeFlag"
0073 0001 timer2 equ 1
0074 0002 timer3 equ 2
0075 0003 timer4 equ 3
0076
0077 ; these are set if the timer has finished and awa
its action
0078 0004 tmr1end equ 4
0079 0005 tmr2end equ 5
0080 0006 tmr3end equ 6
0081 0007 tmr4end equ 7
0082
0083 ; This is the number of bytes that separate the t
imer, from
0084 ; a copy of its setup values
0085 0008 OFFSET equ 8
0086
0087
0088 ;
0089 ; DEFINE RAM LOCATIONS
0090 ;
0091 0001 RTCC EQU 1
0092 0002 PC EQU 2
0093 0003 STATUS EQU 3
0094 0004 FSR EQU 4
0095 0005 PORT_A EQU 5
0096 0006 PORT_B EQU 6
0097 0007 PORT_C EQU 7
0098 ;
0099 0008 MSTMR EQU 8 ; ms timer
0100 0009 STMR EQU 9 ; sec timer
0101 ;
0102 000A MTMR EQU 0A ; min timer
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 3
Line PC Opcode
0103 000B HTMR EQU 0B ; hour timer
0104 ;
0105 000C temp EQU 0C ;
0106 000D tmp2 EQU 0D ;
0107 ;
0108 000E timeFlag EQU 0E ; min entry
0109 000F dummy EQU 0F ; hour entry
0110 ;
0111 ; New data page : Page 0
0112 0011 tmp3 EQU 11
0113 0012 genFlag equ 12 ; general flags
0114 0013 digit equ 13
0115 0014 new_key equ 14
0116 0015 KEY_NIBL EQU 15
0117 0016 DEBOUNCE EQU 16
0118
0119 0017 MIN_SEC EQU 17 ; MIN/seconds timer
0120 ;
0121 ; PORT pin definitions
0122 ;
0123 ; Port A: s
0124 ; bit0 led to flash
0125 ; bit 1-3 unsed i/o
0126 ;
0127 ; define the RAM locations of DATA PAGE 1 (timers)
0128 ; NB to use these RAM locations (variables) the correct b
its of the
0129 ; FSR must be set (5&6).
0130 ; setup 5 timers. Each will store BCD time values and be
decremented to-
0131 ; wards zero. NB if these timers are moved the code that
works on that
0132 ; must be updated.
0133 ;
0134 ; Timers placed in Data Page 1
0135 0030 stmr1 equ 30
0136 0031 mtmr1 equ 31
0137 0032 stmr2 equ 32
0138 0033 mtmr2 equ 33
0139 0034 stmr3 equ 34
0140 0035 mtmr3 equ 35
0141 0036 stmr4 equ 36
0142 0037 mtmr4 equ 37
0143 0038 stmr1Val equ 38
0144 0039 mtmr1Val equ 39
0145 003A stmr2Val equ 3A
0146 003B mtmr2Val equ 3B
0147 003C stmr3Val equ 3C
0148 003D mtmr3Val equ 3D
0149 003E stmr4Val equ 3E
0150 003F mtmr4Val equ 3F
0151 ;
0152 ;
0153 ;
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 4
Line PC Opcode
0154 ; *******************************************************
*********************
0155 0000 org 0
0156 START
0157 0000 0A1E goto initialise
0158 ; this routine runs a test on the leds
0159 ; all the relevent leds are lit up for 2 secs.
0160 ;
0161 test_hardware
0162 0001 0C01 movlw D'1' ; flash every two for 2 se
cs
0163 0002 0037 movwf min_sec
0164 ;
0165 ;
0166 norm_time
0167 0003 0412 bcf genFlag, 0 ; put in real time
0168 0004 0432 bcf genFlag, 1
0169 ;
0170 time_loop
0171 ; call update_display
0172 ; bsf status, PA1 ; goto page 2
0173 ; call service_keys
0174 0005 05A3 bsf status, PA0 ; goto page 1
0175 0006 0900 call update_timers ; wait and update timers
(Realtime)
Warning: [Warning 1] : line 175 : Address change across page boundary, ensure page bits are set
0176 0007 04A3 bcf status, PA0
0177 0008 0D00 iorlw 0 ;
0178 0009 0743 btfss status, Z ;
0179 000A 0A0C goto GPtime ;
0180 ; movf genFlag, w ; see if in atm
0181 ; andlw B'00000011'
0182 ; xorlw B'00000001'
0183 ; btfsc status, z ; skip if not
0184 retrn
0185 000B 0A05 goto time_loop
0186
0187 GPtime
0188 ; code sequence to call general purpose timers
0189 ; Pre: only called after a second interval has past
0190
0191 000C 05A3 bsf status, PA0 ; goto page 1
0192 000D 0975 call servTmr ; service the gen purpose
timers
Warning: [Warning 2] : line 192 : Address change across page boundary, ensure page bits are set
0193 000E 09A5 call TmrAct
Warning: [Warning 3] : line 193 : Address change across page boundary, ensure page bits are set
0194 000F 04A3 bcf status, PA0 ; reset page flags
0195 0010 0915 call ChangeState
0196 0011 0A0B goto retrn
0197
0198 on
0199 ; Level 2 routine.
0200 ; set led on, by setting it low, set in flag and at port.
0201 ; Pre:
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 5
Line PC Opcode
0202 ; Post:
0203 0012 05B2 bsf genflag, LEDON
0204 0013 0465 bcf port_a, led
0205 0014 0800 retlw 0
0206 ;
0207 ChangeState
0208 ; Level 2 routine
0209 ; routine to change the state of the led. this is only e
ntered if the
0210 ; min_sec timer has reached zero.
0211 ;
0212 ; Pre:
0213 ; POst:
0214 ;
0215 ; reset value for blinks the led ever 2 secs
0216 0015 0C01 movlw D'01' ; 2 secs
0217 0016 0037 movwf min_sec
0218 ; check the led status on/off?
0219 0017 0212 movf genflag, w
0220 0018 0E20 andlw B'00100000'
0221 0019 0643 btfsc status, z ; if ledon is on
0222 001A 0A12 goto on ; turn it on
0223 001B 0565 bsf port_a, led ; turn it off
0224 001C 04B2 bcf genflag, ledon
0225 001D 0800 retlw 0
0226
0227
0228
0229 ;********************************************************
****************;
0230 ; This routine set up ports A, B, C and the internal
0231 ; real time clock counter.
0232 ; Level 1 routine
0233 ; Pre:
0234 ; Post: Timers have been setup.
0235 ; Ports have been setup
0236 ; The prescaler is set
0237 ;
0238 initialise
0239 001E 0064 clrf FSR
0240 001F 0C0F movlw B'00001111' ; make active high
0241 0020 0025 movwf port_a
0242 0021 0C00 movlw B'00000000' ; set port A as outputs
0243 0022 0005 tris port_a
0244 ;
0245 0023 0CFF movlw B'11111111' ; set levels high
0246 0024 0026 movwf port_b
0247 0025 0C00 movlw B'00000000' ; set portB as output
0248 0026 0006 tris port_b
0249 ;
0250 0027 0C00 movlw B'00000000' ; set levels low
0251 0028 0027 movwf port_c
0252 0029 0C00 movlw B'00000000' ; set port C as output
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 6
Line PC Opcode
0253 002A 0007 tris port_c
0254 ;
0255 ; OPTION REG setup
0256 ; bits 7,6,5,4,3,2,1,0
0257 ; 6,7 not avail
0258 ; 5 rt source o = int, 1, edge on rtcc pin
0259 ; 4 rtcc edge l->H '0', H-->L '1'
0260 ; 3 prescaler assignment 0 rtcc, 1 wdt
0261 ; 1,2,3 ratio of prescaler '100' = 1:32
0262 ; 000 -> scale 1:2
0263 ; 111 -> scale 1:256
0264 ; NB if scale used for wdt, then ratio is 1/2 of the rtcc
scale
0265 ; movlw B'00000100' ; set up prescaler (1:32
)
0266 002B 0C00 movlw B'00000000' ; for testing
0267 002C 0002 option
0268 ;
0269 002D 0C01 movlw MTICKS ; rtcc = 5msecs
0270 ; init the rtcc with a value MTICKS, so that when it time
s out it is
0271 ; almost exactly 5msecs.
0272 002E 0021 movwf rtcc
0273 002F 0068 clrf mstmr
0274 0030 0069 clrf stmr
0275 0031 006A clrf mtmr
0276 0032 0C12 movlw 12H ; make hours = 12
0277 0033 002B movwf htmr
0278 0034 0072 clrf genFlag
0279 0035 05A3 bsf status, PA0
0280 0036 0940 call initTmr
Warning: [Warning 4] : line 280 : Address change across page boundary, ensure page bits are set
0303 ;
0304 ; This routine is called on every loop.
0305 update_timers
0306 ;
0307 ; Pre:
0308 ; Post: returns 1 in W if a 1 second interval has past
0309
0310 0200 0004 clrwdt
0311 timerLoop
0312 ; the timer loop is currently set to time out every 5ms.
NB it must be
0313 ; less than 18 ms or the watchdog may time out.
0314 0201 0000 nop ; allow time for rtcc = 0
to be available
0315 0202 0201 movf rtcc, w ; is rtcc =0
0316 0203 0743 btfss status, z ; if 0 then skip
0317 0204 0A01 goto timerLoop ; else loop
0318 ; setup real time counter again to count out the
next 5ms
0319 0205 0C01 movlw MTICKS ; rtcc = 5ms or 4ms
0320 0206 0021 movwf rtcc
0321 0207 02A8 incf mstmr ; inc 5 ms
0322 ; btfsc genFlag, key_hit ; no key hit, then sk
ip
0323 ; goto chk_de_bounce ; else debounce
0324 ;
0325 ; check to see if a second has rolled around. IE 200 x 5m
s = 1 sec
0326 ; or 250 x 4ms = 1sec
0327 0208 0208 movf mstmr, 0 ; get mstmr in W
0328 0209 0F01 xorlw NumRollOver ; if enough to equal 1 se
c then skip
0329 020A 0743 btfss status, z
0330 020B 0800 retlw 0 ; return as not a second
interval
0331 ;
0332 ; inc seconds count
0333 020C 0068 clrf MSTMR ; CLEAR ms-TMR
0334 020D 0217 movf min_sec, w ; get min_sec timer
0335 020E 0E0F andlw B'00001111' ; mask minutes
0336 020F 0743 btfss status, z ; zero then skip
0337 0210 00F7 decf min_sec
0338 0211 0C09 movlw stmr ; load fsr with s_tmr
0339 0212 0024 movwf fsr
0340 0213 0926 call inc_60 ; inc secs
0341 0214 0D00 iorlw 0 ;
0342 0215 0743 btfss status, z ;
0343 0216 0801 retlw 1 ; only a sec passed
0344 ;
0345 ; inc minutes count
0346 0217 03B7 swapf min_sec
0347 0218 0217 movf min_sec, w ; get min_sec in w
0348 0219 0E0F andlw B'00001111' ; mask seconds
0349 021A 0743 btfss status, z ; skip is not set
0350 021B 00F7 decf min_sec ; else dec
0351 021C 03B7 swapf min_sec ; swap back
0352 ; call chk_silnc_tim ; silence on?
0353 021D 0C0A movlw mtmr ; inc mins
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 8
Line PC Opcode
0354 021E 0024 movwf fsr ;
0355 021F 0926 call inc_60
0356 0220 0D00 iorlw 0 ; do an operation
0357 0221 0743 btfss status, z ; if 0 then skip
0358 0222 0801 retlw 1 ;
0359 ;
0360 ;inc hour count
0361 ; Level ?
0362 ; Increment the hour count.
0363 0223 0C0B movlw htmr ; get htmr in fsr
0364 0224 0024 movwf fsr
0365 0225 0937 call inc_hr
0366 ;
0367 inc_60
0368 ; inc the register pointed to by the FSR modulo 60. NB B
CD is used.
0369 ; Pre: The Fsr is a timer register that is desired to be
incremented by 1
0370 ; modulo 60.
0371 ; Post: inc has occurred. If the result is 1 a inc was n
ormal. If the
0372 ; result is 0, then the tmr overflowed (=60)
0373 0226 02A0 incf f0 ; inc and get in w
0374 0227 0200 movf f0, 0
0375 0228 0E0F andlw B'00001111' ; mask high bits
0376 0229 0F0A xorlw B'00001010' ; = 10 them make it 0
0377 022A 0743 btfss status, z
0378 ; normal condition, return 1 (okay), unit digit i
ncremented
0379 022B 0801 retlw 1 ; else ret non zero
0380 022C 0CF0 movlw B'11110000' ; zero lsb
0381 022D 0160 andwf f0
0382 022E 03A0 swapf f0 ; swap indirect
0383 022F 02A0 incf f0
0384 0230 0200 movf f0,0 ; get in w
0385 0231 03A0 swapf f0 ; swap f0 back
0386 0232 0F06 xorlw D'6'
0387 0233 0743 btfss status,z
0388 ; normal condition, return 1, tens digit incremen
ted
0389 0234 0801 retlw 1
0390 ; mod 60 overflow, return 0.
0391 0235 0060 clrf f0
0392 0236 0800 retlw 0
0393 ;
0394 inc_hr
0395 ; FSR is pointing to the timer.
0396 ; i don't think that the hour timer is BCD.
0397 ; pre:
0398 ; post:
0399 0237 02A0 incf f0 ; inc hour timer
0400 0238 0200 movf f0, w
0401 ;
0402 chk_13
0403 0239 0200 movf f0, w ; get in w
0404 023A 0F12 xorlw 12h ; see if 13
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 9
Line PC Opcode
0405 023B 0743 btfss status, z ; yes then skip
0406 023C 0000 nop
0407 023D 0801 retlw 1 ; flags that a second int
erval has past
0408 ;
0409 set_1_hr
0410 023E 0C01 movlw B'00000001' ; SET TO 1
0411 023F 0020 MOVWF f0
0412
0413 ; The general purpose timers are not affected if their va
lue is zero.
0414 ;
0415 InitTmr
0416 ; Initialise timers
0417 ; Timers can run for 255 minutes or over 4 hours.
0418 ; Procedure to initialise the general purpose timers syst
em. This will be
0419 ; by constants in the first place, but later from the NV
RAM.
0420 ; Pre: Data page is 0
0421 ; Post: Data page is 0
0422 ; Initialise the backup of the timer values. (this will
eventually
0423 ; come from the NVRAM)
0424 ;
0425 ; Set all timers to zero in the first instance.
0426 ;
0427 ; set data page to 1
0428 0240 05A4 bsf FSR, dataP1
0429 0241 006E clrf timeFlag
0430 ; move in address of first timer and then increment
the addr, clearing
0431 ; each timer as we step through the timers. Curren
tly this is the
0432 ; first 8 bytes of data page 1
0433 0242 0C30 movlw stmr1
0434 ClrLoop
0435 0243 0024 movwf fsr
0436 0244 05A4 bsf FSR, dataP1 ; maintain data page
0437 0245 0060 clrf f0 ; clears seconds part
of timer
0438 0246 02A4 incf fsr, same ; inc so to clear minu
tes part
0439 0247 0060 clrf f0 ; clears mins part
0440 ; test to see all timers are clear
0441 0248 0204 movf fsr, W
0442 0249 0F37 xorlw mtmr4
0443 024A 0E0F andlw b'00001111' ; ensure high nibble i
s clear
0444 024B 0743 btfss STATUS, Z ; = --> skip
0445 024C 0A43 goto ClrLoop
0446
0447 ; install some setup values
0448 024D 0C10 movlw 10
0449 024E 0038 movwf stmr1Val
0450
0451 024F 0C01 movlw 1
0452 0250 003A movwf stmr2Val
0453 0251 003C movwf stmr3Val
0454 0252 003E movwf stmr4Val
0455 0253 003B movwf mtmr2Val
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 10
Line PC Opcode
0456 0254 0C02 movlw 2
0457 0255 003D movwf mtmr3Val
0458 0256 0C10 movlw 10
0459 0257 003F movwf mtmr4Val
0460 ; reset data page to 0
0461 0258 04A4 bcf FSR, DataP1
0462 0259 0800 retlw 0
0463
0464 SetTimer
0465 ; This procedure sets the timer to it's backup value
0466 ;
0467 ; Pre: W is the timer (the address of the seconds part o
f the tmr)
0468 ; Data Page is 0
0469 ; Post: The timer is set to the corresponding timer setu
p values
0470 ; Data page is 0
0471
0472 ; the offset to the setup values is currently 8 bytes hig
her than the
0473 ; timer variable locations
0474
0475 ; set to the timer data page
0476 025A 05A4 bsf FSR, dataP1
0477
0478 ; firstly transfer the seconds values
0479 ; calculate timer using the offset in W
0480 025B 002C movwf temp ; Save timer address
0481 025C 0C08 movlw OFFSET
0482 025D 01CC addwf temp, w ; calculate reg of the i
nitial value
0483 025E 0024 movwf FSR ; save this address in F
SR
0484 025F 05A4 bsf FSR, dataP1 ; maintain data page
0485 ; get timer (secs) value
0486 0260 0200 movf f0, W ; get setup value
0487 0261 002D movwf tmp2 ; save value, then get b
ack timer address
0488 0262 020C movf temp, W ; get timer address agai
n
0489 0263 0024 movwf fsr
0490 0264 05A4 bsf FSR, dataP1 ; maintain data page
0491 0265 020D movf tmp2, W
0492 0266 0020 movwf f0
0493
0494 ; Now transfer the minutes value
0495 0267 0C09 movlw OFFSET+1
0496 0268 01CC addwf temp, w ; calculate reg of the i
nitial value
0497 0269 0024 movwf FSR ; save this address in F
SR
0498 026A 05A4 bsf FSR, dataP1 ; maintain data page
0499
0500 ; get timer (mins) value
0501 026B 0200 movf f0, W
0502 026C 002D movwf tmp2 ; save value, then get b
ack timer address
0503 026D 02AC incf temp, same
0504 026E 020C movf temp, W
0505 026F 0024 movwf fsr
0506 0270 05A4 bsf FSR, dataP1
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 11
Line PC Opcode
0507 0271 020D movf tmp2, W
0508 0272 0020 movwf f0
0509 0273 04A4 bcf FSR, dataP1 ; reset data page pointe
r
0510 0274 0800 retlw 0 ; ???
0511
0512
0513
0514 ServTmr
0515 ; Services the timers, decrementing the active timers
0516 ; Pre: Must called from main loop, as there are calls in
this routine
0517 ; Data Page is 0
0518 ; Post: Data Page is 0
0519
0520 ; testing
0521 ; bcf port_a, 2
0522 ; set to data page 1
0523 0275 05A4 bsf FSR, dataP1
0524
0525 ; get timer address in working register
0526 0276 0C30 movlw stmr1
0527
0528 ; check to see timer active
0529 0277 060E btfsc timeFlag, timer1
0530 ; if it is decrement it
0531 0278 0990 call timerDec
0532
0533 ; if the value returned in w is 1, then the timer i
s finished
0534 ; so set it's flag
0535 0279 0F01 xorlw d'1'
0536 027A 0643 btfsc status, z ;
0537 027B 058E bsf timeFlag, tmr1end ;
0538
0539 027C 0C32 movlw stmr2
0540 027D 062E btfsc timeFlag, timer2
0541 027E 0990 call timerDec
0542 ; if the value returned in w is 1, then the timer i
s finished
0543 ; so set it's flag
0544 027F 0F01 xorlw d'1'
0545 0280 0643 btfsc status, z ;
0546 0281 05AE bsf timeFlag, tmr2end ;
0547
0548 0282 0C34 movlw stmr3
0549 0283 064E btfsc timeFlag, timer3
0550 0284 0990 call timerDec
0551 ; if the value returned in w is 1, then the timer i
s finished
0552 ; so set it's flag
0553 0285 0F01 xorlw d'1'
0554 0286 0643 btfsc status, z ;
0555 0287 05CE bsf timeFlag, tmr3end ;
0556
0557 0288 0C36 movlw stmr4
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 12
Line PC Opcode
0558 0289 066E btfsc timeFlag, timer4
0559 028A 0990 call timerDec
0560 ; if the value returned in w is 1, then the timer i
s finished
0561 ; so set it's flag
0562 028B 0F01 xorlw d'1'
0563 028C 0643 btfsc status, z ;
0564 028D 05EE bsf timeFlag, tmr4end ;
0565
0566 028E 04A4 bcf FSR, dataP1
0567 028F 0800 retlw 0
0568
0569
0570 timerDec
0571 ; Pre: W = stmr1 | stmr2 | stmr3 | stmr4 (addresses)
0572 ; the seconds are never 0, either counting down, or
0573 ; reset to 60
0574 ; post:
0575 ;
0576 ; testing
0577 ; bcf port_a, 2
0578
0579 0290 0024 movwf fsr
0580 0291 05A4 bsf FSR, dataP1 ; ensure that data pag
e remains ok
0581 0292 00E0 decf f0, same ; dec seconds, then
0582
0583 ; *******************************************************
*****************
0584 ; *******************************************************
*****************
0585 ; This is where I have found the timer not to progress.
It will light the
0586 ; LED on port A if the Xorlw is for 3 or 4 as it counts d
own, but it never
0587 ; gets to the stage where comparsion (via XOR) with 1 or
2, lights the LED.
0588 ; I take this to mean that, it never gets to the value of
1 or 2.
0589
0590 ; movf f0, w
0591 ; xorlw 4
0592 ; btfsc status, z
0593 ; bcf Port_A, 1
0594 ; xorlw 3
0595 ; btfsc status, z
0596 ; bcf Port_A, 0
0597 ; xorlw 2
0598 ; btfsc status, z
0599 ; bcf Port_A, 2
0600
0601 0293 0743 btfss status, z ; if zero dec minutes
0602 0294 0800 retlw 0
0603
0604 ZeroSecs
0605 ; The seconds have zeroed, so if no mins left end, else d
ec mins
0606 ; and set seconds to 60
0607 ; Pre: FSR is the ADDR of the seconds part of the timer
0608 ; Data page is 1
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 13
Line PC Opcode
0609 ; Post: Data page is 1
0610 ; retlw 1 if the timer is finished
0611
0612 ; testing
0613 0295 0405 bcf Port_a, 0
0614 0296 02A4 incf FSR, same ; so to move to mins
part
0615 0297 0200 movf f0, w
0616 0298 0EFF andlw B'11111111' ; test for zero
0617 0299 0743 btfss status, z ; skip if 0
0618 029A 0A9E goto decNow ; else dec the minut
es now
0619
0620 ; testing
0621 029B 0445 bcf Port_A, 2
0622 029C 04A4 bcf FSR, dataP1
0623 029D 0801 retlw 1 ; return from timerD
ec, noting
0624 ; that the tmr is fi
nished
0625
0626 decNow
0627 ; Pre: accessed by a goto from ZeroSecs
0628 ; Post:
0629 029E 00E0 decf f0, same ; dec minutes
0630 029F 00E4 decf FSR, same ; access seconds add
ress
0631 02A0 0C60 movlw 60
0632 02A1 0020 movwf f0 ; set seconds
0633
0634 ;testing
0635 02A2 0425 bcf Port_a, 1
0636 02A3 04A4 bcf FSR, dataP1 ;
0637 02A4 0800 retlw 0 ; return from timerD
ec
0638
0639
0640
0641 TmrAct
0642 ; Take initial action if a timer is finished.
0643 ; Pre: The finshed flag for the timer is set
0644 ; Post: The finshed flag is cleared
0645 ; testing
0646 ; bcf port_a, 2
0647
0648 02A5 068E init1 btfsc timeFlag, tmr1end
0649 02A6 0AAE goto TmrAct1
0650 02A7 06AE init2 btfsc timeFlag, tmr2end
0651 02A8 0AB5 goto TmrAct2
0652 02A9 06CE init3 btfsc timeFlag, tmr3end
0653 02AA 0ABD goto TmrAct3
0654 02AB 06EE init4 btfsc timeFlag, tmr4end
0655 02AC 0AC5 goto TmrAct4
0656 02AD 0800 retlw 0 ; return from T
mrAct routine
0657 ;
0658 02AE 048E TmrAct1 bcf timeFlag, tmr1end ; clear the end
ed flag
0659 02AF 040E bcf timeFlag, timer1 ; stop timer de
crementing
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 14
Line PC Opcode
0660 ; testing
0661 ; bcf Port_A, 2
0662 02B0 0C32 movlw stmr2
0663 02B1 095A call setTimer
0664 02B2 052E bsf timeFlag, timer2 ; activate time
r2
0665 02B3 0405 bcf port_A, 0
0666 02B4 0AA7 goto init2
0667 02B5 04AE TmrAct2 bcf timeFlag, tmr2end ; clear the end
ed flag
0668 02B6 042E bcf timeFlag, timer2 ; stop timer de
crementing
0669 02B7 0C34 movlw stmr3
0670 02B8 095A call setTimer
0671 02B9 054E bsf timeFlag, timer3 ; activate time
r3
0672 02BA 0505 bsf Port_A, 0 ; turn off prev
ious led
0673 02BB 0425 bcf Port_A, 1 ; turn on led
0674 02BC 0AA9 goto init3
0675 02BD 04CE TmrAct3 bcf timeFlag, tmr3end ; clear the end
ed flag
0676 02BE 044E bcf timeFlag, timer3 ; stop timer de
crementing
0677 02BF 0C36 movlw stmr4
0678 02C0 095A call setTimer
0679 02C1 056E bsf timeFlag, timer4 ; activate time
r4
0680 02C2 0525 bsf Port_A, 1 ; turn off prev
ious led
0681 02C3 0445 bcf Port_A, 2 ; turn on led
0682 02C4 0AAB goto init4
0683 02C5 04EE TmrAct4 bcf timeFlag, tmr4end ; clear the end
ed flag
0684 02C6 046E bcf timeFlag, timer4 ; stop timer de
crementing
0685 02C7 0545 bsf Port_A, 2 ; turn off prev
ious led
0686 02C8 0465 bcf Port_A, 3
0687 02C9 05A3 bsf status, PA0
0688 02CA 05C3 bsf status, PA1
0689 02CB 0BFF goto sys_reset
Warning: [Warning 5] : line 689 : Address change across page boundary, ensure page bits are set
0690 02CC 0800 retlw 0 ; return from T
mrAct routine
0691
0692 ;
0693 ;
0694 ; *******************************************************
*******************
0695 0000 org PIC57
0696 sys_reset
0697 07FF 0A00 goto start
Warning: [Warning 6] : line 697 : Address change across page boundary, ensure page bits are set
0698 ;
0699 0000 end
16c5x/xx Cross-Assembler V4.14 Released Sun Jul 31 15:05:04 1994 Page 15
------------------------------------------------------------------------
and the asm file
; TST2.asm May 1, 1994
; modified to test PIC out and do demos. extra comments added
; Insert BCD timers and test
; Original code from the Applications notes from Microchip.
;
; Gary Gaskell mods for count down timers.
;
LIST P= 16C57
;
; Coding policy:
; A routine is a section of code. This defintion may be refined to two types
; of routines. The first is a PROCEDURE. Procedures may be called
; using the stack of the PIC. The second is a "CODE SEQUENCE". This
; type of routine may not be called, only jumped/branched to. The
; intention is to limit the likelihood to too many calls resulting in
; an overflow on the stack.
; Level 0 This code is Base code (stack is empty)
; Level 1 Called from base code, may call another routine. (stack=1)
; Displine and quality code requires that a return is
; executed.
; Level 2 Called from base or Level 1 code. The stack is now full
; so no calls are allowed. branching only, but a return
; is essential to unwind the stack.
; CONSTANTS will be in UPPERCASE, with variables in lowercase.
;
;
; define equates:
;
PIC57 equ 7FFH
;
; external osc used = 4.096mHz. prescaler of 32 used, which gives a
; 31.25 microsec inc of the RTCC. If the rtcc is initially loaded with 96
; it would overflow to 0 in 5.00ms. giving 0.00% error
; If the crystal is 4.000 Mhz (prototype Xtal), NB 4Mhz xtal gives 1 Mhz
; internal clock. then overflow at 32usec,
; requiring 156.25 rtcc cycles, ie msecs should be 100, but an error needs
; to be corrected. , Easier option is to decrease interval to 4 ms and to
; alter the constant for the seconds to 250 (249 actually). NB gives
; 4000 instructions before the RTCC overflow must be caught.
;
; MTICKS EQU d'96' ; for 4.096 Mhz xtal
; MTICKS EQU d'100' ; for 4.000Mhz xtal
; MTICKS equ d'131' ; for 4.000MHz xtal and 4msec overflow
MTICKS equ d'1' ; for testing
; Number of rttc timeouts to equal one second.
; NumRollover equ d'199'
; NumRollOver equ d'249'
NumRollover equ d'1' ; for testing
;
; needs fixing to right value
key_hit equ 0
same equ 1 ; register operation source=dest
C EQU 0
BEP EQU 0
RTATS EQU 0
DC EQU 1
HR10 EQU 1
Z EQU 2
HR EQU 2
MIN EQU 4
FLASH EQU 4
PA0 EQU 5
PA1 EQU 6
F0 EQU 0
LEDon EQU 5 ; is set if the LED is on. bit 5 of alflag
led equ 3 ; bit of portA for the led.
dataP1 equ 5 ; bit 5 of FSR (sets from DP0 to dataPg 1)
;
; Constants for timers etc
; these are set if the timer is active
timer1 equ 0 ; bit numbers for flag "timeFlag"
timer2 equ 1
timer3 equ 2
timer4 equ 3
; these are set if the timer has finished and awaits action
tmr1end equ 4
tmr2end equ 5
tmr3end equ 6
tmr4end equ 7
; This is the number of bytes that separate the timer, from
; a copy of its setup values
OFFSET equ 8
MIN_SEC EQU 17 ; MIN/seconds timer
;
; PORT pin definitions
;
; Port A: s
; bit0 led to flash
; bit 1-3 unsed i/o
;
; define the RAM locations of DATA PAGE 1 (timers)
; NB to use these RAM locations (variables) the correct bits of the
; FSR must be set (5&6).
; setup 5 timers. Each will store BCD time values and be decremented to-
; wards zero. NB if these timers are moved the code that works on that
; must be updated.
;
; Timers placed in Data Page 1
stmr1 equ 30
mtmr1 equ 31
stmr2 equ 32
mtmr2 equ 33
stmr3 equ 34
mtmr3 equ 35
stmr4 equ 36
mtmr4 equ 37
stmr1Val equ 38
mtmr1Val equ 39
stmr2Val equ 3A
mtmr2Val equ 3B
stmr3Val equ 3C
mtmr3Val equ 3D
stmr4Val equ 3E
mtmr4Val equ 3F
;
;
;
; ****************************************************************************
org 0
START
goto initialise
; this routine runs a test on the leds
; all the relevent leds are lit up for 2 secs.
;
test_hardware
movlw D'1' ; flash every two for 2 secs
movwf min_sec
;
;
norm_time
bcf genFlag, 0 ; put in real time
bcf genFlag, 1
;
time_loop
; call update_display
; bsf status, PA1 ; goto page 2
; call service_keys
bsf status, PA0 ; goto page 1
call update_timers ; wait and update timers (Realtime)
bcf status, PA0
iorlw 0 ;
btfss status, Z ;
goto GPtime ;
; movf genFlag, w ; see if in atm
; andlw B'00000011'
; xorlw B'00000001'
; btfsc status, z ; skip if not
retrn
goto time_loop
GPtime
; code sequence to call general purpose timers
; Pre: only called after a second interval has past
bsf status, PA0 ; goto page 1
call servTmr ; service the gen purpose timers
call TmrAct
bcf status, PA0 ; reset page flags
call ChangeState
goto retrn
on
; Level 2 routine.
; set led on, by setting it low, set in flag and at port.
; Pre:
; Post:
bsf genflag, LEDON
bcf port_a, led
retlw 0
;
ChangeState
; Level 2 routine
; routine to change the state of the led. this is only entered if the
; min_sec timer has reached zero.
;
; Pre:
; POst:
;
; reset value for blinks the led ever 2 secs
movlw D'01' ; 2 secs
movwf min_sec
; check the led status on/off?
movf genflag, w
andlw B'00100000'
btfsc status, z ; if ledon is on
goto on ; turn it on
bsf port_a, led ; turn it off
bcf genflag, ledon
retlw 0
;************************************************************************;
; This routine set up ports A, B, C and the internal
; real time clock counter.
; Level 1 routine
; Pre:
; Post: Timers have been setup.
; Ports have been setup
; The prescaler is set
;
initialise
clrf FSR
movlw B'00001111' ; make active high
movwf port_a
movlw B'00000000' ; set port A as outputs
tris port_a
;
movlw B'11111111' ; set levels high
movwf port_b
movlw B'00000000' ; set portB as output
tris port_b
;
movlw B'00000000' ; set levels low
movwf port_c
movlw B'00000000' ; set port C as output
tris port_c
;
; OPTION REG setup
; bits 7,6,5,4,3,2,1,0
; 6,7 not avail
; 5 rt source o = int, 1, edge on rtcc pin
; 4 rtcc edge l->H '0', H-->L '1'
; 3 prescaler assignment 0 rtcc, 1 wdt
; 1,2,3 ratio of prescaler '100' = 1:32
; 000 -> scale 1:2
; 111 -> scale 1:256
; NB if scale used for wdt, then ratio is 1/2 of the rtcc scale
; movlw B'00000100' ; set up prescaler (1:32)
movlw B'00000000' ; for testing
option
;
movlw MTICKS ; rtcc = 5msecs
; init the rtcc with a value MTICKS, so that when it times out it is
; almost exactly 5msecs.
movwf rtcc
clrf mstmr
clrf stmr
clrf mtmr
movlw 12H ; make hours = 12
movwf htmr
clrf genFlag
bsf status, PA0
call initTmr
movlw stmr1 ; set W = timer1
; call setTimer
; testing
movlw 5
bsf fsr, DataP1
movwf stmr1
bcf fsr, DataP1
bsf timeFlag, timer1 ; activate timer
bcf status, PA0
goto test_hardware
;
;
; *************************************************************************
;
; TIMER MODULE
;
; *************************************************************************
; All routines related to timer update are located at address
; 200 and above.
;
org 200
;
; This routine is called on every loop.
update_timers
;
; Pre:
; Post: returns 1 in W if a 1 second interval has past
clrwdt
timerLoop
; the timer loop is currently set to time out every 5ms. NB it must be
; less than 18 ms or the watchdog may time out.
nop ; allow time for rtcc = 0 to be available
movf rtcc, w ; is rtcc =0
btfss status, z ; if 0 then skip
goto timerLoop ; else loop
; setup real time counter again to count out the next 5ms
movlw MTICKS ; rtcc = 5ms or 4ms
movwf rtcc
incf mstmr ; inc 5 ms
; btfsc genFlag, key_hit ; no key hit, then skip
; goto chk_de_bounce ; else debounce
;
; check to see if a second has rolled around. IE 200 x 5ms = 1 sec
; or 250 x 4ms = 1sec
movf mstmr, 0 ; get mstmr in W
xorlw NumRollOver ; if enough to equal 1 sec then skip
btfss status, z
retlw 0 ; return as not a second interval
;
; inc seconds count
clrf MSTMR ; CLEAR ms-TMR
movf min_sec, w ; get min_sec timer
andlw B'00001111' ; mask minutes
btfss status, z ; zero then skip
decf min_sec
movlw stmr ; load fsr with s_tmr
movwf fsr
call inc_60 ; inc secs
iorlw 0 ;
btfss status, z ;
retlw 1 ; only a sec passed
;
; inc minutes count
swapf min_sec
movf min_sec, w ; get min_sec in w
andlw B'00001111' ; mask seconds
btfss status, z ; skip is not set
decf min_sec ; else dec
swapf min_sec ; swap back
; call chk_silnc_tim ; silence on?
movlw mtmr ; inc mins
movwf fsr ;
call inc_60
iorlw 0 ; do an operation
btfss status, z ; if 0 then skip
retlw 1 ;
;
;inc hour count
; Level ?
; Increment the hour count.
movlw htmr ; get htmr in fsr
movwf fsr
call inc_hr
;
inc_60
; inc the register pointed to by the FSR modulo 60. NB BCD is used.
; Pre: The Fsr is a timer register that is desired to be incremented by 1
; modulo 60.
; Post: inc has occurred. If the result is 1 a inc was normal. If the
; result is 0, then the tmr overflowed (=60)
incf f0 ; inc and get in w
movf f0, 0
andlw B'00001111' ; mask high bits
xorlw B'00001010' ; = 10 them make it 0
btfss status, z
; normal condition, return 1 (okay), unit digit incremented
retlw 1 ; else ret non zero
movlw B'11110000' ; zero lsb
andwf f0
swapf f0 ; swap indirect
incf f0
movf f0,0 ; get in w
swapf f0 ; swap f0 back
xorlw D'6'
btfss status,z
; normal condition, return 1, tens digit incremented
retlw 1
; mod 60 overflow, return 0.
clrf f0
retlw 0
;
inc_hr
; FSR is pointing to the timer.
; i don't think that the hour timer is BCD.
; pre:
; post:
incf f0 ; inc hour timer
movf f0, w
;
chk_13
movf f0, w ; get in w
xorlw 12h ; see if 13
btfss status, z ; yes then skip
nop
retlw 1 ; flags that a second interval has past
;
set_1_hr
movlw B'00000001' ; SET TO 1
MOVWF f0
; The general purpose timers are not affected if their value is zero.
;
InitTmr
; Initialise timers
; Timers can run for 255 minutes or over 4 hours.
; Procedure to initialise the general purpose timers system. This will be
; by constants in the first place, but later from the NV RAM.
; Pre: Data page is 0
; Post: Data page is 0
; Initialise the backup of the timer values. (this will eventually
; come from the NVRAM)
;
; Set all timers to zero in the first instance.
;
; set data page to 1
bsf FSR, dataP1
clrf timeFlag
; move in address of first timer and then increment the addr, clearing
; each timer as we step through the timers. Currently this is the
; first 8 bytes of data page 1
movlw stmr1
ClrLoop
movwf fsr
bsf FSR, dataP1 ; maintain data page
clrf f0 ; clears seconds part of timer
incf fsr, same ; inc so to clear minutes part
clrf f0 ; clears mins part
; test to see all timers are clear
movf fsr, W
xorlw mtmr4
andlw b'00001111' ; ensure high nibble is clear
btfss STATUS, Z ; = --> skip
goto ClrLoop
; install some setup values
movlw 10
movwf stmr1Val
SetTimer
; This procedure sets the timer to it's backup value
;
; Pre: W is the timer (the address of the seconds part of the tmr)
; Data Page is 0
; Post: The timer is set to the corresponding timer setup values
; Data page is 0
; the offset to the setup values is currently 8 bytes higher than the
; timer variable locations
; set to the timer data page
bsf FSR, dataP1
; firstly transfer the seconds values
; calculate timer using the offset in W
movwf temp ; Save timer address
movlw OFFSET
addwf temp, w ; calculate reg of the initial value
movwf FSR ; save this address in FSR
bsf FSR, dataP1 ; maintain data page
; get timer (secs) value
movf f0, W ; get setup value
movwf tmp2 ; save value, then get back timer address
movf temp, W ; get timer address again
movwf fsr
bsf FSR, dataP1 ; maintain data page
movf tmp2, W
movwf f0
; Now transfer the minutes value
movlw OFFSET+1
addwf temp, w ; calculate reg of the initial value
movwf FSR ; save this address in FSR
bsf FSR, dataP1 ; maintain data page
; get timer (mins) value
movf f0, W
movwf tmp2 ; save value, then get back timer address
incf temp, same
movf temp, W
movwf fsr
bsf FSR, dataP1
movf tmp2, W
movwf f0
bcf FSR, dataP1 ; reset data page pointer
retlw 0 ; ???
ServTmr
; Services the timers, decrementing the active timers
; Pre: Must called from main loop, as there are calls in this routine
; Data Page is 0
; Post: Data Page is 0
; testing
; bcf port_a, 2
; set to data page 1
bsf FSR, dataP1
; get timer address in working register
movlw stmr1
; check to see timer active
btfsc timeFlag, timer1
; if it is decrement it
call timerDec
; if the value returned in w is 1, then the timer is finished
; so set it's flag
xorlw d'1'
btfsc status, z ;
bsf timeFlag, tmr1end ;
movlw stmr2
btfsc timeFlag, timer2
call timerDec
; if the value returned in w is 1, then the timer is finished
; so set it's flag
xorlw d'1'
btfsc status, z ;
bsf timeFlag, tmr2end ;
movlw stmr3
btfsc timeFlag, timer3
call timerDec
; if the value returned in w is 1, then the timer is finished
; so set it's flag
xorlw d'1'
btfsc status, z ;
bsf timeFlag, tmr3end ;
movlw stmr4
btfsc timeFlag, timer4
call timerDec
; if the value returned in w is 1, then the timer is finished
; so set it's flag
xorlw d'1'
btfsc status, z ;
bsf timeFlag, tmr4end ;
bcf FSR, dataP1
retlw 0
timerDec
; Pre: W = stmr1 | stmr2 | stmr3 | stmr4 (addresses)
; the seconds are never 0, either counting down, or
; reset to 60
; post:
;
; testing
; bcf port_a, 2
movwf fsr
bsf FSR, dataP1 ; ensure that data page remains ok
decf f0, same ; dec seconds, then
; ************************************************************************
; ************************************************************************
; This is where I have found the timer not to progress. It will light the
; LED on port A if the Xorlw is for 3 or 4 as it counts down, but it never
; gets to the stage where comparsion (via XOR) with 1 or 2, lights the LED.
; I take this to mean that, it never gets to the value of 1 or 2.
; movf f0, w
; xorlw 4
; btfsc status, z
; bcf Port_A, 1
; xorlw 3
; btfsc status, z
; bcf Port_A, 0
; xorlw 2
; btfsc status, z
; bcf Port_A, 2
btfss status, z ; if zero dec minutes
retlw 0
ZeroSecs
; The seconds have zeroed, so if no mins left end, else dec mins
; and set seconds to 60
; Pre: FSR is the ADDR of the seconds part of the timer
; Data page is 1
; Post: Data page is 1
; retlw 1 if the timer is finished
; testing
bcf Port_a, 0
incf FSR, same ; so to move to mins part
movf f0, w
andlw B'11111111' ; test for zero
btfss status, z ; skip if 0
goto decNow ; else dec the minutes now
; testing
bcf Port_A, 2
bcf FSR, dataP1
retlw 1 ; return from timerDec, noting
; that the tmr is finished
decNow
; Pre: accessed by a goto from ZeroSecs
; Post:
decf f0, same ; dec minutes
decf FSR, same ; access seconds address
movlw 60
movwf f0 ; set seconds
TmrAct
; Take initial action if a timer is finished.
; Pre: The finshed flag for the timer is set
; Post: The finshed flag is cleared
; testing
; bcf port_a, 2
init1 btfsc timeFlag, tmr1end
goto TmrAct1
init2 btfsc timeFlag, tmr2end
goto TmrAct2
init3 btfsc timeFlag, tmr3end
goto TmrAct3
init4 btfsc timeFlag, tmr4end
goto TmrAct4
retlw 0 ; return from TmrAct routine
;
TmrAct1 bcf timeFlag, tmr1end ; clear the ended flag
bcf timeFlag, timer1 ; stop timer decrementing
; testing
; bcf Port_A, 2
movlw stmr2
call setTimer
bsf timeFlag, timer2 ; activate timer2
bcf port_A, 0
goto init2
TmrAct2 bcf timeFlag, tmr2end ; clear the ended flag
bcf timeFlag, timer2 ; stop timer decrementing
movlw stmr3
call setTimer
bsf timeFlag, timer3 ; activate timer3
bsf Port_A, 0 ; turn off previous led
bcf Port_A, 1 ; turn on led
goto init3
TmrAct3 bcf timeFlag, tmr3end ; clear the ended flag
bcf timeFlag, timer3 ; stop timer decrementing
movlw stmr4
call setTimer
bsf timeFlag, timer4 ; activate timer4
bsf Port_A, 1 ; turn off previous led
bcf Port_A, 2 ; turn on led
goto init4
TmrAct4 bcf timeFlag, tmr4end ; clear the ended flag
bcf timeFlag, timer4 ; stop timer decrementing
bsf Port_A, 2 ; turn off previous led
bcf Port_A, 3
bsf status, PA0
bsf status, PA1
goto sys_reset
retlw 0 ; return from TmrAct routine
I didn't read all of your code & have not used the 57 ( I am using the '71)
but I did check the '57 op-codes. A movf RTCC to W will set the Z flag but
will also clear the prescaler. Could this tie in with your troubles, or have
you allowed for it?
There may be more to it that this, but a quick look shows that you are
moving RTCC into W and then expecting the Z bit in the status register
to indicate the zero or nonzero status of the RTCC. I don't think the
movf instruction affects the Z bit, so try adding a specific test.
On Sun, 31 Jul 94 17:03:51 EDT you said:
>I am trying to establish/sponsor a mailing list.
>The list would cover the PIC series of microcontrollers.
>The list would have both mit and non-mit recipients.
>The requested name of the list would be:
> EraseMEpic.....wherever.mit.edu.
>Thank you for your asistance.
>jory bell
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
MIT Information Systems (Operations & Systems) will host a LISTSERV
electronic mail-distribution list on MITVMA.MIT.EDU if it pertains
to MIT business, or at least is sponsored by a member of the MIT
community, even if its subscribers are mostly elsewhere. A request
to establish a list must be sent to Postmaster from a member of the
MIT community who will accept responsibility for the list, and can
speak for the group whenever questions arise regarding either
mechanics or usage.
If the load on the system from lists not pertaining to MIT business
becomes a problem, we may have to re-evaluate hosting of such lists.
If the list appears to be abandoned (i.e., the owner cannot be
reached via the registered address), the list will be deleted.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+---------------------------------------------------------------+
| This file is to help you in creating a List of your own |
| on the LISTSERV at MITVMA. |
| LISTSERV cannot create a list automatically. The LISTSERV |
| maintainer must initally create the list for you. However, |
| after creation, maintenance of the list is the responsibility |
| of the owner or owners. |
+---------------------------------------------------------------+
Below, you will find a sample LISTSERV List Header. Each line of the list
header begins with an asterisk (*). Complete the information requested and
send it (only the header please, and a cover letter, if you wish) via e-mail
to POSTMASTERspamTakeThisOuTMITVMA.MIT.EDU.
Upon receipt of the list header, the LISTSERV maintainer will contact you.
*After* your list has been created, you should ask LISTSERV for additional
information by sending the following commands to RemoveMELISTSERVRemoveMEMITVMA.MIT.EDU
info listownr
info refcard
--------------------------------------------------------------------------
Communicating with LISTSERV is done in one of two ways, interactively or via
e-mail.
If e-mail is used, send the LISTSERV commands to TakeThisOuTLISTSERV@spam@@spam@MITVMA.MIT.EDU
The commands should be places in the text part of the mail.
From a CMS account use the 'tell' command, or e-mail.
From a VMS account use the 'send' command, or e-mail.
From the MITnet or Internet use e-mail.
--------------------------------------------------------------------------
Please fill in the ListName, ListTitle and Owner fields and make your
changes (as necessary) to any of the other keyword parameters.
A description of list header keywords can be found following this sample
list header.
* What is the name of this list ?
* From 4 to 8 characters from the following set: A-Z 0-9 $#+-_
* ListName= XXXXXXXX
* Example---> SAMPLE-L
*
* What is the title of this list ?
* ListTitle= XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
* Example--> A Sample Discussion List
*
* What is the e-mail address of the owner of this list ?
* (There can be more than one owner, just dup the line)
* Owner= TakeThisOuTXXXXXXspamXXXX.XXXXXX.XXXX.XXX.XX (Xxxx X Xxxxxx)
* Example--> Owner= KILLspamNHARTKILLspamspamBeGoneMITVMA.MIT.EDU (Noel P Hart)
*
* Review= Public
* Subscription= Open
* Send= Public
* Notify= yes
* Reply-To= List,Respect
* Files= No
* Ack= No
* Validate= Store Only
* Renewal= Yearly
* Confidential= Service
* Service= Local
* Notebook= Yes,G,Monthly,Public
* Stats= None
* Errors-To= Owners
*
*********** A description of list header keywords *************
The following is a description of the list control keywords that appear
in the header of each list. Whenever default values are supplied for the
keywords, they are listed first in the description. Words enclosed in
parenthesis are "(generic parameters)" which define a set of possible
values for a keyword operand.
A desctiption of 'Generic Parameters' such as net-address, access-level
etc. can be found following 'List control keywords'.
List control keywords
---------------------
***********************
* Ack= Yes | Msg | No *
***********************
Defines the default value of the "ACK/NOACK" distribution option for
the corresponding list, ie the value assigned to new users when they
subscribe to the list. This value can be altered by subscribers ("SET"
command), but not by users who are not signed on to the list. This
means that this option will always be in effect when distributing mail
from people who are not on the distribution list.
Yes Messages will be sent when your mail file is being proces-
sed. Additionally, a short acknowledgment with statistical
information on the mailing will be sent back to you, in
case a link failure prevented you from receiving the messa
ges. This is the default.
Msg Messages will be sent when your mail file is being proces-
sed. Statistical information will be sent via messages,
but no acknowledgment mail will be sent.
No A single message, but no acknowledgment mail nor statistics
will be sent when your mail file is being processed.
************************************
* Confidential= No | Yes | Service *
************************************
Indicates whether the list should be hidden from users or not. A con-
fidential list will not appear on the "List" command output. "No" is
the default value and indicates that the list is not confidential.
"Service" indicates that the list is to be hidden from users who are
not in the list's service area (see "Service=" keyword) but not from
other users. "Yes" means that the list is unconditionally confidential.
*********************************************
* Editor= (net-address1),(net-address2),... *
*********************************************
Defines the list editor(s). When used in conjunction with the "Send=
Editor" option, it causes all mail sent to the list to be automatically
forwarded to the first person listed in the "Editor=" keyword, who will
then send it back to the list at his discretion. The editors are the
only persons (with the list owners) who are allowed to mail directly to
the list. Note that ANY editor can send mail to the list while only the
FIRST one will receive copies of mail sent to the list.
The file will be forwarded to the editor 'as is', without being
included in a mail envelope. This method makes sure that the original
"Resent-" tags (if any) and "To:" keyword are preserved. BITNET editors
will receive the forwarded mailfile in their mailbox in Netdata format
(or whatever is the default format for their operating system), while
non-BITNET editors will receive it via their mailing system with an
extra mail envelope being generated to enclose the original (unaltered)
mailfile.
IMPORTANT NOTE: The editor MUST be a human person, not a file server,
list server, mailer, or suchlike. Specifying a program's mailbox as
"Editor=" could result in a mailing loop.
************************************************
* Errors-To= (mon-address1),(mon-address2),... *
************************************************
Defines the person or list of persons that are to receive rejection
mail for the list. The default value is 'Postmaster', and it is recom-
mended that the owners change it to 'Owners' or 'Owners,Postmaster' as
soon as they become familiar with Revised LISTSERV.
*******************
* Files= Yes | No *
*******************
Indicates whether files can be sent to the list or not. The default
value is "Yes".
***********************
* Formcheck= No | Yes *
***********************
Indicates whether files to be redistributed to the list must have a
FORM of REDIST to be accepted or not. The default value is "No", but
can be changed to "Yes" if for some reason it is suspected that files
can be accidentally sent to the list userid without being intended for
redistribution. Note that on some systems the FORM field is imposed by
the networking software and cannot be changed by the user.
*******************
* Language= idiom *
*******************
Defines the language in which information mail and messages are to be
sent to subscribers of the list. The postmaster must have provided the
required data file to the server, of course. The default language is
"English".
Currently only information mail is available in several languages. A
further release might incorporate customized messages by using the
:country tag in BITEARN NODES to determine the idiom to be used.
**************************
* Local= node1,node2,... *
**************************
Defines the nodes which are to be considered as 'local nodes' for
both service area checking and mail header grouping. The local node is
automatically considered as a 'local node' and does not have to appear
in the list. Subscribers from any of the local nodes will receive
separate pieces of mail with a single recipient in the "To:" field --
in other words, they will never receive a grouped piece of mail as
non-local recipients would if there are more than one recipient in
their node. Note that 'node' is a generic term that means "anything
after the '@' sign in the network address". For instance, "FRECP11"
and "VAX2.LAB1.LAN" are both valid node names.
Note: On MITVMA.MIT.EDU, "Local" means MIT sites only.
****************************************************************
* Notebook= No | (Yes,(fm),(interval)|Separate,(access-level)) *
****************************************************************
Indicates whether or not an automatic log of every piece of mail sent
to the list is to be kept, and defines at which interval of time its
file name must be changed and who is allowed to retrieve it from the
server. The default values are "Notebook= No,A,Single,Private".
(fm) Is the filemode of the disk on which the notebook is to be
kept. This information is of little importance to users,
except perhaps to the users of the server's host computer
who might, in certain circumstances, be allowed to LINK to
one of the server's disks (containing public information).
Contact the local LISTSERV operation staff for more infor-
mation.
(interval) Defines the filetype of the "notebook" file for the list,
as indicated below (the filename will always be the same
as the list name):
Single: A single file of filetype "NOTEBOOK" is created.
Yearly: A new file is started each yearly, filetype is "LOGyy"
Monthly: The filetype is "LOGyymm"
Weekly: The filetype is "LOGyymmw" (w in "A"-"E")
Separate: A separate file is kept for each mailing (eg digests).
The filetype is "yy-nnnnn" (sequential counter).
Note: notebooks can now be retrieved by means of the GET command. A
list of all available notebooks can be obtained with a GET
NOTEBOOK FILELIST command.
********************
* Notify= Yes | No *
********************
Defines whether the list owner is to receive notification of new
subscriptions and deletions, etc. The default is "Yes".
*********************************************
* Owner= (net-address1)|(access-level1),... *
*********************************************
Defines the person or list of persons who "own" the list. They are
responsible for controlling access to the list and defining the list
control keywords which are best suited to the purpose of the list. The
default value for this keyword which should ALWAYS appear in the list
header is the list of the userids of the postmasters. Any combination
of explicit network addresses and complex access-levels is acceptable,
for example: Owner= BIG@BLUE,(STAFF-L),Owner(MAIN-L)
An interesting application is to create a STAFF-L list containing the
userids of all the local LISTSERV staff members and set the "Owner="
keyword of all local lists to "Owner= (STAFF-L)". This way when there
is a change in the local LISTSERV management it is not necessary to
modify the headers of all the lists -- just modify the STAFF-L list.
******************************
* Peers= (peer1),(peer2),... *
******************************
Defines the (global) list of all the servers in the world that are
peer-linked to the list, either directly or via one or more other peer
servers. This information is used by the various list management com-
mands to determine the "nearest" peer list to a given user. For exam-
ple, when a SUBSCRIBE command is received from a user and it is deter-
mined that there is a better (nearer) peer list for him, the subscrip-
tion request is automatically forwarded to the appropriate LISTSERV.
******************************
* Renewal= Yearly | Monthly *
******************************
This keyword enables the automatic removal of subscribers to a list
if they do not re-subscribe within a required time. The user is
notified twice, via e-mail, of their pending removal, if they do not
reply, the third message sent is notification of their removal from
the list. (A nice way to help keep your list clean of dead users.)
The default is "Renewal=" (disabled)
Note: If this option is enabled for a list, the owners may alter the
setting of an individual subscriber via the SET command.
SET listname NORENEW FOR x@y
********************************************
* Reply-to= (destination),Respect | Ignore *
********************************************
Indicates whether the "Reply-to:" tag supplied by the sender of the
mail file is to be preserved or discarded (if present), and, if discar-
ded or omitted, what should be placed in the new "Reply-to:" generated
by the server. The default value is "List,Respect". Note that some
mailing systems are unable to process a "Reply-To:" field with multiple
addresses correctly and may therefore disregard the "Reply-to= Both"
option and treat it as "Reply-to= List".
Respect: The original "Reply-to:" tag, if any, is kept.
Ignore: The original "Reply-to:" tag is ignored and discarded.
**************************
* Review= (access-level) *
**************************
This keyword defines the category of users who are allowed to review
the network addresses and names of the persons subscribed to a list.
The default value is "Public".
Note: Individual subscribers to the list can use the SET command to
CONCEAL their names from the people who REFIEW the list.
*********************************
* Send= (access-level) | Editor *
*********************************
Defines the category of users who can mail or send files to the list.
Possibly puts the list under control of an editor. The default value is
"Public". When the list is controlled by an editor, any file or piece
of mail sent to the list is forwarded to the editor, who is the only
person (with the list owner) to be able to actually mail or send files
to the list. The network address of the editor is defined by the
"Editor=" keyword.
********************************
* Service= (area1),(area2),... *
********************************
Defines the 'service area' outside of which subcription requests
must not be accepted. When a SUBSCRIBE command is received, the
"Peers=" keyword is checked first to see if there is a nearer peer
list in the network. If it is the case, the command is forwarded to
this nearer server. If not, the service area is checked to ensure that
the recipient is acceptable; if it is not, the subscription request is
denied. When the command is forwarded, the destination server might
still deny access to the list if the subscriber is outside its own
service area, if any.
It is important to note that the service area check is made only
after the "best placement" check. This allows several servers in the
same country to share an identical service area, eg "Service= Germany",
and still have users subscribed to the best possible server.
Code "Service= Local" if you want to allow access by MIT address only.
**************************************************
* Stats= Normal | Extended | None,(access-level) *
**************************************************
Indicates whether or not statistics are to be maintained for the list
and if yes, which level of statistics is desired and who is able to
retrieve the statistics reports. The default value is "Normal,Private".
Normal statistics include number of mailings, number of outbound mail
files, and total number of outbound 80-character records, for each user
on the list, and a similar information for file distribution. Extended
statistics include all of the above plus actual network load indication
in "link.kbytes" units.
******************************************
* Subscription= By_owner | Open | Closed *
******************************************
This keyword defines whether or not new users are allowed to subcribe
to the list, and if not, whether their subscription requests are to be
forwarded to the list owner or not.
Open: The users are allowed to subscribe to the list.
By_owner: The users are not allowed to subscribe, but their requests
will be forwarded to the list owner. This is the default.
Closed: The users are not allowed to subscribe, and their requests
are not to be forwarded to the list owner.
***************************************
* Validate= Store only | All commands *
***************************************
Under Revised LISTSERV, lists are protected by a password which must
be specified by the list owner when he sends an updated version of the
list back to the server. When "Validate= All commands", password valida
tion applies to ALL the commands that modify the contents of the list,
eg SIGNOFF, SET, etc. This implies that users cannot use these commands
since they do not know the list password. A notable exception is the
SUBscribe command, which can still be used (if enabled) to get on the
list; however, sending a second SUBscribe command for the same list (to
correct a spelling error in your name) would result in the command
being forwarded to the list owner and not immediately executed. This is
to protect you from UREP hackers who might issue a command "from" your
userid@node to change the name under which you appear on the list to
something impolite. The default is "Store only", but it is recommended
that "serious" or "important" lists be changed to "Validate= All
commands".
******************************
* X-Tags= Yes | No | Comment *
******************************
Indicates whether "X-To:" and "X-cc:" tags are to be included in the
output mail files to list recipients of the original mail file (other
than the list userid) or not, and how they should appear in the RFC822
header.
Yes: This information must be provided in the form of "X-To:"
and "X-cc:" tags in the RFC822 header (similar to the
"To:" and "cc:" tags). This is the default.
Comment: This information must be provided in the form of "Comment:"
tags, ie "Comment: X-To:" and "Comment: X-cc:".
No: This information must not appear at all in the mail haeder.
*************************************************************************
** Generic parameters **
** ------------------ **
(net-address): Describes a RFC822-compatible network address,
usually of the "spamBeGoneuseridKILLspamnode.domain" form.
(access-level): Controls which category of users has access to
the information or service to which this para-
meter applies. (access-level) can be either:
Public Everybody has access to the information.
Postmaster Only the postmaster (ie LISTSERV operations
staff) has access to the information.
A1,A2,... with Ai being either:
Private Only users subscribed to the list
have access to the information.
(listname) Only the members of the specified
list have access to the info.
Owner Only the list owner can access
the information.
Owner(list) Only the owner of the indicated
list can access the information.
Service Only people in the service area
of the list can see the info.
Service(list)
(destination): Indicates the destination of a piece of mail,
message or reply. Depending on the type of
reply, all the options listed below might not
be effective. For example, "Reply-to= None" is
functionally identical to "Sender", whereas
"// JOB Reply-to=None" (in a batch command
file) would actually suppress all replies.
List The reply message is sent to the list.
Sender The reply message is sent to the sender of
the original piece of mail.
Both The reply message is sent both to the list
and to the original sender.
None No reply message is sent at all.
"address" The reply message is sent to the specified
network address if enclosed in double quotes
(interval): Is a time interval that indicates how frequent
ly an operation is to be renewed. Note that
depending on the operation being performed,
some of the options may not be available. For
example, "Notebook= Yes,A,Daily" is not avai-
lable.
Yearly
Monthly
Weekly Self-explanatory
Daily
Hourly
Single The operation is to be done only a single
time.
(peer): Is the node-id or network address of a peer
list server. If the name of the peer list is
the same as the name of the local list (which
will usually be the case), only the node name
needs be given. If the list names are diffe-
rent, the full list network address must be
given, eg "REXX-L@UIUCVMD".
(area): Is a means whereby a node or list of nodes can
be identified. An area can be either:
- The name of a network, eg EARN, BITNET
- The name of a country, eg Germany, Canada
- 'Local', in which case it is equated to the
value of the "Local=" keyword (qqv).
- A node name, eg FRECP11
- A simple wildcard nodename pattern such as
FR*, *11, *ESA*, D*ESA*, etc
(mon-address): Is a means whereby 'list monitors' can be iden
tified (the term 'list monitor' refers to a
human person who monitors the activity of a
list). A 'mon-address' can be:
- A single network address, eg INFO@TCSVM
- 'Postmaster', which indicates the "main"
postmaster
- 'Postmasters', which indicates ALL the post-
masters, main and alternate
- 'Owner', which indicates the "main" list
owner (the first to be listed in the
"Owner=" keyword)
- 'Owners', which indicates ALL list owners
Whenever several keywords or operands are accepted, they will be
separated by a logical OR sign (|). Unless specified otherwise, commas
have "higher priority" than OR signs, that is to say, "Public|Private,
Open|Closed" means "(Public|Private),(Open|Closed)", not "Public|
(Private,Open)|Closed".
I think that standard electronics distribution channels would be
good for this sort of thing. I don't know if they can get down
much below $6.56, but I know I paid about $1.80 for 54LP/Ps back
about 1992. Of course, I bought 11K of them.......
Call your local Microchip distributor. If you'd include your
physical location, it'd be easier for us to point you in the
right direction.
There are some PIC related files on ftp.funet.fi in the directory
/pub/microprocs/PIC. Try looking in the microchip-bbs directory, the
files you're looking for might be there.
(New contributions to the PIC archive very welcome!)
In AN510 Implementation of an Asynchronous Serial I/O must be a bug.
I must step the time delay loops for the right length.
Have you any other idea about Asynchronous Serial I/O?
> Have you any other idea about Asynchronous Serial I/O?
Well, one problem with Microchip's example source is that they've got
the RS-232 signals inverted. (On rs232, 1's are sent as low voltage,
0's as high). A scope is a great debugging aid for programming
RS-232, btw.
I'm a rookie at this microcontroller programming stuff, but I am very interested
in finding the answers to your questions. Since, I have to write the same
routines for the pic16c64.
I wonder what clock speed you are using for the chip. This may have
an effect on the number of program steps that the chip must wait for the
next bit. You could calculate this value and set a loop parameter, so
you could generalize the code for any speed.
Also if the chip is wasting time waiting to send the next bit, you could use
that time to check for an xon (h'11') or xoff (h'13') byte to see if you should
stop sending bits.
You probably already thought of this, and remember I'm a rookie.
>
> There are some PIC related files on ftp.funet.fi in the directory
> /pub/microprocs/PIC. Try looking in the microchip-bbs directory, the
> files you're looking for might be there.
>
> (New contributions to the PIC archive very welcome!)
>
> -- vinsci
>
>
Dear vinsci,
Thank you for the additional pic ftp address. I'll have a look around
when I have a chance.
I have written a floating point division that may be faster and more
compact than what I have seen. But it is pretty crude and it is
tailered to my application. ie. I'm only interested in the integer
result.
I'll try to get it to a nicer form for public consumption.
there was some (good) response about my new "Multi process Kernel". So I will
post it soon. Have some patient, because I have do some other jobs too.
To avoid too much questions later I'm describing details more precise
in the source now.
I intend to post the MpK next week. (Put the ZIP-files onto our public
server ftp.ntb.ch and to takdsign). BTW: MpK sounds a little bit too proud!
So don4t blame me afterwards...
The RS-232 lines are reversed, but if you use some MAXIM interface chips,
it reverses the lines also. So you get an inverted invert, uhh, you know
what I mean.
Does anyone know if there is a small PIC controller board that is offered
by any companies? I know about the Basic Stamp but that 8 bit I/O is a huge
disadvantage for medium level work. I am thinking of something along the lines
of the F1 or miniboard type of stuff.
I know the PIC might not be the best chip for the job, but I just wanted to
know if anyone done it before.
There are the PICProto boards from MicroEngineering Labs in Colorado. They
are simply prototyping boards with the layout for the pic chip and clock
circuitry, plus some proto space for your own stuff.
> There may be more to it that this, but a quick look shows that you are
> moving RTCC into W and then expecting the Z bit in the status register
> to indicate the zero or nonzero status of the RTCC. I don't think the
> movf instruction affects the Z bit, so try adding a specific test.
>
> David
The Microchip data pages say that movf does set the Z bit. Besides the
seconds timing seems to working fine. A LED i have blinking is regular
and never fails.
> I didn't read all of your code & have not used the 57 ( I am using the '71)
> but I did check the '57 op-codes. A movf RTCC to W will set the Z flag but
> will also clear the prescaler. Could this tie in with your troubles, or have
> you allowed for it?
>
> Good luck,
> Brian
Brian, I thought you may have hit the problem, but it does not appear
so. Firstly if the movf RTCC, w did change the prescaler, then the
whole time would be out (and my LED blinking each second would not be
operational). I did try resetting the prescaler after each operation
with the RTCC, but this gave not change.
The Microchip data page is confusing. It talks in note 4 of the
instruction table, about the prescaler being reset, but is ambiguous. (to
me atleast)
I have RA4 on a 4.7K pullup. When I drive the pin high I only get a voltage
of 2 volts maybe 2.1. 4.7K!!! Anyway It hangs around .68mV when I am
not driving it low. I really need help with this. I fall below ttl
level from time to time and its killing me. It works fine if I put a
680Ohm pullup on it but then my lower voltage is horrendus(sp). I know
about the screwed up tristate reg on it and I only move an image of RA
into the ra reg(not the tristate I leave it alone).
Help please....
later
John
_____________________________________________________________________________
John Johnson |If it's not OS/2.|spam_OUTjohnsonjspamccwf.cc.utexas.edu
|It's crap! |spamjohnsonjspamspamghostwheel.bga.com
OOOO SSSS /2222 2222 11 | |
O O S / 2 2 1 |"We need breath- |"Bite me." Tom Servo
O O SSSS / 2222 2222 1 |-ing room!" |
O O S / 2 2 .. 1 | Bill Gates |"I want to decide who lives
OOOO SSSS/ 2222 2222 .. 111| |and who dies" Crow T. Robot
-----------------------------------------------------------------------------
I've received a demo version of the MPC C-compiler for the PIC series
from one of ByteCraft's distributors. I'll check the licensing to see
if I can put it up for ftp here on ftp.funet.fi, and if so do it later
today or on monday.
>Can one run aspic-assembled files in the mpsim simulator or is there
>another way to do it?
Sorry for the delay, Leonard, but I just got back from a camping trip...
Yes, ASPIC supports mpsim, it generates MPALC compatable output files, so
you
may need a command line switch on the latest version of mpalc.
In fact, registered ASPIC users, get a bunus utility which parses the
output of MPSIM into data files which allow you to plot waveforms (a
program is provided to do that too).
I use the Baradine Microburner for all PIC programming. It is relatively
inexpensive (a few hundres $CDN) and it uses a standard ASCII interface so
it will work with any computer.
I have also written a command-line interface which is available on the
microchip BBS (3rdparty file area) and a few ftp sites as BURN.ZIP.
Adapters are available for all *EXISTING* PICs (16c64 is comming), I have
them all, It works much better than PICSTART (I have one of them) and
Promaster (have one of those too).
>Could you please explain what do you mean by "It works much better than
>PICSTART"? I have PICSTART and it works. What would be "much better" than
>that? No irony, I'm just wondering.
(What follows is a peeve, so the tone may sound a bit harsh...)
It's just that I find Picstart programmer is annoyingly slow. The Picstart
and Promaster share the same front-end shell which is all manually driven,
messes with the video mode, and does not provide usable error return codes.
They both communicate with proprietary, un-published protocols, so people
with other computers (mac, unix, etc.), or who use safer developement
practices like makefiles, rcs etc. are left in the lurch.
They work great as toys (to play with settings, etc.) but I'm to
absent-minded to remember to manually set the fuses right each time!
> On Aug 8, 1994, Alex Freed wrote:
>
> >Could you please explain what do you mean by "It works much better than
> >PICSTART"? I have PICSTART and it works. What would be "much better" than
> >that? No irony, I'm just wondering.
>
> (What follows is a peeve, so the tone may sound a bit harsh...)
>
> It's just that I find Picstart programmer is annoyingly slow. The Picstart
> and Promaster share the same front-end shell which is all manually driven,
> messes with the video mode, and does not provide usable error return codes.
> They both communicate with proprietary, un-published protocols, so people
> with other computers (mac, unix, etc.), or who use safer developement
> practices like makefiles, rcs etc. are left in the lurch.
>
> They work great as toys (to play with settings, etc.) but I'm to
> absent-minded to remember to manually set the fuses right each time!
>
> - Don
>
I must agree with Don's comments. Having to set the fuses every time is
annoying. In my opinion, a major improvement would be for it to simply
remember the last settings when it starts up.
I have experienced other problems using PICSTART. I find that often
(with 16C71s, at least) it takes 2 or 3 goes to program properly: verification
fails initially, but it will eventually succeed. Is this a problem that others
have found? Something to do with firmare perhaps? (Mine is PICSTART-16B,
Firmware V1.7).
Another point to consider: the programming specs (eg. DS30153D) say that the
devices should be verified at VDD min as well as VDD max, yet I see no
evidence that PICSTART does this. Does anyone know what goes on here? The
PICSTART user's guide is silent on such issues. Seems to me that you could
easily program a device that verifies at 5V, but fails at 3V.
After reading a message concerning someone having a firmware release of 1.7,
I wanted to know if anyone has a newer version of the firmware or can tell
me if there are any advantages over version 1.5 (which I have).
>...Having to set the fuses every time is
>annoying. In my opinion, a major improvement would be for it to simply
>remember the last settings when it starts up.
The various spec sheets define addresses for all fuses. ASPIC supports
setting these in the source files, and I prefer to use programmers which
also do.
>Another point to consider: the programming specs (eg. DS30153D) say that
the
>devices should be verified at VDD min as well as VDD max, yet I see no
>evidence that PICSTART does this. Does anyone know what goes on here?
Microchip has pointed out many times (at least on their BBS) that PICSTART
is NOT considered a "production" programmer, however, we only use Baradine
Microburners,
which I don't believe program VDD (I may be wrong). Getting the fuses
wrong and the
accumulated labour of manually going through all of those menus on
Promaster are more
of a concern than the small chance that a product which passes all other
tests will fail under low voltage (which will reset anyway)!
> I must agree with Don's comments. Having to set the fuses every time is
> annoying. In my opinion, a major improvement would be for it to simply
> remember the last settings when it starts up.
>
If you hit "Read device" before loading in your object code, the fuses are
automatically set to how the current device was last programmed. Only works
for the EE part (16C84), though. :-)
> I have experienced other problems using PICSTART. I find that often
> (with 16C71s, at least) it takes 2 or 3 goes to program properly: verification
> fails initially, but it will eventually succeed. Is this a problem that others
> have found? Something to do with firmare perhaps? (Mine is PICSTART-16B,
> Firmware V1.7).
I have found that every once in a while our PICSTART refuses to program
properly, but I put it down to the ZIF socket - devices placed centrally
do not program properly but ones placed at the left side program OK.
> Another point to consider: the programming specs (eg. DS30153D) say that the
> devices should be verified at VDD min as well as VDD max, yet I see no
> evidence that PICSTART does this. Does anyone know what goes on here? The
> PICSTART user's guide is silent on such issues. Seems to me that you could
> easily program a device that verifies at 5V, but fails at 3V.
PICSTART is classed as a DEVELOPMENT programmer, and the programming spec.
states that only PRODUCTION class programmers need to have the variable
voltage capability. I suppose it's how they get away with such crappy drive
software as well.
A couple of recent posters have been complaining that menu-driven
programs do not really help for development ( a sequential process).
Herewith a useful program for the PC.
In batch files, you run key-fake just before running the menu program.
This "fakes" keystrokes for the menu driven program.
KEY-FAKE "string",13,"ABB",27,0,13
MENUPROG
Strings "..." are characters
Numbers are ascii codes for keystrokes eg. 13 = enter, 27 = escape. 0 is
a special value which "synchs up" with flushing of the keyboard buffer.
I use this and Borland's make to streamline programming.
NB: I'm not too sure about the legal status of this program ie.
copyright infringement.
>I have found that every once in a while our PICSTART refuses to program
>properly, but I put it down to the ZIF socket - devices placed centrally
>do not program properly but ones placed at the left side program OK.
Hmmm...
I've used the PICStart 16B since version 1.4 (keep getting upgrades, like
candy), and it's always been flakey. I have one at work and another at
home. Both the same.
I've never even tried shifting the part in the ZIF socket. Sometimes it
programs first time, usually it takes three attempts. Without shifting the
chip at all. I chalk it up to flakey timing and bad exception handling.
Which is also pure conjecture... My $0.02
I'm interested in that "Unix" code the other guy has.
there was some (good) response about my new "Multi process Kernel". So "I" will
post it now to our ftp server ftp.ntb.ch. Actually my sysop will do that
hopefully within some days. (/public/MicroChip/Pic/...)
To avoid too much questions later I've described details more precise
in the source. That4s why it lasted so long... Thanks for your patient.
There will also be 2 samples showing the usage of MpK and a simple shell
that I use. (Comes up with shareware boxer, telemate and 4DOS).
One sample (FSS) has got an ORCAD pcb design included ...
Read the *.idx files for an overview.
BTW: MpK sounds a little bit too proud! So don't blame me afterwards...
PS: Somewhere out in the net is an 2 week old message called "MpK coming soon".
It is supposed to wait there in an endless loop !!?? So just delete it
if it finaly appears somehow...
I did not find these directories or any information on MpK at ftp.ntb.ch.
Or any PIC info at all???? I'm very interested in MpK, so let me know if its
at another site. Thanks a million Steve
----------{Original Message removed}
> does anyone know, if the data-sheets of PICs are available via ftp?
> are they in ascii-format / word-format / postscript?
>
> or has anyone good contact to microchip to get the files and post them an a
> ftp-server?
>
I haven't seen any data sheets out on the net, but here is a excellent
ftp address:
>
> I did not find these directories or any information on MpK at ftp.ntb.ch.
> Or any PIC info at all???? I'm very interested in MpK, so let me know if its
> at another site. Thanks a million Steve
Hi Steve,
With a little search I found that the original directory is :
Something I came across today - mpstart will read fuses and ID
locations from withon a .obj file, so there's no need to keep
setting the fuses each time you load it up. The only problem is
that to get mpalc to place data at $2000-2007 you need to use
org beyond its defined limits so you get a fatal error for each
word of data when assembling.
Perhaps ASPIC copes with this OK?
I've also descovered a problem when using 16C84s that once in a while
they lock up and only a powerdown will start them off again. The reset
pin doesn't do anything. It occurs primarily if I use my in-circuit programmer
after the chip has already been running. After the programming cycle is
complete, the device is presented with a reset pulse but just sits there.
If the device is programmed straight after power-up, the reset pulse
after programming starts it and it runs the program.
Any ideas? All I can think of is that it's latchup on the MCLR pin
but I've tried driving it through a resistor, and non of the voltages
are outside the supply rails (except the 12V for programming).
Any ideas?
Thanks,
Simon
--
******************************************************************************
* Simon Harrison, University of Newcastle U. Tyne * *
* S.J.Harrisonspam@spam@uk.ac.newcastle * Oook *
* Fax: 091-222-8180, Attn: S.Harrison * - Librarian *
* Telex (Preferred): 53654 UNINEW G, mark 1st line: * *
* "TO: S.J.HARRISON (DEPT. OF ELEC. ENG.)" * *
******************************************************************************
> Something I came across today - mpstart will read fuses and ID
> locations from withon a .obj file, so there's no need to keep
> setting the fuses each time you load it up. The only problem is
> that to get mpalc to place data at $2000-2007 you need to use
> org beyond its defined limits so you get a fatal error for each
> word of data when assembling.
> Perhaps ASPIC copes with this OK?
Of course ASPIC supports this. The file DEMO.ZIP available on my BBS
(604-597-3479), Microchip's BBS and a few ftp sites shows how. Here is an
excerpt:
...
(From PLD.ASM (the initial file))
;**********************************************************************
;*
;* Define PIC options and ID
;*
;**********************************************************************
.if !clop_d ;simulator won't tolerate fuses!
SEG FUSES ;Config fuse area
.word _XTOSC|_CP|_PWRTE ;Mode: xt osc, no code protext, timer
enabled
.if isdef( IDLOC ) ;if there is an ID area (ie. not 17C42)
SEG ID
.word _year&$0f,_month,_day,_hour ;set id number to compile
time
.endif
.endif
----------------------------
Note that the above code also generates a default id code as the compile
time
in BCD.
Sorry. Didn't mean to cast doubts about your program.... It's just I don't
use a PC for most of my work so don't really know anything about ASPIC.
I don't suppose you'd do an Atari version...
Simon
--
******************************************************************************
* Simon Harrison, University of Newcastle U. Tyne * *
* spamBeGoneS.J.Harrison.....uk.ac.newcastle * Oook *
* Fax: 091-222-8180, Attn: S.Harrison * - Librarian *
* Telex (Preferred): 53654 UNINEW G, mark 1st line: * *
* "TO: S.J.HARRISON (DEPT. OF ELEC. ENG.)" * *
******************************************************************************
on a list administrivia note (which will seem more towards the
trivial for experienced listserv users):
when i added all the "old" list members to the new list, the
listserv wanted to make "names" for everyone, so pretty much
everyone got names "pic user". in order to let the server properly
label your mail wth your correct name, you can send a message to:
you don't have to mention your email address or anything, since the
server software will see that from your mail.
having the server know your "real" name is not a big deal, but it
lets other list recipients see who a message is from (especially if
their mail software shows only the real name, and not the email
address).
finally/also, if you are getting "acknoledgement" email from the list
server when you send a message, you can send a message to the listserver
(same address as above) with the body:
set noack
you can send both commands ("register <your name>" and "set noack")
on separate lines in the same message.
hope this helps ome people.
feel free to send me comments on/about the list. especially and issues
pertaining to the changeover to the new server.
on a list administrivia note (which will seem more towards the
trivial for experienced listserv users):
when i added all the "old" list members to the new list, the
listserv wanted to make "names" for everyone, so pretty much
everyone got names "pic user". in order to let the server properly
label your mail wth your correct name, you can send a message to:
you don't have to mention your email address or anything, since the
server software will see that from your mail.
having the server know your "real" name is not a big deal, but it
lets other list recipients see who a message is from (especially if
their mail software shows only the real name, and not the email
address).
finally/also, if you are getting "acknoledgement" email from the list
server when you send a message, you can send a message to the listserver
(same address as above) with the body:
set noack
you can send both commands ("register <your name>" and "set noack")
on separate lines in the same message.
hope this helps ome people.
feel free to send me comments on/about the list. especially and issues
pertaining to the changeover to the new server.
Anybody here got one of these? Have you used other ICEs that compete
with it? It seems like a pretty good price ($699) if it works as
advertised, and I've used the front end software when it was just
a simulator. At least, it *looks* the same.....
How does the copyright work for versions of mpalc downloadable from the
microchip BBS? If you already own PICSTART, then I presume that it is OK
to download new versions (that's what they are there for), but what if you
don't own PICSTART? Is it still legal to download and use mpalc? If so, is
it OK to distribute it without charge to other people?
Just curious....
Simon
--
******************************************************************************
* Simon Harrison, University of Newcastle U. Tyne * *
* spam_OUTS.J.Harrison@spam@RemoveMEuk.ac.newcastle * Oook *
* Fax: 091-222-8180, Attn: S.Harrison * - Librarian *
* Telex (Preferred): 53654 UNINEW G, mark 1st line: * *
* "TO: S.J.HARRISON (DEPT. OF ELEC. ENG.)" * *
******************************************************************************
>
> I need a microcontroller to do the following..any ideas anyone?
>
> 1K internal EEPROM (memory capacity could be less or more)
> More than 1K internal RAM
> RAM should be non-volatile in sleep mode
> 2x 8bit ports (or eqivalent)
> Or 1 4bit, 1 8bit, R/W and AS pins
> It should also be easily programmable (PIC 15 or 16 or 17 series programmer
> available to me, or 16HC11 types
> If onboard RAM is not available, this is not disastrous, please send me
> any ideas if you have them...
>
> Desperately,
> Bryan
>
> PS Please mail asap, as I need to get something built in the next three
weeks...
--
---------------------------------
BRYAN CROTAZ - @spam@b.crotazspam_OUTic.ac.uk
---------------------------------
TECHNICAL MANAGER
Student Television Of Imperial College
Beit Quad, Prince Consort Road
London SW7 2BB
Tel. 071-594-8104
Fax. 071-225-2309 attn. STOIC