Searching \ for ' help!!' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=help
Search entire site for: 'help!!'.

No exact or substring matches. trying for part
PICList Thread
'MPLAB bug? HELP!!!'
1996\05\29@042555 by Newfound Electronics

flavicon
face
Hi all,

I've been trying to use MPLAB and have ended up very confused!
What is the real result of this operation?

      MOVLW 01
      ADDWF PC,SAME
      RETLW 0AH
      RETLW 0Eh

MPLAB insists on jumping to the first RETLW 0Ah. I reckon it's wrong
and plug for the second RETLW 0Eh.

A zero offset ends up in an infinite loop!!??

I'm sure I knew how this all worked but after using MPLAB, I am
confused and have a king size headache!

Am I bugged or is it MPLAB?

Also, the RETLW instruction description "example" for all the PICs
I checked  appears to describe the table jump operation incorrectly.

TABLE  ADDWF PC
      RETLW K1
      RETLW K2
       "  "
      RETLW Kn

w = 0x07 should return K8 NOT k7, right?

This is just to confuse me more I guess....


Jim

1996\05\29@045128 by fastfwd

face
flavicon
face
Newfound Electronics <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> I've been trying to use MPLAB and have ended up very confused!
> What is the real result of this operation?
>
>        MOVLW 01
>        ADDWF PC,SAME
>        RETLW 0AH
>        RETLW 0Eh
>
> MPLAB insists on jumping to the first RETLW 0Ah. I reckon it's wrong
> and plug for the second RETLW 0Eh.
> ....
> Am I bugged or is it MPLAB?

   Jim:

   Check to make sure that you've defined "SAME" to "1".  If so,
   the bug is in MPLAB.

> TABLE  ADDWF PC
>        RETLW K1
>        RETLW K2
>         "  "
>        RETLW Kn
>
> w = 0x07 should return K8 NOT k7, right?

   Right.

   -Andy

Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\05\29@095330 by Mark K Sullivan

flavicon
face
This is a known bug in MPLAB.  They told us about it at the last seminar. See?
The seminars are good for something.  The simulator doesn't add one to the PC
(for the pre-fetch) in operations which modify the PC.

The work around is to add 1 yourself in code which you will run on the simulator
and take it out again when you go to silicon.

- Mark Sullivan -

1996\05\29@130845 by Darrel Johansen

picon face
    Jim,

    This problem was reported in beta testing for MPLAB-SIM.  The latest
    released version on the BBS (MPLAB 3.01) solves this problem.  If you
    want to wait until next week, we'll be posting a new version of
    MPLAB-SIM which has some additional fixes and fine tunings.

    Darrel Johansen


______________________________ Reply Separator _________________________________
Subject: Re: MPLAB bug? HELP!!!
Author:  Newfound Electronics <newfoundspamKILLspamNE.COM.AU> at Internet_Exchange
Date:    5/29/96 4:24 PM


Hi all,

I've been trying to use MPLAB and have ended up very confused!
What is the real result of this operation?

      MOVLW 01
      ADDWF PC,SAME
      RETLW 0AH
      RETLW 0Eh

MPLAB insists on jumping to the first RETLW 0Ah. I reckon it's wrong
and plug for the second RETLW 0Eh.

A zero offset ends up in an infinite loop!!??

I'm sure I knew how this all worked but after using MPLAB, I am
confused and have a king size headache!

Am I bugged or is it MPLAB?

Also, the RETLW instruction description "example" for all the PICs
I checked  appears to describe the table jump operation incorrectly.

TABLE  ADDWF PC
      RETLW K1
      RETLW K2
       "  "
      RETLW Kn

w = 0x07 should return K8 NOT k7, right?

This is just to confuse me more I guess....


Jim

1996\05\30@091912 by Newfound Electronics

flavicon
face
>This is a known bug in MPLAB.  They told us about it at the last seminar. See?
>The seminars are good for something.  The simulator doesn't add one to the PC
>(for the pre-fetch) in operations which modify the PC.
>
>The work around is to add 1 yourself in code which you will run on the
simulator
>and take it out again when you go to silicon.
>
>- Mark Sullivan -
>
>

Thanks to all who helped with the MPLAB bug, my sanity is restored and my
headache sank into the depths of my pillow.

Mark, I thought of the above too but my application was a delay and the offset
was used as part of the delay like this:


movlw 03
andwf baudrate
xorlw ??
xorlw ??
xorlw ??
movwf dlycnt
decfsz $-1

This obsure method is because I'm using a 16C57 with only 2 levels of stack and
limited literal instructions. Pretty clever huh?

Given 4 such tables for the RS232 TX and RX routines, it sort of gets confusing,
well for me anyway! I think I'll grab the new MPLAB version.

My thanks once again...

Regards,

Jim


'Sampling Problems w/ 16C74 A/D Module, Help!!!!'
1996\10\09@001541 by NEIL GANDLER
flavicon
face
 I just tried using the A/D module in a program using the
PIC16C74. A weird phenomenon has occured. For the first
sample of a particular channel, the reading is correct,
whether I internally program the use of an external low impedence 2.5v
reference or choose VDD +5v as my reference. But when my program
attempts successive
readings on this channel, the results are errors, as if by
calculation, the channel being measured is compared to a
changed reference slightly lower than Vdd. For example

1st attempt at measuring a 2v source
    w/ 5v Vdd reference         result = 102(decimal)
    w/ 2.5v external reference  result = 204(decimal)
These both are correct.....

2nd attempt at measuring the same channel regardless of how
long I wait to make the next sample, the result becomes as
follows...

    regardless of reference   result = 116(decimal)
INCORRECT... Translates to a assumed reference lower than VDD
This same value occurs whether I use VDD as my reference internally
or my +2.5v external reference.

Either way, I have tried to isolate the problem by
writing the simplest program possible to test the A/D and I
still have the same problem!! The only way to get a correct
reading again is to have some kind of reset. Jumping to the
init routine or top of my code doesn't help. I also tied all
unused digital inputs low. I kept the circuit away from any
strong signals. It can't be the 16c74 PICs, because it
happens with all 4 of them with no differences. I even
borrowed a couple from a friend. I am working without access
to an emulator and the simulator won't catch this anomoly.
Here is the relevant portion of my a/d test program.

NOTE:  16C74, 4mhz xtal, all interrupts off

    'bank0
    clrf         porta
    clrf         porte
    'bank1
    movlw        B'11101111'
    movwf        trisa
    movlw        B'00000111'
    movwf        trise

    movlw        h'01'   ;Selects RA0,RA1,RA2,RA3,RA5,RE0-2
                         ;as analog inputs
                         ; RA3 as voltage reference
    movwf        adcon1

    'bank0

SRV  " 1 sec delay routine using tmr0"

    MOVLW        H'41'
    MOVWF        ADCON0  ; SET A/D CONVERSION CLOCK TO
                         ;  FOSC/8
                         ; SELECT CHANNEL-1 RA0/AN0
                         ; TURN ON A/D CONVERTER
      CALL  DELAY        ; WAIT 15uS  (routine of 15 NOP's)
      BSF   ADCON0,GO    ; START A/D CONVERSION
SRV1   BTFSC ADCON0,GO    ; CONVERSION COMPLETE?
      GOTO  SRV1         ; NO
                         ; YES
      MOVF  ADRES,W
      MOVWF PORTD        ; PORTD IS CONNECTED TO LOW CURRENT
                         ; 10 SEGMENT BAR TYPE LED DISPLAY
                         ; ALLOWS ME TO SEE RESULT
      BCF                ; ADCON0,ADON ; TURN OFF A/D

      GOTO   SRV         ; REPEAT THE SAME STEPS AGAIN


 I would appreciate any advice or proposed solution to my
problem.

    Neil Gandler
    University at Buffalo

1996\10\09@022231 by Steve Hardy

flavicon
face
> From: NEIL GANDLER <.....V064MB9KKILLspamspam.....UBVMS.CC.BUFFALO.EDU>
>
>   I just tried using the A/D module in a program using the
> PIC16C74. A weird phenomenon has occured. For the first
> sample of a particular channel, the reading is correct,
> whether I internally program the use of an external low impedence 2.5v
> reference or choose VDD +5v as my reference. But when my program
> attempts successive
> readings on this channel, the results are errors, as if by
> calculation, the channel being measured is compared to a
> changed reference slightly lower than Vdd. For example
>[cut]

By a process of elimination, the problem is (most probably) not
- the PIC chip
- the reference or test voltage (assuming they are not somehow perturbed
by the output to port D or anything else subsequent to the first sample).
- timing related.
- the code as it executes from hard reset or power-up to the first sample.

Assuming that you have _proven_ that the program loop actually behaves
as expected i.e. it really does execute SRV1 again...

Therefore, the problem must be an incorrect machine state obtained some
time after the first sample.  Hard reset (as opposed to just executing from
location zero) initialises the machine state in a predictable way.  You
must have some implicit dependence on this state.  Subsequent samples are
relying on this state, which has been changed after the first sample.

Possible reasons for this may be
- Not setting the register bank correctly
- Not setting the PCLATH page bit correctly
- Inadvertently enabling interrupts
- Inadvertent write to INDF when FSR is haywire.
- Not defining working registers correctly e.g. in your mysterious "1 sec
delay routine" you could be using a register which is not 'ORG'd correctly.
Once, when porting an '84 program to the '74, I forgot to redefine the
base location of the registers (0Ch in the '84 and 20h in the '74).

The following steps may help track the problem:
- Try using the simulator anyway: although it doesn't simulate the
analogue voltage (I think), it should show any problems with
initialisations or bank-switching.
- Don't turn the ADC off and on each time through the loop (like a
tungsten light bulb, this can blow it - no, just joking).  Set the ADON
bit _outside_ the loop.
- Send me the complete code and I'll have a look.

Regards,
SJH
Canberra, Australia

1996\10\09@023010 by John Payson

picon face
>   I just tried using the A/D module in a program using the
> PIC16C74. A weird phenomenon has occured. For the first
> sample of a particular channel, the reading is correct,
> whether I internally program the use of an external low impedence 2.5v
> reference or choose VDD +5v as my reference. But when my program
> attempts successive
> readings on this channel, the results are errors, as if by
> calculation, the channel being measured is compared to a
> changed reference slightly lower than Vdd. For example

Have you read Microchip's errata for the 16C74?  One specific problem that
Microchip mentions is that the A/D will be inaccurate with VRef values near
Vdd.

A few other notes for the 16C74/16C71:

- The "secondary" 32KHz crystal oscilltor is unreliable whenever the main
 oscillator is running (though it may be used to trigger a wakeup from
 sleep, few situations would benefit from crystal accuracy there without
 the ability to run the crystal continuously, e.g. to keep a time of day
 clock).

- Because all register writes are preceded by reads, writing data to the
 "host port" while data is waiting to be read will cause the chip to
 forget about the incoming data.

- On the 16C71, the special A/D RC oscillator should not be used while the
 main oscillator is running if the main oscillator is in RC mode, and it
 should not be used for reading the A/D input nearest the crystal unless
 the crystal is stopped.

1996\10\09@041959 by TONY NIXON 54964

flavicon
picon face
Try leaving the A->D running all the time as in the following code
change. Starting the converter from scratch may take more than the
15uS you have allocated for the conversion start



    MOVLW        H'41'
    MOVWF        ADCON0  ; SET A/D CONVERSION CLOCK TO
                         ;  FOSC/8
                         ; SELECT CHANNEL-1 RA0/AN0
                         ; TURN ON A/D CONVERTER

SRV  " 1 sec delay routine using tmr0"

      BSF   ADCON0,GO    ; START A/D CONVERSION
      CALL DELAY             ;WAIT 15uS (routine of 15 NOP's)
SRV1   BTFSC ADCON0,GO    ; CONVERSION COMPLETE?
      GOTO  SRV1         ; NO
                         ; YES
      MOVF  ADRES,W
      MOVWF PORTD        ; PORTD IS CONNECTED TO LOW CURRENT
                         ; 10 SEGMENT BAR TYPE LED DISPLAY
                         ; ALLOWS ME TO SEE RESULT

      GOTO   SRV         ; REPEAT THE SAME STEPS AGAIN


Tony


Just when I thought I knew it all,
I learned that I didn't.

1996\10\09@111716 by Neil Gandler

flavicon
face
First off, I would like to thank you for taking the time to answer
my problem.


> Have you read Microchip's errata for the 16C74?  One specific problem that
> Microchip mentions is that the A/D will be inaccurate with VRef values near
> Vdd.
>

--  Yes I did read the errata, I am using a VREF of 2.5v, which should
be safe since my VDD is 5v

> A few other notes for the 16C74/16C71:
>
> - The "secondary" 32KHz crystal oscilltor is unreliable whenever the main
>   oscillator is running (though it may be used to trigger a wakeup from
>   sleep, few situations would benefit from crystal accuracy there without
>   the ability to run the crystal continuously, e.g. to keep a time of day
>   clock).
>

--  I don't understnad, I didn't know there was any secondary crystal
oscillator on the pic. I am using a 4mhz crystal.

> - Because all register writes are preceded by reads, writing data to the
>   "host port" while data is waiting to be read will cause the chip to
>   forget about the incoming data.

-- This could be the problem, I will check.

>
> - On the 16C71, the special A/D RC oscillator should not be used while the
>   main oscillator is running if the main oscillator is in RC mode, and it
>   should not be used for reading the A/D input nearest the crystal unless
>   the crystal is stopped.
>
-- Not applicable to my situation


'MPLABC 1.21 HELP!!!'
1997\02\26@014638 by tjaart
flavicon
face
I downloaded the upgrade from the BBS, but it won't compile
programs that compile fine on ver 1.1

It cannot seem to find the include and library files. There is a
brief mention in the help file about new "environment variables",
but it doesn't say where to find them, create them, or even what
exactly they are.

This is what the Help File (sic) says :

" To install MPLAB-C, enter Windows, run the file SETUP.EXE on the
" distribution disk, and follow the prompts. Note that MPLAB-C will
" create two environment variables, INCLUDE andLIB. The INCLUDE
" environment variable gives the default directory for included
" files. For more information, refer to the #include directive.

The help on the #include directive gives no new information. It goes
on to say :

" The LIB environment variable gives the default directory for the
" libraries. If these environment variables are not specified, the
" path is searched for the appropriate files.

This is obviously the problem, but how do I solve it? I've set the
path and let the upgrade program have its way, but still no joy.
Sigh.

--
Friendly Regards

Tjaart van der Walt
EraseMEtjaartspam_OUTspamTakeThisOuTwasp.co.za
_____________________________________________________________
| Another sun-deprived R&D Engineer slaving away in a dungeon |
|             ASP International  http://wasp.co.za            |
|             GSM and GPS value-added applications            |
|  Voice : +27-(0)11-622-8686   |   Fax : +27-(0)11-622-8686  |
|_____________________________________________________________|

1997\02\26@171847 by Robert Lunn

flavicon
face
>It cannot seem to find the include and library files. There is a
>brief mention in the help file about new "environment variables",
>but it doesn't say where to find them, create them, or even what
>exactly they are.
>
>This is what the Help File (sic) says :
>
>" To install MPLAB-C, enter Windows, run the file SETUP.EXE on the
>" distribution disk, and follow the prompts. Note that MPLAB-C will
>" create two environment variables, INCLUDE andLIB. The INCLUDE
>" environment variable gives the default directory for included
>" files. For more information, refer to the #include directive.

       Well, this seems to answer your questions.  Environment
       variables are found in the environment ;), they're created
       with the DOS 'SET' command by definition, and as to what
       these particular environment variables are...

>" The LIB environment variable gives the default directory for the
>" libraries. If these environment variables are not specified, the
>" path is searched for the appropriate files.

       By extension, the 'INCLUDE' variable points to the directory
       containing the include files.

       It looks as though the setup program should have modified
       your 'autoexec.bat' file to define the new environment
       variables.  Perhaps your autoexec is non-standard?

       Try adding the following lines (suitably modified for your
       system) to your autoexec.bat file:

               SET LIB=c:\picstuff\cstuff\l;..\l;.\l
               SET INCLUDE=c:\picstuff\cstuff\h;..\h;.\h

       I'm _guessing_ that these variables operate like the PATH
       variable, in that they take a sequence of path names to be
       searched.

       In each case it's a typical system setup to have a 'common'
       directory (c:\picstuff\cstuff\l), a 'project common' dir-
       ectory (..\l), and a 'local' directory (.\l).

___Bob

1997\02\26@233505 by tjaart

flavicon
face
Robert Lunn wrote:
{Quote hidden}

Thanks. I checked the autoexec.bat, and it is OK. The MPLABC upgrade
is currently under suspicion because the 'old' version works fine.

--
Friendly Regards

Tjaart van der Walt
tjaartspamspam_OUTwasp.co.za
_____________________________________________________________
| Another sun-deprived R&D Engineer slaving away in a dungeon |
|             ASP International  http://wasp.co.za            |
|             GSM and GPS value-added applications            |
|  Voice : +27-(0)11-622-8686   |   Fax : +27-(0)11-622-8686  |
|_____________________________________________________________|

'MPLABC 1.21 HELP!!! Environment variables'
1997\02\26@235309 by Walter Banks

picon face
Robert Lunn wrote:
>

Enviroment variables LIB and INCLUDE have always been a
part of MPC and MPLABC. This is not new. The enviroment variable
PATH is also used in the #include <..> directive.


Walter Banks
http://www.bytecraft.com


'MPLABC 1.21 HELP!!!'
1997\03\03@004411 by David and Terri Novak
flavicon
face
You must put quotes around the path as such

SET LIB="c:\picstuff\cstuff"
SET INCLUDE="c:\picstuff\cstuff"


----------
{Quote hidden}


'I solved it!! (was Help!! Power on, reset problems'
1997\07\02@105149 by Lars Johansson 6018384
flavicon
face
Hi All.

I solved my random error with power up and reset.
It wasn't the watchdog (because I don't use it)
It wasn't slow Vcc rise time.

It was the Hi-tech C-compiler (Beta-3) who did it!!
I discovered that when I used the "Full optimization-function" in
the compiler, it didn't work.
So a warning to everybody who use Hi-tech C-compiler (Beta-3),
be careful when using "Full optimization".

Thanks to everybody who tried to help me.

Lars Johansson, Stockholm - Sweden.
RemoveMElrsTakeThisOuTspamstoa.mobile.telia.se
(sorry for my english)

1997\07\02@211317 by Andy Kunz

flavicon
face
>It was the Hi-tech C-compiler (Beta-3) who did it!!
>I discovered that when I used the "Full optimization-function" in
>the compiler, it didn't work.

So what was it about full optimization that did it?  Did you look at the
generated object code?  What did it do differently?

Andy

==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"
==================================================================

1997\07\03@040753 by Lars Johansson 6018384

flavicon
face
Hi all.

È>It was the Hi-tech C-compiler (Beta-3) who did it!!
È>I discovered that when I used the "Full optimization-function" in
È>the compiler, it didn't work.
È
ÈSo what was it about full optimization that did it?  Did you look at the
Ègenerated object code?  What did it do differently?
È
ÈAndy

I'm not really sure, but maybe it have something to do
with the code that saves away different register
before/after interrupt.

Unfortunally isn't my assembly skills so good
(thats why I use C), so I send some code so you can see
for yourself.

---------------------------------------------------------------
NO OPTIMIZATION:
saved_w
       ds        1
       psect        intcode
       bcf        status,5
       psect        intret,class=CODE,delta=2
       psect        intret
       global        int_restore
int_restore
       movf        saved_status,w
       movwf        status
       swapf        saved_w
       swapf        saved_w,w
       retfie
       psect        intentry,class=CODE,delta=2
       psect        intentry
       global        int_entry
int_entry
       movwf        saved_w
       movf        status,w
       movwf        saved_status
       psect        intsave,class=BANK0,space=1
       psect        intsave
saved_status        ds        1
       psect        intentry
---------------------------------------------------------------------------
---------------------------------------------------------------------------
WITH "FULL OPTIMIZATION":
       global        int_entry
       global        int_restore
       psect        intwsave,global,ovrld,class=BANK0,space=1
       psect        intret,global,class=CODE,delta=2
       psect        intentry,global,class=CODE,delta=2
       psect        intsave,global,class=BANK0,space=1
       psect        text2,local,class=CODE,delta=2
       
       psect        intwsave
saved_w
       ds        1
       
psect        intret
int_restore
       movf        saved_status,w
       movwf        3
       swapf        saved_w
       swapf        saved_w,w
       retfie

       psect        intentry
int_entry
       movwf        saved_w
       movf        3,w
       movwf        saved_status

       psect        intsave
saved_status
       ds        1
       psect        text2
-------------------------------------------------------------------

//Bye
Lars Johansson, Stockholm Sweden
spamBeGoneLRSspamBeGonespamstoa.mobile.telia.se
(sorry for my english)

1997\07\03@070303 by Mayes uk

flavicon
picon face
In message  <D221IXJ3MCFD*/R=A1/R=MRGST/U=LRS/@MHS.stoa.mobile.telia.se>
TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU writes:
> Hi All.
>
> I solved my random error with power up and reset.
> It wasn't the watchdog (because I don't use it)
> It wasn't slow Vcc rise time.
>
> It was the Hi-tech C-compiler (Beta-3) who did it!!
> I discovered that when I used the "Full optimization-function" in
> the compiler, it didn't work.
> So a warning to everybody who use Hi-tech C-compiler (Beta-3),
> be careful when using "Full optimization".
>

Any comments on this one, Clyde?


Regards,

Mike Watson

1997\07\03@073249 by Clyde Smith-Stubbs

flavicon
face
On Thu, Jul 03, 1997 at 10:46:53AM +0000, Mayes uk wrote:
>
> Any comments on this one, Clyde?

No,  Mike, not really. The beta is just that, a beta. It has bugs (though I
have no idea if the behaviour reported is due to a compiler bug or not).
No similar problem has been reported with the released version.

Clyde

--
Clyde Smith-Stubbs  |HI-TECH Software,      |Email: RemoveMEclydespamTakeThisOuThtsoft.com
Ph:  +61 7 3354 2411|P.O. Box 103, Alderley,|WWW:  http://www.htsoft.com/
Fax: +61 7 3354 2422|QLD, 4051, AUSTRALIA.  |PGP: finger clydeEraseMEspam.....htsoft.com
---------------------------------------------------------------------------
ANSI C for the PIC! Now shipping! See http://www.htsoft.com for more info.

1997\07\04@121343 by Gerhard Fiedler

picon face
At 21:31 03/07/97 +1000, Clyde Smith-Stubbs wrote:
>On Thu, Jul 03, 1997 at 10:46:53AM +0000, Mayes uk wrote:
>>
>> Any comments on this one, Clyde?
>
>No,  Mike, not really. The beta is just that, a beta. It has bugs (though I
>have no idea if the behaviour reported is due to a compiler bug or not).
>No similar problem has been reported with the released version.

Still considering your compiler as an option, I sure am interested to know
whether this specific problem is a bug, and whether this bug has been
resolved in the final version. Until you know what happened, you can't
tell, and I thought you might be interested in such stuff. I sure am.


-------------------------------------
Gerhard Fiedler <EraseMEgerhardspampobox.com>
S‹o Paulo - Brazil

1997\07\04@184725 by pic

flavicon
face
On Fri, Jul 04, 1997 at 04:12:21PM +0000, Gerhard Fiedler wrote:
>
> Still considering your compiler as an option, I sure am interested to know
> whether this specific problem is a bug, and whether this bug has been
> resolved in the final version. Until you know what happened, you can't
> tell, and I thought you might be interested in such stuff. I sure am.

Yes, I'm interested, but without more information, it's impossible to tell.
All bug reports we get, whether related to the beta or released versions,
are looked at. But so far I have only seen some out-of-context code
fragments (don't even know which chip is being used). My feeling at this
time is that the behaviour is coincidental, but there's not enough information
to tell.

Any bug reports should be sent to RemoveMEpicEraseMEspamEraseMEhtsoft.com. This is not really the
right place.

Clyde

--
Clyde Smith-Stubbs  |HI-TECH Software,      |Email: RemoveMEclydespam_OUTspamKILLspamhtsoft.com
Ph:  +61 7 3354 2411|P.O. Box 103, Alderley,|WWW:  http://www.htsoft.com/
Fax: +61 7 3354 2422|QLD, 4051, AUSTRALIA.  |PGP: finger RemoveMEclydeTakeThisOuTspamspamhtsoft.com
---------------------------------------------------------------------------
ANSI C for the PIC! Now shipping! See http://www.htsoft.com for more info.

1997\07\05@160418 by Gerhard Fiedler

picon face
At 08:46 05/07/97 +1000, Clyde Smith-Stubbs wrote:
>Any bug reports should be sent to EraseMEpicspamspamspamBeGonehtsoft.com. This is not really the
>right place.

If it is something that appears (or appeared) in the full version, I think
this _is_ the right place. There's of course no better place than this list
for _all_ bug reports concerning _all_ PIC compilers (whether fixed
afterwards or not), don't you think? :-)


-------------------------------------
Gerhard Fiedler <RemoveMEgerhardKILLspamspampobox.com>
S‹o Paulo - Brazil

1997\07\05@165645 by Clyde Smith-Stubbs

flavicon
face
On Sat, Jul 05, 1997 at 08:03:56PM +0000, Gerhard Fiedler wrote:
> At 08:46 05/07/97 +1000, Clyde Smith-Stubbs wrote:
> >Any bug reports should be sent to picSTOPspamspamspam_OUThtsoft.com. This is not really the
> >right place.
>
> If it is something that appears (or appeared) in the full version, I think
> this _is_ the right place. There's of course no better place than this list
> for _all_ bug reports concerning _all_ PIC compilers (whether fixed
> afterwards or not), don't you think? :-)

No, I don't. The reason is that there's no guarantee that the bug report
will get to us, list mail is not 100% reliable. I think this thread has
taken up far too much space on the list, so perhaps we can put an end
to it. Here are the facts as I have seen them on the list:

1) Someone posted a message saying their program randomly failed to come up
  after reset;
2) That person then posted a message saying they were using the Beta3 version
  of our compiler, and that turning OFF optimization cured the problem;
3) Some code fragments were posted showing the interrupt save/restore code
  with and without optimization - but the two pieces of code were identical.
4) No other information has been provided on the list - not even the particular
  chip involved.
5) No contact has been made directly with us about it.

The above does not constitute a bug report, and has no bearing
on the released version of the software. If anyone has a bug report related
to the beta 3 version then we are very interested to hear about it - we
will verify if it still exists. We can't do that with the above information
because it does show anything.



--
Clyde Smith-Stubbs  |HI-TECH Software,      |Email: spamBeGoneclydeSTOPspamspamEraseMEhtsoft.com
Ph:  +61 7 3354 2411|P.O. Box 103, Alderley,|WWW:  http://www.htsoft.com/
Fax: +61 7 3354 2422|QLD, 4051, AUSTRALIA.  |PGP: finger KILLspamclydespamBeGonespamhtsoft.com
---------------------------------------------------------------------------
ANSI C for the PIC! Now shipping! See http://www.htsoft.com for more info.


'Please help!!! with bar code reader proyect'
1998\03\24@205045 by Cesar E. H. White
flavicon
face
Hi:

I am attempting to do the following project.  If anyone has done a
similar project or part, there of  I would appreciate any advice or
suggestions you may have.

I need to do a cheap bar code reader, compare the code with some data
previusly stored in a EEPROM (may be serial EEPROM 96LC54),ask a code
password altrought a 3x4  keypad, compare bar code id with password
and if its rigth, open a door (don't forget first how store the
initial values for bar code id's), Im thinking in use the
PIC16C84-04/P

Thanks in advance

Cesar E. H. White

1998\03\24@234631 by tjaart

flavicon
face
Cesar E. H. White wrote:

> Hi:
>
> I am attempting to do the following project.  If anyone has done a
> similar project or part, there of  I would appreciate any advice or
> suggestions you may have.
>
> I need to do a cheap bar code reader, compare the code with some data
> previusly stored in a EEPROM (may be serial EEPROM 96LC54),ask a code
> password altrought a 3x4  keypad, compare bar code id with password
> and if its rigth, open a door (don't forget first how store the
> initial values for bar code id's), Im thinking in use the
> PIC16C84-04/P
>
> Thanks in advance
>
> Cesar E. H. White

Use one of these cheap readers that go between your keyboard and the PC.

The reader does all the work and spit out characters.

--
Friendly Regards

Tjaart van der Walt
EraseMEtjaartspamEraseMEwasp.co.za
_____________________________________________________________
| WASP International http://www.wasp.co.za/~tjaart/index.html |
|       R&D Engineer : GSM peripheral services development    |
|   Vehicle tracking | Telemetry systems | GSM data transfer  |
|    Voice : +27-(0)11-622-8686 | Fax : +27-(0)11-622-8973    |
|              WGS-84 : 26¡10.52'S 28¡06.19'E                 |
|_____________________________________________________________|


'Pic programming problem Need Help!!'
1998\07\13@211227 by Brian Gracia
picon face
Hello,

I usually lurk, and send info to the list when I know something about the
subject, which is rare.

I am having trouble trying to learn pic code.  It could be the fact that I
have not programmed a pic yet.  I am still getting my programmer built.
What I am doing is reading all I can and trying to follow along with the
examples.

Where I am lacking is in the fact that while I can program in several
computer languages, pic code is just not the same!!!  Can someone help me
by translating some simple program building blocks like IF..Then, Do
While..Loop, For I.., etc into pic code.  I need to see these in order to
get a basic footing, and then I can begin to understand.  Doing this is
like showing someone how to read a tape measure.  Pretty soon, with a set
of plans (psudo code), and the basic building blocks, they can build a
house.  Well almost, but you get my drift.

Brian

1998\07\13@233349 by Gary Bach

flavicon
face
Brian, check out my Web site for a PicBasic programmer. It uses PIC Basic If
then, For Next etc. Why not write your programs in basic?
I also have EPIC Programmers listed if you have any problems with your
Programmer (The one you are building). This is a brand new web site, so
don't expect too much. I have also added many links to other PIC sites. Good
Luck, Gary. Contact me direct if you need more help. I don't want to clog up
the use group. @spam@gbach@spam@spamspam_OUTsiscom.net
http://www.siscom.net/~gbach



> {Original Message removed}

1998\07\14@031328 by g.daniel.invent.design

flavicon
face
Hi Brian,
You're very lucky with PIC, Microchip provide what would normally be an
expensive development tool free of charge over the internet and on their
CDroms.

This is "MPLAB", load it on to a windows OS PC and then open one of the
demonstration projects.  Use the online help to check out instruction
set, debugging features etc and then simulate running on screen with the
single step icon.  By opening up a "watch" window, and [ins]erting
program variables, special function registers, you can get a good feel
for what makes a PIC tic.

Decision making processes ie if...then... must be replaced with btfss,
btfsc, decfsz, incfsz.   The PIC will only skip single instructions as
result of these decisions, it is your responsibility to insert a goto,
call, or other opcode to achieve your "then" action.   Don't think that
because the instructions are very simple that you cannot achieve very
complex tasks.

typically, a for next type loop is done like this:

       movlw   d'100'                  ;  d'100', d '__' for decimal.
       movwf   any_counter_register
arbitary_loop_name              ;<---------
                                       ;  |
       call    repeated_action_sub     ;  | <-unconditional call repeated 100 t
imes
       btsfc   any_counter_register,0  ;  | skip next instr IF bit 0 of counter
clear
       call    adjust_on_odd_counter   ;  | any_counter_register must be odd, d
o
sub.
                                       ;  |
       decfsz  any_counter_register    ;  |
       goto    arbitary_loop_name      ;--

* You can nest the above structures, especially to get more than 256
counts.

* Beware, starting a decfsz loop with 0 in the file register will cause
a loop count of   256 as decfsz tests for zero condition AFTER the
decrement.

* when you are ready, check out "table reads", these can perform the
equivalent of data/string, on condition.. goto.. .. .. .. ..
structures.  Destination calculated jumps can have retlw instructions
with table values, GOTO.. instructions etc.

These are some of the PIC basics, also remember that 0=output,1=input
when setting port directions, this is different to many other MICROs
regards,
Graham Daniel.

Brian Gracia wrote:
{Quote hidden}

1998\07\14@071542 by hatfield

flavicon
face
Brian Gracia wrote:
>
> Hello,
>
> I usually lurk, and send info to the list when I know something about the
> subject, which is rare.
>
> I am having trouble trying to learn pic code.  It could be the fact that I
> have not programmed a pic yet.  I am still getting my programmer built.
> What I am doing is reading all I can and trying to follow along with the
> examples.
>
> Where I am lacking is in the fact that while I can program in several
> computer languages, pic code is just not the same!!!  Can someone help me
> by translating some simple program building blocks like IF..Then, Do
> While..Loop, For I.., etc into pic code.  I need to see these in order to
> get a basic footing, and then I can begin to understand.  Doing this is
> like showing someone how to read a tape measure.  Pretty soon, with a set
> of plans (psudo code), and the basic building blocks, they can build a
> house.  Well almost, but you get my drift.

There's no substitute for a good book like "Pic N Start" or
Myke Predko's "Programming and Customizing the Pic....".  They
teach you one or two instructions at a time, give examples
and often include an actual program that you can run on hardware
or a software emulator.

Fred.
spamBeGonefred.hatfieldspamKILLspamsstar.com
New Orleans

1998\07\14@095755 by lilel

flavicon
face
Brian Wrote:

> Hello,
>
> I usually lurk, and send info to the list when I know something
> about the subject, which is rare.
>
> I am having trouble trying to learn pic code.  It could be the fact
> that I have not programmed a pic yet.  I am still getting my
> programmer built. What I am doing is reading all I can and trying to
> follow along with the examples.


Quick, download a free copy of MPlab from Microchip.  You don't have
to program parts to see the code run, it will run fine as a
"simulator".    When you have trouble getting it running, call their
800 number.  They are very helpful.  Don't bother making a programmer
for a while, you are not even close to programming a part if you are
moving at the same speed I was.


I often use comments to write "pseudocode" next to my assembler.
Some people even consider this good technique, thus:

SOME_LOOP     ; WHILE  X > 0

          ; .... SOME CODE .....


           DECFSZ  X, F              ; X=X-1
           GOTO SOME_LOOP  ; SKIP IF X=0
                              ; END WHILE


-- Lawrence Lile

    "An Engineer is simply a machine for
     turning coffee into assembler code."

Download AutoCad blocks for electrical drafting at:
http://home1.gte.net/llile/index.htm

1998\07\14@121805 by Peter L. Peres

picon face
On Mon, 13 Jul 1998, Brian Gracia wrote:
-snip-
>
> Where I am lacking is in the fact that while I can program in several
> computer languages, pic code is just not the same!!!  Can someone help me
> by translating some simple program building blocks like IF..Then, Do
> While..Loop, For I.., etc into pic code.  I need to see these in order to
> get a basic footing, and then I can begin to understand.  Doing this is
> like showing someone how to read a tape measure.  Pretty soon, with a set
> of plans (psudo code), and the basic building blocks, they can build a
> house.  Well almost, but you get my drift.

Since you already know a few other languages, analyze how you picked
the(m) up. Do you learn best by yourself, in class, from an organized
course, or are you the kind that rips things apart to learn what's inside
? Then, pick a learning method that suits you best.

A book is a good start, if you are that kind of guy. If you learn by
yourself, simply learn the instruction set by heart and start doing some
simple applications (peek at the application notes from Microchip in the
process). If you like to program using templates, get a book. The author
usually uses his own programming style throughout, and that is as good
a 'template' as any.

Translating structured programming constructs into PIC assembly is not so
direct as you might think it is.

For example for an IF...THEN...ELSE you would have to work out an
expression for the IF part that sets a bit or a register and write code
like this:

       ; IF
       ; code for if-expression here

       ; final comparison: ZF of the PSW is not set IF true (C convention)
       btfsc   PSW, ZF
       goto    if_false

       ; THEN
       ; code for true case here

       goto    if_end

       ; ELSE
if_false:
       ; code for false case here

if_end:
       ; FI

Notice that there is no boilerplate code, only the structure of the code
is essential. You have to find a solution for every case as you go, there
is no real constraint in a symmetrical-register architecture machine as
the PIC is.

DO..WHILE etc translate much in the same way. You keep the general
structure of the construct, but you implement it with the mnemonics that
get you to your goal. Putting labels with structured construct part names
in them into the source will help you understand the code later.

Notice that remarkably few advanced assembly programmers bother about
structured code construction on PICs ;) Hack mode is much more natural <G>

hope this helps,

       Peter

1998\07\15@133516 by philb

flavicon
face
Brian,

You're right, the hardest part is getting started.  You might try some
of the sample programs off the Parallax site.  In addition, Dantronics
has put Scott Edwards Electronics PIC Source Book online at
http://dontronics.com/see.html.

Some of his implementation is more difficult than it needs to be IMO,
but it's great to see someone else's code to get started.  It was a HUGE
help getting started.



Brian Gracia wrote:
>
<snip>
> Where I am lacking is in the fact that while I can program in several
> computer languages, pic code is just not the same!!!  Can someone help me
> by translating some simple program building blocks like IF..Then, Do
> While..Loop, For I.., etc into pic code.  I need to see these in order to
> get a basic footing, and then I can begin to understand....


'HyperTerminal help!!'
1999\01\06@091100 by chrispian khoo
picon face
part 0 2846 bytes
i got a problem here, as u know i'm doing a project on sending and
receving datas. as i sent out the converted values from my pic16c73 to
the hyperterminal display, it showed something what i call garbage on
the hyperterminal's window display. therefore what i did is to separate
out the hex byte into two ascii characters.  afterthat i sent both of
the characters back the display showed nothing. here's the codes that i
used, hope someone will be able to sort it out.

;-----------------------------------------------------------------
;HEX TO ASCII CONVERSION
;-----------------------------------------------------------------

       MOVF    ADRES,W         ;GET THE ADC VALUE FROM ADRES'S REGISTER
       ANDLW   0X0F            ;MASK HI NIBBLE
       CALL    HEX2ASC         ;HEX TO ASCII CONVERSION
       MOVWF   LS_DIG          ;STORE
       SWAPF   ADRES,W         ;GET COPY OF HEX BYTE, SWAP MS/LS
       ANDLW   0X0F            ;MASK HI NIBBLE
       CALL    HEX2ASC         ;HEX TO ASCII CONVERSION
       MOVWF   MS_DIG          ;STORE

HEX2ASC MOVWF   STORE           ;STORE COPY OF HEX DIGIT
       SUBLW   0X09            ;SUBTRACT W FROM 1 LESS THAN 0X0A
       BTFSS   STATUS,0        ;A SELECTION BETWEEN THE NEXT TWO INSTRUCTIONS
       GOTO    ADD37
       GOTO    ADD30

ADD37   MOVF    STORE,W         ;GET HEX DIGIT
       ADDLW   0X37            ;0X0 - 0X9
       RETURN

ADD30   MOVF    STORE,W         ;GET HEX DIGIT
       ADDLW   0X30            ;0XA - 0XF
       RETURN


;---------------------------------------------------------------
;SUBROUTINES
;TO SEND CHAR IN W TO UART
;---------------------------------------------------------------

       BCF     STATUS,RP0              ;ENSURE IT'S IN THE LOWER RAM BANK
       MOVF    MS_DIG,W                ;W -> MS_DIG
       MOVWF   TXREG                   ;DATA REGISTER

;TX LOOP - WAIT IN THIS LOOP UNTIL IT'S CLEAR TO SEND THE NEXT CHARACTER
       BSF     STATUS,RP0              ;SELECT REGISTER BANK 1
TXC1    BTFSS   TXSTA,1                 ;TRMT BIT
       GOTO    TXC1                    ;IF BUFFER IS EMPTY, SEND ANOTHER CHARAC
TER

       BCF     STATUS,RP0              ;SELECT BANK0
       MOVF    LS_DIG,W                ;W -> LS_DIG
       MOVWF   TXREG                   ;DATA REGISTER

;TX LOOP - WAIT IN THIS LOOP UNTIL IT'S CLEAR TO SEND THE NEXT CHARACTER
       BSF     STATUS,RP0              ;SELECT REGISTER BANK 1
TXC2    BTFSS   TXSTA,1                 ;TRMT BIT
       GOTO    TXC2                    ;IF BUFFER IS EMPTY, SEND ANOTHER CHARAC
TER
       GOTO    INT_RETURN              ;LOOP BACK TO RETURN

take care!!
bye.


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Attachment converted: wonderland:p98069.asm (TEXT/CSOm) (00025321)

1999\01\06@230709 by Ray Doerr

picon face
   The garbage you are referring to is likely control characters,  Most
control character are characters that are under ASCII value 32.  ASCII 32 is
the space.  I use a program call Crosstalk Mark 4 for DOS.  This program has
a very neat Debug feature that will display the incoming data on the
terminal screen as well as display the Debug data in a separate window that
can be set to show the data is Hex, Decimal etc.  I find this very usefull
when working on RS232 projects that have a none standard data stream.  I
hope this helps.  Crosstalk software is a product from Attachmate which are
formerly DCA.
   If you need help finding the software, I may be able to help.


Thanks
Ray Doerr

{Original Message removed}

1999\01\07@153753 by Alice Campbell

flavicon
face
{Quote hidden}

it sounds to me like you need to convert from binary to decimal.  say
a byte in a regiser is b'01101011'.  if you convert it to ascii, you
get ascii code 106, which is lowercase 'j'.  but if this is the
result of an adc conversion, it really means 106/256.  you might need
an intermediate step that takes the binary to decimal and put out a
3-digit decimal to the output device.  there are lots of codes
avaialable, all better than mine.  i remember a particularly nice one
floated by the list last month.

alice
alice


'Again, Pic based LAN tester HELP!!!'
1999\02\09@113811 by Gabriel Caffese
picon face
PLEASE, HELPMEEEE!!!!!

Hi!,
   I am planning to build tester for LANs, that may show you the traffic in
the network at certain periods of time, like:
   1- Instant traffic.
   2- Last 10 seconds traffic.
   3- Last minute traffic., etc, etc.
   I am interested on knowing how to see when the lan cable is being
used -so at that moment there is traffic over the network- and
the rest of mathematics will be done by the PIC processor I choose.
   So if someone has an idea, please write.

           Thanks.-

     Gabriel Caffese
    UNLP - La Plata
.....gabrielsdispam_OUTspaminame.com

1999\02\10@063438 by Pasi T Mustalahti

picon face
On Wed, 10 Feb 1999, Gabriel Caffese wrote:

> PLEASE, HELPMEEEE!!!!!
>
> Hi!,
>     I am planning to build tester for LANs, that may show you the traffic in
> the network at certain periods of time, like:
>     1- Instant traffic.
>     2- Last 10 seconds traffic.
>     3- Last minute traffic., etc, etc.
>     I am interested on knowing how to see when the lan cable is being
> used -so at that moment there is traffic over the network- and
> the rest of mathematics will be done by the PIC processor I choose.
>     So if someone has an idea, please write.

PTM: You don't need a PIC to see if a Ethernet line is alive. You need two
FET, a LED, a couple of resistors, a cap and three diodes.
And 2xAAA batteries to run it for hundreds of hours.

--------------------------------------------------------------------------
PTM, TakeThisOuTptmusta.....spamTakeThisOuTutu.fi, http://www.utu.fi/~ptmusta                 OH1HEK
Lab.ins. (mikrotuki) ATK-keskus/Mat.Luon.Tdk                    OI7234
Lab.engineer (PC support) Computer Center
Mail: Turun Yliopisto / Fysla,  20014 Turku
Pt 02-3336669, FAX 02-3335632 (Pk 02-2387010, NMT 0400-555577)
--------------------------------------------------------------------------


'PIC17Cxxx Urgent HELP!!'
1999\12\13@102416 by Mauricio Jancic
flavicon
face
Hi all, here I'm again having problems. This time I'm using a PIC17C756. All I want to do is to read the portf. I've set this port as analog inputs and configure the corresponding pins as inputs or otputs, like this:


       movlb   5
       movlw   0x0E
       movpf   WREG, ADCON1
       clrf    PORTF, f
       movlw   0xF3
       movwf   DDRF
       

Then, I just go to this routine, wich reads the port data and send it to a routine that print it on a LCD display
Important: I clear pins 2 and 3 because i conected on this port a matrix keyboard, so when I press a key it "sends" the '0' present at one pin to another pin of the PIC. All pins have a 10k pull-up. I also try putting pins 0 and 1 to Vcc (by hard) but it didn't change the value read by the pic.

Main
       movlb   5               ; Bank 5
       clrwdt
       bcf     Teclado, 2      ;
       bcf     Teclado, 3
       
tel     movfp   PORTF, WREG             ; Read PORTF
       andlw   0xF3                    ; Mask to evitate unwanted data from unu
sed pins (4 and 5)
       call    lcd_wrtlcd              ; print data to lcd
       movlb   5
       clrwdt
       
       call    delay                   ;wait
       call    delay
       call    delay
       call    delay
       
       movlb   0                       ; Send lcd cursor to home
       movlw   2
       movwf   DISPLAY
       
       movlb   1
       bcf     LCDCTRL,RS
               call    lcd_pulsoE
               call    delay
       goto    tel                     ; go  back and read PORTF again


Thank!!

Mauricio Jancic

1999\12\13@123339 by Quitt, Walter

flavicon
face
Here is a code snipet of how I have done it:

;***************************************************************
;* Read_Configuration
;*
;*   Reads the configuration voltage to determine the number
;*   of FETs or FET boards to determine system power level.
;*   This uses Port G RG3:AN0 as an analog channel
;*
;*   It also messes with other ports so must be done early
;*   in/during init (pg 178)
;*
;*   GLOBAL Interrupts MUST be OFF!
;*   Since this is only called at init we can use software
;*   loop timeouts for waiting for ADC conversions.
;*
;***************************************************************
Read_Configuration
  ; ** First assume NO Configuration Fault ********************
  movlr  STATES
  movlw  FALSE
  movwf  CONFIG_FAULT_STATE

  ; ** SETUP for ADC conversions ******************************
  movlb  5           ;Bank 5 is ADCON bank

  ; ** pg179 1. Config anlaog pins/ V ref, and digital I/O **
  movlw  B'10101100' ;64T Clock select, output right justified,
                     ; AN9,8,1,0 are inputs, A/D ref is AVdd and AVss
  movfp  WREG,ADCON1 ;

  ; ** pg179 1. Select A/D input channel **
  movlw  B'00000001' ;AN0,NO Conversion running, Converter is ON
  movfp  WREG,ADCON0 ;  NOTE: AN0 is Port G bit 3

  ; ** pg 179 3. Wait the required acquisition time **
  ; Recall 1 instruction is 4Q cycles = 4*1/28MHZ = 4*35ns = 140ns
  ; So 255 * 140ns is 35,700ns = 35us which is good enough
  ; for a Tacq as shown on pg181
  movlr  0
  movlw  H'FF'
  movwf  TEMP_0
Read_Configuration_Wait_loop
  decfsz WREG,F
  goto   Read_Configuration_Wait_loop

  ; ** pg179 4. Start Conversion **
  bsf     ADCON0,GO

  ; ** pg179 5. Wait for A/D conversion to complete by polling GO/DONE
**
Read_Configuration_Wait
  btfsc   ADCON0,GO
  goto    Read_Configuration_Wait

  ; ** pg179 6. Read A/D result out of ADRESH and ADRESL in Bank 5 **


{Original Message removed}

1999\12\13@125825 by Mauricio Jancic

flavicon
face
Thanks Walter, but I think I don't explain myself very good. What I'm trying to do is simply to read the PORTF contents. I have tryied to do the basic thing I can do: I put all the port as input, read it and print it on the LCD. Please if you can help me on this I'll apreciate it. For a more detail explanation read again my message and try to undestand it, cause english is no my first language as you can see...

       Thanks again,

       Mauricio Jancic

-----Mensaje original-----
De:     Quitt, Walter [SMTP:TakeThisOuTwquittKILLspamspamspamMICROJOIN.COM]
Enviado el:     Lunes, 13 de Diciembre de 1999 02:31 p.m.
Para:   .....PICLISTspamRemoveMEMITVMA.MIT.EDU
Asunto: Re: PIC17Cxxx Urgent HELP!!

Here is a code snipet of how I have done it:

;***************************************************************
;* Read_Configuration
;*
;*   Reads the configuration voltage to determine the number
;*   of FETs or FET boards to determine system power level.
;*   This uses Port G RG3:AN0 as an analog channel
;*
;*   It also messes with other ports so must be done early
;*   in/during init (pg 178)
;*
;*   GLOBAL Interrupts MUST be OFF!
;*   Since this is only called at init we can use software
;*   loop timeouts for waiting for ADC conversions.
;*
;***************************************************************
Read_Configuration
  ; ** First assume NO Configuration Fault ********************
  movlr  STATES
  movlw  FALSE
  movwf  CONFIG_FAULT_STATE

  ; ** SETUP for ADC conversions ******************************
  movlb  5           ;Bank 5 is ADCON bank

  ; ** pg179 1. Config anlaog pins/ V ref, and digital I/O **
  movlw  B'10101100' ;64T Clock select, output right justified,
                     ; AN9,8,1,0 are inputs, A/D ref is AVdd and AVss
  movfp  WREG,ADCON1 ;

  ; ** pg179 1. Select A/D input channel **
  movlw  B'00000001' ;AN0,NO Conversion running, Converter is ON
  movfp  WREG,ADCON0 ;  NOTE: AN0 is Port G bit 3

  ; ** pg 179 3. Wait the required acquisition time **
  ; Recall 1 instruction is 4Q cycles = 4*1/28MHZ = 4*35ns = 140ns
  ; So 255 * 140ns is 35,700ns = 35us which is good enough
  ; for a Tacq as shown on pg181
  movlr  0
  movlw  H'FF'
  movwf  TEMP_0
Read_Configuration_Wait_loop
  decfsz WREG,F
  goto   Read_Configuration_Wait_loop

  ; ** pg179 4. Start Conversion **
  bsf     ADCON0,GO

  ; ** pg179 5. Wait for A/D conversion to complete by polling GO/DONE
**
Read_Configuration_Wait
  btfsc   ADCON0,GO
  goto    Read_Configuration_Wait

  ; ** pg179 6. Read A/D result out of ADRESH and ADRESL in Bank 5 **


{Original Message removed}

1999\12\13@131939 by Ismael M. Khangane

flavicon
face
Hola
Mauricio:
tengo que ir maqana te voy a decir que lo que pasa. Pasari el code tuyo.
Chaos,
Ismael.
*******
Mauricio Jancic escribis:

> Thanks Walter, but I think I don't explain myself very good. What I'm trying t
o do is simply to read the PORTF contents. I have tryied to do the basic thing I
can do: I put all the port as input, read it and print it on the LCD. Please if
you can help me on this I'll apreciate it. For a more detail explanation read a
gain my message and try to undestand it, cause english is no my first language a
s you can see...
{Quote hidden}

> {Original Message removed}

1999\12\13@132145 by Quitt, Walter

flavicon
face
The code reads AN0.  You need to change it to read ANx
(where x is the analog port number)  It does it
in NON real time.  It is straight code.  Just
execute it to read your analog port.

I STRONGLY suggest you read the data sheet (book)
for the 756.  There are MANY places to make mistakes.

The referenced code to several days to work out.
I don't remeber how it all works all the time.

Review the code and check it against the referenced
sections it the data sheet.

Good Luck,
Walt....

{Original Message removed}

1999\12\13@134233 by Mauricio Jancic

flavicon
face
Hi again, there is a missunderstanding here. I'm NOT trying to read the analog port. I want to read the digital port. I mean RF0..RF7. I think you don't understand me, but may be i didn't understand you, if so please sorry.

       Mauricio Jancic

-----Mensaje original-----
De:     Quitt, Walter [SMTP:TakeThisOuTwquittspamspamMICROJOIN.COM]
Enviado el:     Lunes, 13 de Diciembre de 1999 03:20 p.m.
Para:   PICLISTEraseMEspamMITVMA.MIT.EDU
Asunto: Re: PIC17Cxxx Urgent HELP!!

The code reads AN0.  You need to change it to read ANx
(where x is the analog port number)  It does it
in NON real time.  It is straight code.  Just
execute it to read your analog port.

I STRONGLY suggest you read the data sheet (book)
for the 756.  There are MANY places to make mistakes.

The referenced code to several days to work out.
I don't remeber how it all works all the time.

Review the code and check it against the referenced
sections it the data sheet.

Good Luck,
Walt....

{Original Message removed}

1999\12\13@143644 by - KITS EDUCACIONAIS NACIONAIS

flavicon
face
Quitt, Walter wrote:
>
> The code reads AN0.  You need to change it to read ANx
> (where x is the analog port number)  It does it
> in NON real time.  It is straight code.  Just
> execute it to read your analog port.
>
> I STRONGLY suggest you read the data sheet (book)
> for the 756.  There are MANY places to make mistakes.
>
> The referenced code to several days to work out.
> I don't remeber how it all works all the time.
>
> Review the code and check it against the referenced
> sections it the data sheet.
>
> Good Luck,
> Walt....

MPLABC17 has many 17CXX C samples... Easy to understand...easy to convert to Ass
embly...

Miguel

'PIC17Cxxx Urgent HELP!!( A suggest from Ismael )'
1999\12\14@111633 by Ismael M. Khangane

flavicon
face
Hi Brother Mauricio:
Here I am for the first time to discuss the problem on reading and writting of port F whereas the same probrem might appears when u do the same to the port G as both of them they  incorporate
Analog- to-Digital conversors and capture/PWM respectively. As I passed through ur codes I suggest to u 1st. to make sure that  specify  them well i.e. when u put down:
...
       movlb   5
       movlw   0x0E                         ; bit0-A/D's ref are Vcc and Vss as bit3:1 are '111' then and the
       movpf   WREG, ADCON1    ;  rest are bit7-4 '0's so u have Digital I/O all the port.

       clrf    PORTF, f                      ; This is important too for this port, clearing all the latches!!
       movlw   0xF3                         ; Now here: B'11110011' so bit2 and bit3 are outputs I agree
       movwf   DDRF                       ; with u but I ask u why didin't send data directly as they  are
                                                      ;already masked!
       This ones I don't understand them? u wanted to send them to the port as output '0'? why u didn't go straight? if that was ur  aim, of course, as far as I don't see the movement from out to inside the PIC.
       bcf     Teclado, 2      ;
       bcf     Teclado, 3

2nd. I suggest that it is better to use file 'p' whenever u want to move data in or out the peripheral
if it 's the destine file.
For example here i will prefer:

      tel     movpf   PORTF,WREG
lather than
      tel     movfp   PORTF, WREG             ; Read PORTF
But all is my suggest u the decision is urs, of course.

Even though I didn't might solve the problem what I did is to follow the 'code'...
So if I made any mistake or wrong u are free to tell me and this I think is the only way we beginners we can help to each other.  I will send to u within these days all complete codes I have done for PIC17C756.

Regards,
Have a nice day,
Ismael ( Spain ).



*****************************************************************
Mauricio Jancic escribis:

{Quote hidden}

> {Original Message removed}


'I2C on an PIC16F873 HELP!!'
2000\03\30@115923 by Oscar
flavicon
face
Hello

Can someone tell me how you put the F873 in I2C master mode and begin
communication on the I2C bus. e.g. which bits do I set (and clear) to
start, send and receive from the bus.

-x-tal is 4 MHz
-device to communicate with is an 24LC01B

Best regards
Oscar


'[PICLIST] Free Programmer software? HELP!!'
2000\10\01@001909 by Brian Gracia
flavicon
face
Hello Everyone,

I currently use Pic16Pro Light to program my pics.  I am having trouble
getting them to run.  I was having trouble with a DT001 programmer and
Windows 2000, but I solved that and a screen refresh problem I was having.

Now I have another problem.  I have gotten pics to program and run before
with no problem.  I am now having a problem getting Blink to work.  I have
verified all circuit wiring, so I know that is not a problem.  I have
narrowed it down to the following.  I edited 16F84.INC an switched the OSC
to HS.  I previously could not get a pic to run unless I used the HS mode
for a 3pin 4MHz resonator.  The pic programs ok and verifies ok.  But when
I read back the code from the pic, I notice that the OSC setting is wrong
on the screen.  When I load a hex file, the program comes up with the
correct OSC, but on program and read back, the OSC is different.  It is RS.
I know that this will not get the pic up and running, so I am looking for
other software.

Can anyone offer a solution to my problem or does anyone know of any other
DOS based software that will run with a DT001 programmer?

Thanks,
Brian Gracia

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2000\10\01@073619 by xandinho

flavicon
face
>for a 3pin 4MHz resonator.  The pic programs ok and verifies ok.  But when
>I read back the code from the pic, I notice that the OSC setting is wrong
>on the screen.  When I load a hex file, the program comes up with the
>correct OSC, but on program and read back, the OSC is different.  It is RS.
> I know that this will not get the pic up and running, so I am looking for
>other software.

       The same happens with me. P200MMX, NoPPP, Windows 98 and NoPPP for windows (wow, great proggie!). The solution I found: change the setting from one type of oscilator to another, and so to the type I want to use. It always works :o)


--------------8<-------Corte aqui-------8<--------------

       All the best!!!
       Alexandre Souza
       EraseMExandinhospam@spam@interlink.com.br

--------------8<-------Corte aqui-------8<--------------

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.



'[OT]: Help!!! - Fitting web pages to printer'
2000\12\05@222633 by Russell McMahon
picon face
I've searched all over for a solution to this (and I know it exists) but
can't find anything useful, so ...

When printing web pages, often enough one finds that the page does not print
as displayed and the right hand side is truncated by a variable amount. I
believe this problem is at least partially browser and printer independent.
No amount of fiddling with margins, font etc solves the problem completely.
I believe that some printer makers bundle software with their printers
specifically to solve this problem. I know that other people also experience
this problem.

Has anyone got a generic solution.



     Russell McMahon
_____________________________

What can one man* do?
Donate food daily free !!! -  http://www.thehungersite.com/

http://www.rawa.com  - one perspective on Afghanistan
http://www.changingourworld.com    http://www.easttimor.com   http://www.sudan.com

(* - or woman, child or internet enabled intelligent entity :-))

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2000\12\06@022152 by Nigel Goodwin

flavicon
face
In message <001301c05f34$abe19640$673061cb@mkbs>, Russell McMahon
<@spam@apptechspam_OUTspam.....CLEAR.NET.NZ> writes
>I've searched all over for a solution to this (and I know it exists) but
>can't find anything useful, so ...
>
>When printing web pages, often enough one finds that the page does not print
>as displayed and the right hand side is truncated by a variable amount. I
>believe this problem is at least partially browser and printer independent.
>No amount of fiddling with margins, font etc solves the problem completely.
>I believe that some printer makers bundle software with their printers
>specifically to solve this problem. I know that other people also experience
>this problem.

HP provide a program for this, it can be downloaded from their website,
but I don't know if it works with other printers or not?.
--

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : spamBeGonenigelgEraseMEspamlpilsley.co.uk           |
       | Lower Pilsley   | Web Page : http://www.lpilsley.co.uk       |
       | Chesterfield    | Official site for Shin Ki and New Spirit   |
       | England         |                 Ju Jitsu                   |
       \--------------------------------------------------------------/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body


2000\12\06@032007 by Matthew Fries

flavicon
face
What browser are you using?

I tried the new Netscape 6, and it seemed to print the pages a lot smarter
than previous versions of netscape. This may not work for you. Try it.



At 07:20 AM 12/6/2000 +0000, you wrote:
{Quote hidden}

Remove the BALONEY from my email address.
-----------------------------------------------------
Matthew Fries       Minneapolis, MN    USA
.....freezeSTOPspamspam@spam@baloneyvisi.com

"Quit eating all my *STUFF*!" - The Tick

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2000\12\06@045752 by Ken Walker

flavicon
picon face
OPERA 4....

lets you set printer scaleing......

:-)


kenny baby
,
,

-----Original Message-----
From: Matthew Fries [RemoveMEfreezespamspamBeGoneVISI.COM]
Sent: 06 December 2000 8:21
To: spamBeGonePICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Subject: Re: [OT]: Help!!! - Fitting web pages to printer


What browser are you using?

I tried the new Netscape 6, and it seemed to print the pages a lot smarter
than previous versions of netscape. This may not work for you. Try it.



At 07:20 AM 12/6/2000 +0000, you wrote:
>In message <001301c05f34$abe19640$673061cb@mkbs>, Russell McMahon
><apptechspam_OUTspam@spam@CLEAR.NET.NZ> writes
>>I've searched all over for a solution to this (and I know it exists) but
>>can't find anything useful, so ...
>>
>>When printing web pages, often enough one finds that the page does not
print
>>as displayed and the right hand side is truncated by a variable amount. I
>>believe this problem is at least partially browser and printer
independent.
>>No amount of fiddling with margins, font etc solves the problem
completely.
>>I believe that some printer makers bundle software with their printers
>>specifically to solve this problem. I know that other people also
experience
{Quote hidden}

Remove the BALONEY from my email address.
-----------------------------------------------------
Matthew Fries       Minneapolis, MN    USA
spamBeGonefreezespam_OUTspamRemoveMEbaloneyvisi.com

"Quit eating all my *STUFF*!" - The Tick

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservspamRemoveMEmitvma.mit.edu with SET PICList DIGEST in the body

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2000\12\06@113953 by Douglas Wood

flavicon
face
The solution that I've used is style sheets. With style sheets, you can specify the page size and orientation, page breaks and even an alternate HTML document to use for printing. Most modern browsers support style sheets. My system creates data reports and places that data in two separate HTML files. One is for viewing within the bowser and the other is for printing. To do this, place the following in the
section of the HTML file: The first line specifies the style sheet to use and the second line specifies the alternate HTML page to use for printing. When you generate the (in this example) GAME.PRN HTML file, you make it contain the information you'd like to see printed. (The name GAME.PRN is my way of denoting the printable version; the viewable HTML page was called GAME.HTM.) The style sheet specified above looks like this: BODY {font-size: 6pt; font-family: "arial"; color: black; margin-left: 18pt; margin-right: 18pt;} P {margin-left: 18pt; margin-right: 18pt; } .PageOrientation {size: 8.5in 11in portrait} H1 {font: 8pt "courier new" "fixedsys"; line-height: 8pt;} H2 {font: 8pt "courier new" "fixedsys"; font-weight: bold; line-height: 8pt;} H3 {font-size: 14pt; "arial" "fixedsys"; font-weight: bold; line-height: 15pt;} .PageBreakBefore {page-break-before: always} The GAME.HTM and GAME.PRN files look like this: Summary Report of GAME Productivity (Browser Version)

Summary Report of GAME Productivity

        

        

Report data for 09/26/00-10/03/00 ...Report data goes here (page 1)...

Summary Report of GAME Productivity (Browser Version)

        

        

Report data for 09/26/00-10/03/00 ...Report data goes here (page 2)...

The GAME.PRN can specify a different .CCS (style sheet) file to allow the fonts to be different sizes, etc. In my case, the data was 8 pt. courier new for the viewable version and 7 pt. courier new for the printable version. The

tag in the HTML file tells the browser's PRINT mechanism to force a form feed (page break) at that point -- instant pagenation! Clear as mud, right? Douglas Wood Software Engineer {Original Message removed}


'[PICLIST] help!!'
2001\01\23@094122 by sunset97
flavicon
face
>===== Original Message From pic microcontroller discussion list
<EraseMEPICLISTRemoveMEspamSTOPspammitvma.mit.edu> =====
the purpose of this code is to read the input from the input
pins under the mode condition.  depending on the mode the
output is one of three circuits attached to the stamp.  the
circuits are a buzzer (like piezo buzzer), a led and a ISD1000A
voice playback chip.

the input modes are from an attached circuit.  the detection
circuits (alarms) are also from external attached circuits
attached to the specified pins.

how long is the time duration when i say :
pause 25
pause 100
etc....

here is the code:

; variable declarations
mode var nibble
alarm var nibble
  motion var alarm.bit0
  door var alarm.bit1
  glass var alarm.bit2

; constant and pin declarations
mode.bit0 con 5
mode.bit1 con 6
mode.bit2 con 7
mode.bit3 con 8
alarm.bit0 con 9
alarm.bit1 con 10
alarm.bit2 con 11
alarm.bit3 con 12
buzz con 13
light con 14
pin0 con 15
pin1 con 16
pin5 con 17
pin6 con 18

; program
mode = INA
GOSUB check1
end


Check1:
BRANCH mode,[check1, check1, check1, delay, check1, check1,
 check1, check1, check1, check1, check1, check1, check,
 check1, check1, check1]
alarms = INA
RETURN

Delay:
pause 900
RETURN

Check:
BRANCH alarms,[check, mess, mess, alarm, mess, alarm, alarm,
alarm, light, alarm, alarm, alarm, alarm]
RETURN

LED:
low light
pause 250
high light
RETURN

Mess:
BRANCH add,[Mess, A2, A1, Mess]
RETURN

A2:
high pin0
high pin5
pause 25
low pin5
pause 25
low pin6
pause 600
high pin6
low pin0
RETURN

A1:
high pin1
high pin5
pause 25
low pin5
pause 25
low pin6
pause 600
high pin6
low pin1
RETURN

Alarm:
low buzz
pause 50
high buzz
RETURN

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\23@112131 by James Paul

flavicon
face
Sunset97,

41.7 minutes plus overhead if my calculations are correct and
assuming 4 Mhz.

                                   Regards,

                                     Jim



On Tue, 23 January 2001, sunset97 wrote:

{Quote hidden}

spamBeGonejimspam@spam@jpes.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[PIC]: JDM Adaptor NEED HELP!!! (PIC16F873)'
2001\03\21@195532 by Rui Guima
picon face
Does anyone knows how to program a pic16f873with the
JDM programmer (Ludipipo). How i connect the 16f873 to
the JDM?

Thank You!!!

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspammitvma.mit.edu with SET PICList DIGEST in the body



'[PICLIST] [ADMIN]: scrambled List delivery Help!!'
2001\06\27@012326 by Dave Bell
flavicon
face
Sorry to post with [ADMIN] flag, which probably is a major faux pas, but I
can't raise any help at the ListServer! Please email me directly, as I
still receive the List in Digest form, but can no longer read it...

Dave Bell

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[PICLIST] [ADMIN]: scrambled List delivery Help!!'
2001\07\01@201742 by miked
flavicon
face
Been this way for a month now.
>
> Sorry to post with [ADMIN] flag, which probably is a major faux pas, but I
> can't raise any help at the ListServer! Please email me directly, as I still
> receive the List in Digest form, but can no longer read it...
>

Below is what I found and a response;
> >  I think I found the problem. Blank lines in the digest have a leading
> > space for some reason(20 0D 0A). When these are around the boundary
> > separators, e-mail programs that are strict about RFC rules truncate.
>
> Uhh, that is strictly as per RFC. A newline alone on a line followed by a
> >From header in column 0 on the next line, with no column, is standard Unix
> mailbox file format, and that's what the RFC specifies. Putting a space on
> every blank line is the way they escape the following line to *prevent* it from
> being seen as a message header.

I see nothing here about that.
http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

Removing the leading Space makes the messages visible as they were for
years now.

> > With Pegasus I can use properties to set the digest to 'not a valid MIME
> > message' and then see everything, but as one big message instead of separate
> > ones.
Pegasus is a stickler for following RFC rules.
> You are supposed to see one large message. I see one large message. I
> wrote a shell script to split it and re-inject it locally but I prefer the
> large message. A digest is a large message.
>
> Peter
If it is a Mutil Part MIME digest, which this list is(was) it opens to seperate
emails.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads



'[EE]: HELP!!! Surface Mount indentification'
2001\08\24@201035 by Dave King
picon face
I need a bit of help to identify a component on a Quantum Bigfoot CY 6.4gb
hard drive.
Earlier today the smoke escaped out of a smt component and I may loose
about a years
work and data. The drive was still running when I shut it down so hopefully
I can get my
stuff off of it. Another few weeks and it would have been replaced anyway.

The culprit has 1 lead on one side 3 on the other.  Markings are a two
vertical dots
with a I over an H to the right.  On the other side of the chip is a large
S with a single
dot to its right. Can anyone help identify this so I can hopefully replace
it if I have to.

TIA!

Dave

The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing potatoes

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspammitvma.mit.edu



'[EE]:Transistor Help!!!!!!!!'
2002\06\02@031137 by Ed Heath
picon face
I have a TO220 transistor marked "69-526" it has a Motorola
stamp. I have searched the web to the to the place where it
says "YOU HAVE REACHED THE END GOBACK - NOW!"
and can find no reference or cross for this part.
The transistor is in the drive circuit for a 12VDC to 115VAC
inverter from TRIPP LITE model PV1000FC about 10 years
old. They were no help at all! They thought it might cross
to a SJE2909 which does not come up anywhere???

HELP!

Ed Heath

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\02@062750 by Thomas C. Sefranek

face picon face
On 2 Jun 2002 at 3:08, Ed Heath wrote:

> I have a TO220 transistor marked "69-526" it has a Motorola
> stamp.

THis is an in-house number (inventory control).
The whole intention is to hide the identity of the device being used.
It reads 1969- lot# 526 design.
The parameters will not be revealed by Motorola without written
consent of the origional contractor.

I have searched the web to the to the place where it
> says "YOU HAVE REACHED THE END GOBACK - NOW!"
> and can find no reference or cross for this part.
> The transistor is in the drive circuit for a 12VDC to 115VAC
> inverter from TRIPP LITE model PV1000FC about 10 years
> old. They were no help at all! They thought it might cross
> to a SJE2909 which does not come up anywhere???

SJE, SRF etc are all examples of controlled devices.
Same story as above, the information will not be released...
You are out of luck, try generic power devices once you determine
if it's PNP or NPN.
{Quote hidden}

 |  __O    Thomas C. Sefranek  spam_OUTtcsspam_OUTspamspam_OUTcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\02@091408 by Roman Black

flavicon
face
Ed Heath wrote:
>
> I have a TO220 transistor marked "69-526" it has a Motorola
> stamp. I have searched the web to the to the place where it
> says "YOU HAVE REACHED THE END GOBACK - NOW!"
> and can find no reference or cross for this part.
> The transistor is in the drive circuit for a 12VDC to 115VAC
> inverter from TRIPP LITE model PV1000FC about 10 years
> old. They were no help at all! They thought it might cross
> to a SJE2909 which does not come up anywhere???
>
> HELP!


Hi Ed, "secret repairman tip" following, ha ha! ;o)
When in doubt, just replace it with your best TO-220
pack device, always works. Well, 99% of cases anyway.
I have often been called upon to replace power
tranny's when the type was not known, including many
that were so fried the bulk of the part could not be
found, no plastic etc, just one or two melted legs
hanging out the board!

My favorite for TO-220 "guessing" is the 2SC-2335
which at 500v 7A 40w (and quite fast) got put in
many of our jobs, even when we knew the correct
tranny the 2335 was $1 compared to often $3 for
the "correct" part which had a much lower spec.

If the inverter has one main power tranny you can
bet it is NPN, even some with bridge type power
stages they usually use 2x NPN as they are cheaper,
more common, better specs etc. Same pin connections,
(repairers love TO-220 packs!) just stick one in
and see how it goes. Unless you re about to tell us
that this inverter is 500w and there is only one power
tranny or something! :o)
-Roman

PS. If the tranny is shorted replace the driver
optocoupler if there is one, and you may need to
replace the small driver trannys in the base circuit.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\02@100029 by Jim

flavicon
face
I think Roman has the right answer -

- but I'm curious what a search for an "MJE2909"
shows up?

Motorola makes devices with an "MJE" prefix but
I don't recall seeing "SJE" ...

Jim

{Original Message removed}

2002\06\02@140550 by Rick C.

flavicon
face
If this is an output driver, and there are about6 or so on a heat sink,
it's probably similar to the BUZ71 mosfet transistor.
Rick

Ed Heath wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\02@144814 by Bob Ammerman

picon face
----- Original Message -----
From: "Thomas C. Sefranek" <tcsspam_OUTspamCMCORP.COM>
To: <RemoveMEPICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Sunday, June 02, 2002 6:24 AM
Subject: Re: [EE]:Transistor Help!!!!!!!!


{Quote hidden}

But if the statement that it is from a 1969 design is correct it does limit
the specifications to what could be done back then... probably pretty
limited by todays standards.

Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\02@145612 by Thomas C. Sefranek

face picon face
Bob Ammerman wrote:

{Quote hidden}

O.K....

And this would just re-enforce my later sentance about using a generic
device...
So what point are you making that I'm too dull to get?
(It is a lazy Sunday afternoon...)


>
>
> Bob Ammerman
> RAm Systems
>
> --
> http://www.piclist.com hint: The list server can filter out subtopics
> (like ads or off topics) for you. See http://www.piclist.com/#topics

--
 *
 |  __O    Thomas C. Sefranek   spam_OUTtcsspamKILLspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\02@150712 by Bob Ammerman

picon face
> Bob Ammerman wrote:
>
> > ----- Original Message -----
> > From: "Thomas C. Sefranek" <RemoveMEtcsRemoveMEspamEraseMECMCORP.COM>
> > To: <KILLspamPICLISTspamspamBeGoneMITVMA.MIT.EDU>
> > Sent: Sunday, June 02, 2002 6:24 AM
> > Subject: Re: [EE]:Transistor Help!!!!!!!!
> >
> > > On 2 Jun 2002 at 3:08, Ed Heath wrote:
> > >
> > > > I have a TO220 transistor marked "69-526" it has a Motorola
> > > > stamp.
> > >
> > > THis is an in-house number (inventory control).
> > > The whole intention is to hide the identity of the device being used.
> > > It reads 1969- lot# 526 design.
> > > The parameters will not be revealed by Motorola without written
> > > consent of the origional contractor.
> >
> > But if the statement that it is from a 1969 design is correct it does
limit
> > the specifications to what could be done back then... probably pretty
> > limited by todays standards.
>
> O.K....
>
> And this would just re-enforce my later sentance about using a generic
> device...
> So what point are you making that I'm too dull to get?
> (It is a lazy Sunday afternoon...)

No point at all. Your idea for a generic solution is excellent. All I am
saying is that you can probably use a lower-spec generic replacement if you
can come up with limits on the device in question.

Some ways to determine such limits:

1: As noted in my prior post: by knowing what was available when the device
was built.

2: Voltage specs can be determined by the max voltage in the circuit (with
an appropriate 'safety' multiplier of course).

3: Current specs can be determined by series components. EG: if the device
is in serieas with a 0.1 ohm 10W resisistor you know that it has at most 10A
current flowing in it.

Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[PIC] Help!!- PIC18F258 CAN weird problem!'
2002\08\27@192739 by Hu, Luhui
flavicon
face
Hi Folks,

I am sure there is no problem in my circuit and CAN driver for the
PIC18F258. The PIC18F258 can receive messages it send in the loopback mode,
but it cannot send out nor receive a message in the normal mode. I am using
Microchip C18 compiler and MPLAB ICE. The Baud rate I chose is 125 kbps and
the oscillator frequency of the PIC18F258 is 20 MHz. The lists below are the
registers' value during the PIC18F running in the normal mode. Please give
some suggestion why it does not work in the normal mode!

F6F CANCON H'00'
F6E CANSTAT H'00'
F70 BRGCON1 H'09'
F71 BRGCON2 H'8A'
F72 BRGCON3 H'01'
F40 TXB0CON H'1A'
F45 TXB0DLC H'04'
F46 TXB0D0 H'11'
F30 TXB1CON H'1A'
F35 TXB1DLC H'05'
F76 TXERRCNT H'00'
F60 RXB0CON H'60'
F65 RXB0DLC H'05'

Thanks in advance!

Luke

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.



'[PIC]: kit81 help!!! it doesn't work'
2002\10\23@191527 by A l
picon face
i wish to receive all the info possible about the k81 pic 16f84 programmer
because i doesn't work
all tensions works perfectly but when i try to program lights.hex the is an
error message
what can i do??
help me please
thanks
albert

_________________________________________________________________
Charla con tus amigos en lmnea mediante MSN Messenger:
http://messenger.microsoft.com/es

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspammitvma.mit.edu


2002\10\23@210134 by Rick C.

flavicon
face
If I recall clearly, I had a similar problem some years back. I forgot the
configuration byte in my code that set the oscillator type.
Rick

A l wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu



'[PIC]: Compile help!!!!!!!!!'
2003\03\11@123912 by PICFUN
flavicon
face
I have the folowing code in C and i dont have any program to compile it!
Please, if anyone can compile for me...


#INCLUDE <16F84.H>

#FUSES XT, WDT, PROTECT, NOPUT  // CCS Compiles PUT wrong - this means PUT

#ID 0x0000

#USE DELAY(CLOCK=4000000, RESTART_WDT)

#USE FAST_IO(A)
#USE FAST_IO(B)

#ZERO_RAM

#BIT mlan =  0x05.0
#BIT LEDG =  0x05.1
#BIT LEDR =  0x05.2
#BIT pulse =  0x05.3 // Low is 1 Sec, High is 10 secs
#BIT config = 0x05.4
#BYTE id_out = 0x06

#DEFINE MLAN_IN    0b11111001
#DEFINE MLAN_OUT    0b11111000
#DEFINE STORED_IDS_ADDR 0x3F

// Map out the IDs stored in the EEPROM
byte CONST ee_table[7] = {0,6,12,18,24,30,36};

// Globals
int id_in[6];

// Subroutines


// Flash RED
// This routine flashes the RED LED for secs/4 seconds

void flash_red(int secs) {

int i;

LEDG = 0; delay_cycles(1); LEDR = 1;

for (i = 0; i < secs; i++) {
 delay_ms(250);
 LEDR = !LEDR;
}
}


// Gen CRC
// This routine takes the old CRC value and a new byte and returns a new CRC
value

int gen_crc(int crc_in, int newdata) {

int i;

for(i = 0; i < 8; i++) {
 shift_right(&crc_in, 1, (bit_test(crc_in, 0) ^ shift_right(&newdata, 1,
0)));
 // Check for the extra XOR
 if (bit_test(crc_in, 7)) {
  // We need an extra XOR
  crc_in ^= 0x0C;
 }
}

return crc_in;
}


// READ Byte
// This routine reads in a byte from a microLAN device after a READ command
has been sent

int read_byte() {

int byte_in, i, bit_cnt;

for(i = 0; i < 8; i++) {
 // Clear bit counter
 bit_cnt = 0;

 // Pulse microLAN low to clock bit
 set_tris_a(MLAN_OUT);
 mlan = 0;
 delay_us(3);
 set_tris_a(MLAN_IN);
 delay_us(3); // Allow some pullup recovery time

 // We now have ~7us left to sample a few times
 if (!mlan) { bit_cnt++; }
 if (!mlan) { bit_cnt++; }
 if (!mlan) { bit_cnt++; }

 // Lets shoot for 2 out of 3!  Use a quickie bit test for efficiency

 shift_right(&byte_in, 1, !bit_test(bit_cnt, 1));

 // Lets allow for the microLan device to release (45us MAX) and LAN to
recover (15)
 delay_us(45);
}

return byte_in;
}


// READ iButton
// This routine is called to read an iButtons' unique serial ID.  The
following steps are taken:
// 1. Issue Read ROM command on MicroLAN (0x33)
// 2. Read in 8 byte ID
// 3. Check family code and CRC
// 4. Store 6 byte serial in id_in if valid and return TRUE OR
//  Return false for Bad CRC or family code

boolean read_ibutton() {

int i, tmp, family, crc_in;

// Lets write out the Read ROM command
tmp = 0x33;
for(i = 0; i < 8; i++) {
 // Bring micro LAN low for 7us
 set_tris_a(MLAN_OUT);
 mlan = 0;
 delay_us(7);

 // Output the bit
 if (shift_right(&tmp, 1, 0)) {
  // Output a 1 via the pullup
  set_tris_a(MLAN_IN);
 } else {
  set_tris_a(MLAN_OUT);
  mlan = 0;
 }

 delay_us(50); // Allow iButton to read the data and complete slot

 // Now we go to tristate
 set_tris_a(MLAN_IN);

 // No need for 1us delay since loop takes care of it
}

// Now the iButton will start dumping data back to us synced to our pulses
family = read_byte();

// If the family code is bad - quit
if (family != 0x01) {
 return FALSE;
}

crc_in = gen_crc(0x00, family);

for(i = 0; i < 6; i++) {

//  id_in[i] = read_byte();
//  crc_in = gen_crc(crc_in, id_in[i]);

 // The code below is more compact (15us vs 20us)
 tmp = read_byte();
 id_in[i] = tmp;
 crc_in = gen_crc(crc_in, tmp);
}

if (crc_in == read_byte()) {
 // The CRC is okay!
 return TRUE;
} else {
 return FALSE;
}
}


// Check LAN
// This routine issues an INIT pulse on the micro LAN (480 - 960 us) and
looks for a presence
// pulse from an ibutton.  If it sees one, it returns true indicating an
active device is on the LAN

boolean check_lan() {

int i, low_hit;

low_hit = 0;

// Bring MLAN low for at least 480us - we'll use 520 us
set_tris_a(MLAN_OUT);
mlan = 0;
delay_us(520);

// Put bus back in tristate
set_tris_a(MLAN_IN);

// Lets see if a pulse comes back in the proper window
// The pulse will start 15-60 us after going high
// The pulse will be 60us - 240us

// The presence pulse period must be a minimum of 480us
// So lets check for a low every 10us and if we get 4 (since pulse has to
be 60us min), take it
for (i = 0; i < 48; i++) {
 if (!mlan) { low_hit++; } // Catch a presence pulse
 delay_us(2); // For loop takes 9us @ 4MHz
}

if (low_hit > 3) {
 return TRUE;
} else {
 return FALSE;
}
}


// Check ID
// This routine takes the passed ID in id_in and compares it to those IDs in
EEPROM
// If it finds a match, it returns the ID number, otherwise it returns 0x00

int check_id(int num_ids) {

int ee_addr, button_idx, cnt;
boolean match;

button_idx = 0;

while(++button_idx <= num_ids) {
 // Check all stored button IDs
 cnt = 0; restart_wdt();
 ee_addr = ee_table[button_idx-1];
 match = TRUE;
 while (cnt != 6) {

  if (read_eeprom(ee_addr) != id_in[cnt]) {
   match = FALSE; // Doesn't match - check next button
   break;
  }

  ee_addr++;
  cnt++;
 }

 if (match) {
  // We matched everything!
  return button_idx;
 }
}

// No matches!
return 0;
}


void main() {

int stored_ids, id_matched, temp_out, i, eeprom_addr;

// Setup IO port directions and initialize ports
set_tris_a(MLAN_IN);
set_tris_b(0b00000000);
id_out = 0x00;

// Lets give some indication that we are alive
LEDR = 0; LEDG = 1;
delay_ms(1000);
LEDG = 0; LEDR = 1;
delay_ms(1000);
LEDR = 0; LEDG = 0;
delay_ms(1000);

// Check config bitm - LOW means config
if (!config) {
 // Configuration mode
 eeprom_addr = 0x00;
 stored_ids = 0;

 // We can store 7 buttons
 for(i = 0; i < 7; i++) {
  LEDG = 0; delay_cycles(1); LEDR = 1; // Red

  // Lets wait for a button
LAN_WAIT1:
  while(!check_lan()) { restart_wdt(); }

  // Lets read the iButton - if we get a CRC error, lets try again (and
again :) )
  while(!read_ibutton()) {
   // We didn't get a good read, lets keep trying
   restart_wdt();
   delay_ms(1); // Give the bus a chance to stabilize
   if (!check_lan()) {
    // Bail - we can't see a device!
    goto LAN_WAIT1;
   }
  }

  // Lets make sure this ID hasn't already been stored in EEPROM
  if (check_id(stored_ids) != 0) {
   i--; // Lets take a step back for another try
   flash_red(20);
   continue;
  }

  // We have a valid ID in id_in.  Lets store it - all six bytes
  for(temp_out = 0; temp_out < 6; temp_out++) {
   write_eeprom(eeprom_addr, id_in[temp_out]);
   restart_wdt();
   eeprom_addr++;
  }

  // Update number of IDs - this ensures that we don't check random
  // data bytes if they use < 7 buttons
  stored_ids++;
  write_eeprom(STORED_IDS_ADDR, stored_ids);

  // Green LED for 5 seconds
  LEDR = 0; delay_cycles(1); LEDG = 1;
  delay_ms(5000);

 }

 // Okay, we've maxed out or storage - let user know
 // Blink Green until reset
 LEDR = 0; delay_cycles(1); LEDG = 1;
 while(TRUE) {
  delay_ms(250);
  LEDG = !LEDG;
 }

} else {
 // Normal operation
 stored_ids = read_eeprom(STORED_IDS_ADDR);

 while(TRUE) {

  LEDG = 0; delay_cycles(1); LEDR = 0; // Off

  // Check for presence pulse and read ID if button is online
LAN_WAIT2:
  while(!check_lan()) { restart_wdt(); }

  // Something is on the micro LAN - lets read the ID
  while(!read_ibutton()) {
   // We didn't get a good read, lets keep trying
   restart_wdt();
   delay_ms(1); // Give the bus a chance to stabilize
   if (!check_lan()) {
    // Bail - we can't see a device!
    goto LAN_WAIT2;;
   }
  }

  // Valid ID was received - lets check it

  id_matched = check_id(stored_ids);

  if (id_matched == 0) {
   // ID does not match
   LEDG = 0; delay_cycles(1); LEDR = 1; // RED
   delay_ms(10000);
  } else {
   // Valid ID match - trigger outputs
   temp_out = 1;
   for(i = 0; i < id_matched; i++) {
    temp_out <<= 1;
   }
   temp_out |= 0x01;

   // Output the bits
   id_out = temp_out;

   LEDR = 0; delay_cycles(1); LEDG = 1; // Green

   // Low on Pulse means 1 sec, high means 10 secs
   if (pulse) {
    delay_ms(10000);
   } else {
    delay_ms(1000);
   }

   id_out = 0x00;
  }
 } // while(TRUE)
} // if (config)
} // End MAIN



--
http://www.freemail.gr - dyqe\m upgqes_a gkejtqomijo} tawudqole_ou.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservSTOPspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\03\11@124927 by

flavicon
face
Dear PICFUN :
Ask first and *then* send the source *directly*
by direct mail *if* someone cares to answer.
Do *not* post the source to the list.

Jan-Erik Söderholm.




PICFUN wrote:

A lot...

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamBeGonespamspamBeGonemitvma.mit.edu with SET PICList DIGEST in the body

2003\03\11@192319 by john chung

flavicon
face
you may want to look at a free C compiler.
HI-TECH PICC Lite Compiler
http://www.htsoft.com/products/piclite/piclite.html

PICFUN wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservSTOPspamspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\11@195146 by Andre Abelian

picon face
e-mail me the c code I will compile it for you
and get back to you I only have 18f compiler in here
RemoveMEandrespamspamditechnology.com

Andre Abelian



PICFUN wrote:

> I have the folowing code in C and i dont have any program to compile
it!
> Please, if anyone can compile for me...
>
> #INCLUDE <16F84.H>
>
> #FUSES XT, WDT, PROTECT, NOPUT  // CCS Compiles PUT wrong - this means
PUT
{Quote hidden}

new CRC
> value
>
> int gen_crc(int crc_in, int newdata) {
>
>  int i;
>
>  for(i = 0; i < 8; i++) {
>   shift_right(&crc_in, 1, (bit_test(crc_in, 0) ^ shift_right(&newdata,
1,
{Quote hidden}

command
{Quote hidden}

to
{Quote hidden}

pulses
{Quote hidden}

and
> looks for a presence
> // pulse from an ibutton.  If it sees one, it returns true indicating
an
{Quote hidden}

has to
{Quote hidden}

IDs in
> EEPROM
> // If it finds a match, it returns the ID number, otherwise it returns
0x00
{Quote hidden}

(and
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservspamspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservRemoveMEspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\12@114502 by Lawrence Lile

flavicon
face
I'd recommend you convert it to Hitech C and get their freeware version,
which will handle the 16F84 nicely.   I've made some suggestions in the
code you posted below.  I am sure it won't compile under Hitech but it
will at least get closer.  You probably need to learn a little about C to
survive with PICs IMHO and this is a good way to get started.

Log onto the Hitech C PIC message board, and search for my thread about
"12 step program for CCS addicts" to learn more about how to convert
between the two.  Conversion is not very hard.

http://www.hitech.com


-- Lawrence Lile



//#INCLUDE <16F84.H>
#include <pic.h>

//#FUSES XT, WDT, PROTECT, NOPUT  // CCS Compiles PUT wrong - this means
PUT
// DO NOT protect your ram, or you will have an OTP part.
__CONFIG(WDTEN | PWRTEN | UNPROTECT | XT);


//#ID 0x0000  no meaning in Hitech

//#USE DELAY(CLOCK=4000000, RESTART_WDT)
#define PIC_CLK  4000000
#include delay.c

//#USE FAST_IO(A) // no meaning in Hitech
//#USE FAST_IO(B)

//#ZERO_RAM  // automatic in Hitech


// Replace these with the form:
static volatile bit     mlan    @ (unsigned)&0x05*8+0;
#BIT mlan =  0x05.0
#BIT LEDG =  0x05.1
#BIT LEDR =  0x05.2
#BIT pulse =  0x05.3 // Low is 1 Sec, High is 10 secs
#BIT config = 0x05.4
#BYTE id_out = 0x06

#DEFINE MLAN_IN    0b11111001
#DEFINE MLAN_OUT    0b11111000
#DEFINE STORED_IDS_ADDR 0x3F

// Map out the IDs stored in the EEPROM

//Replace byte with char
//byte CONST ee_table[7] = {0,6,12,18,24,30,36};




// Globals

// Replace int with char:
//int id_in[6];

// Subroutines


// Flash RED
// This routine flashes the RED LED for secs/4 seconds

void flash_red(int secs) {

//Replace int with char
// int i;

LEDG = 0; delay_cycles(1); LEDR = 1;

for (i = 0; i < secs; i++) {
 delay_ms(250);
 LEDR = !LEDR;
}
}


// Gen CRC
// This routine takes the old CRC value and a new byte and returns a new
CRC
value

replace int with char
//int gen_crc(int crc_in, int newdata) {

int i;

for(i = 0; i < 8; i++) {
 shift_right(&crc_in, 1, (bit_test(crc_in, 0) ^ shift_right(&newdata, 1,
0)));
 // Check for the extra XOR
 if (bit_test(crc_in, 7)) {
  // We need an extra XOR
  crc_in ^= 0x0C;
 }
}

return crc_in;
}


// READ Byte
// This routine reads in a byte from a microLAN device after a READ
command
has been sent

int read_byte() {

int byte_in, i, bit_cnt;

for(i = 0; i < 8; i++) {
 // Clear bit counter
 bit_cnt = 0;

 // Pulse microLAN low to clock bit
 set_tris_a(MLAN_OUT);
 mlan = 0;
 delay_us(3);
 set_tris_a(MLAN_IN);
 delay_us(3); // Allow some pullup recovery time

 // We now have ~7us left to sample a few times
 if (!mlan) { bit_cnt++; }
 if (!mlan) { bit_cnt++; }
 if (!mlan) { bit_cnt++; }

 // Lets shoot for 2 out of 3!  Use a quickie bit test for efficiency

 shift_right(&byte_in, 1, !bit_test(bit_cnt, 1));

 // Lets allow for the microLan device to release (45us MAX) and LAN to
recover (15)
 delay_us(45);
}

return byte_in;
}


// READ iButton
// This routine is called to read an iButtons' unique serial ID.  The
following steps are taken:
// 1. Issue Read ROM command on MicroLAN (0x33)
// 2. Read in 8 byte ID
// 3. Check family code and CRC
// 4. Store 6 byte serial in id_in if valid and return TRUE OR
//  Return false for Bad CRC or family code

boolean read_ibutton() {

int i, tmp, family, crc_in;

// Lets write out the Read ROM command
tmp = 0x33;
for(i = 0; i < 8; i++) {
 // Bring micro LAN low for 7us
 set_tris_a(MLAN_OUT);
 mlan = 0;
 delay_us(7);

 // Output the bit
 if (shift_right(&tmp, 1, 0)) {
  // Output a 1 via the pullup
  set_tris_a(MLAN_IN);
 } else {
  set_tris_a(MLAN_OUT);
  mlan = 0;
 }

 delay_us(50); // Allow iButton to read the data and complete slot

 // Now we go to tristate
 set_tris_a(MLAN_IN);

 // No need for 1us delay since loop takes care of it
}

// Now the iButton will start dumping data back to us synced to our
pulses
family = read_byte();

// If the family code is bad - quit
if (family != 0x01) {
 return FALSE;
}

crc_in = gen_crc(0x00, family);

for(i = 0; i < 6; i++) {

//  id_in[i] = read_byte();
//  crc_in = gen_crc(crc_in, id_in[i]);

 // The code below is more compact (15us vs 20us)
 tmp = read_byte();
 id_in[i] = tmp;
 crc_in = gen_crc(crc_in, tmp);
}

if (crc_in == read_byte()) {
 // The CRC is okay!
 return TRUE;
} else {
 return FALSE;
}
}


// Check LAN
// This routine issues an INIT pulse on the micro LAN (480 - 960 us) and
looks for a presence
// pulse from an ibutton.  If it sees one, it returns true indicating an
active device is on the LAN

boolean check_lan() {

int i, low_hit;

low_hit = 0;

// Bring MLAN low for at least 480us - we'll use 520 us
set_tris_a(MLAN_OUT);
mlan = 0;
delay_us(520);

// Put bus back in tristate
set_tris_a(MLAN_IN);

// Lets see if a pulse comes back in the proper window
// The pulse will start 15-60 us after going high
// The pulse will be 60us - 240us

// The presence pulse period must be a minimum of 480us
// So lets check for a low every 10us and if we get 4 (since pulse has to
be 60us min), take it
for (i = 0; i < 48; i++) {
 if (!mlan) { low_hit++; } // Catch a presence pulse
 delay_us(2); // For loop takes 9us @ 4MHz
}

if (low_hit > 3) {
 return TRUE;
} else {
 return FALSE;
}
}


// Check ID
// This routine takes the passed ID in id_in and compares it to those IDs
in
EEPROM
// If it finds a match, it returns the ID number, otherwise it returns
0x00

int check_id(int num_ids) {

int ee_addr, button_idx, cnt;
boolean match;

button_idx = 0;

while(++button_idx <= num_ids) {
 // Check all stored button IDs
 cnt = 0; restart_wdt();
 ee_addr = ee_table[button_idx-1];
 match = TRUE;
 while (cnt != 6) {

  if (read_eeprom(ee_addr) != id_in[cnt]) {
   match = FALSE; // Doesn't match - check next button
   break;
  }

  ee_addr++;
  cnt++;
 }

 if (match) {
  // We matched everything!
  return button_idx;
 }
}

// No matches!
return 0;
}


void main() {

int stored_ids, id_matched, temp_out, i, eeprom_addr;

// Setup IO port directions and initialize ports
set_tris_a(MLAN_IN);
set_tris_b(0b00000000);
id_out = 0x00;

// Lets give some indication that we are alive
LEDR = 0; LEDG = 1;
delay_ms(1000);
LEDG = 0; LEDR = 1;
delay_ms(1000);
LEDR = 0; LEDG = 0;
delay_ms(1000);

// Check config bitm - LOW means config
if (!config) {
 // Configuration mode
 eeprom_addr = 0x00;
 stored_ids = 0;

 // We can store 7 buttons
 for(i = 0; i < 7; i++) {
  LEDG = 0; delay_cycles(1); LEDR = 1; // Red

  // Lets wait for a button
LAN_WAIT1:
  while(!check_lan()) { restart_wdt(); }

  // Lets read the iButton - if we get a CRC error, lets try again (and
again :) )
  while(!read_ibutton()) {
   // We didn't get a good read, lets keep trying
   restart_wdt();
   delay_ms(1); // Give the bus a chance to stabilize
   if (!check_lan()) {
    // Bail - we can't see a device!
    goto LAN_WAIT1;
   }
  }

  // Lets make sure this ID hasn't already been stored in EEPROM
  if (check_id(stored_ids) != 0) {
   i--; // Lets take a step back for another try
   flash_red(20);
   continue;
  }

  // We have a valid ID in id_in.  Lets store it - all six bytes
  for(temp_out = 0; temp_out < 6; temp_out++) {
   write_eeprom(eeprom_addr, id_in[temp_out]);
   restart_wdt();
   eeprom_addr++;
  }

  // Update number of IDs - this ensures that we don't check random
  // data bytes if they use < 7 buttons
  stored_ids++;
  write_eeprom(STORED_IDS_ADDR, stored_ids);

  // Green LED for 5 seconds
  LEDR = 0; delay_cycles(1); LEDG = 1;
  delay_ms(5000);

 }

 // Okay, we've maxed out or storage - let user know
 // Blink Green until reset
 LEDR = 0; delay_cycles(1); LEDG = 1;
 while(TRUE) {
  delay_ms(250);
  LEDG = !LEDG;
 }

} else {
 // Normal operation
 stored_ids = read_eeprom(STORED_IDS_ADDR);

 while(TRUE) {

  LEDG = 0; delay_cycles(1); LEDR = 0; // Off

  // Check for presence pulse and read ID if button is online
LAN_WAIT2:
  while(!check_lan()) { restart_wdt(); }

  // Something is on the micro LAN - lets read the ID
  while(!read_ibutton()) {
   // We didn't get a good read, lets keep trying
   restart_wdt();
   delay_ms(1); // Give the bus a chance to stabilize
   if (!check_lan()) {
    // Bail - we can't see a device!
    goto LAN_WAIT2;;
   }
  }

  // Valid ID was received - lets check it

  id_matched = check_id(stored_ids);

  if (id_matched == 0) {
   // ID does not match
   LEDG = 0; delay_cycles(1); LEDR = 1; // RED
   delay_ms(10000);
  } else {
   // Valid ID match - trigger outputs
   temp_out = 1;
   for(i = 0; i < id_matched; i++) {
    temp_out <<= 1;
   }
   temp_out |= 0x01;

   // Output the bits
   id_out = temp_out;

   LEDR = 0; delay_cycles(1); LEDG = 1; // Green

   // Low on Pulse means 1 sec, high means 10 secs
   if (pulse) {
    delay_ms(10000);
   } else {
    delay_ms(1000);
   }

   id_out = 0x00;
  }
 } // while(TRUE)
} // if (config)
} // End MAIN









PICFUN <EraseMEpicSTOPspamspamRemoveMEFREEMAIL.GR>
Sent by: pic microcontroller discussion list <spam_OUTPICLISTRemoveMEspamEraseMEMITVMA.MIT.EDU>
03/11/2003 11:35 AM
Please respond to pic microcontroller discussion list


       To:     TakeThisOuTPICLISTRemoveMEspam@spam@MITVMA.MIT.EDU
       cc:
       Subject:        [PIC]: Compile help!!!!!!!!!


I have the folowing code in C and i dont have any program to compile it!
Please, if anyone can compile for me...



--
http://www.freemail.gr - dyqe\m upgqes_a gkejtqomijo} tawudqole_ou.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservRemoveMEspammitvma.mit.edu with SET PICList DIGEST in the body



--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-request.....spamspammitvma.mit.edu>


'[PIC] Help!! PIC 16F88, Olimex PG4-D, newbie probl'
2004\12\08@184833 by Ralph Seguin
picon face
I can't get this simple program to program or work.

Configuration:
PIC16F88-I/P on an Olimex PG4-D board, 20 MHz crystal    (http://olimex.com/dev)
Serial port cable from IBM Thinkpad T30 (on a dock/port replicator)
running Windows 2000.
ICPROG 1.05C,  configured for Windows API (as per directions for
Windows NT --> 2000) and for 16F84A (there was no 16F88 line).
MPLAB 6.60

Config lines in the .asm file:
              __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF &
_CPD_OFF & _LVP_OFF & _BODEN_ON & _MCLR_OFF & _PWRTE_ON & _WDT_OFF &
_HS_OSC
              __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF

Firstly, a number of constants don't seem to be defined
(_WRT_ENABLE_OFF is not defined, so I removed it from the _config
line) in the include file.
When I used ICPROG to write it, it failed on the readback/compare.

Anybody have a reasonable config value or list for this MCU?
Anybody have a working program and/or MPLAB project to blink the LED
(connected to RA2 on the Olimex PG4-D board) for the 16F88-I/P?
Set of sample programs for the 16F88?   16F877A (which I'm going to
stick on an Olimex P40-B)?

Thanks.
-Ralph
____________________________________________

2004\12\08@184953 by Ralph Seguin

picon face
part 1 1215 bytes content-type:text/plain; charset=US-ASCII (decoded 7bit)

I can't get this simple program to program or work.

Configuration:
PIC16F88-I/P on an Olimex PG4-D board, 20 MHz crystal    (http://olimex.com/dev)
Serial port cable from IBM Thinkpad T30 (on a dock/port replicator)
running Windows 2000.
ICPROG 1.05C,  configured for Windows API (as per directions for
Windows NT --> 2000) and for 16F84A (there was no 16F88 line).
MPLAB 6.60

Config lines in the .asm file:
              __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF &
_CPD_OFF & _LVP_OFF & _BODEN_ON & _MCLR_OFF & _PWRTE_ON & _WDT_OFF &
_HS_OSC
              __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF

Firstly, a number of constants don't seem to be defined
(_WRT_ENABLE_OFF is not defined, so I removed it from the _config
line) in the include file.
When I used ICPROG to write it, it failed on the readback/compare.

Anybody have a reasonable config value or list for this MCU?
Anybody have a working program and/or MPLAB project to blink the LED
(connected to RA2 on the Olimex PG4-D board) for the 16F88-I/P?
Set of sample programs for the 16F88?   16F877A (which I'm going to
stick on an Olimex P40-B)?

Thanks.
-Ralph


part 2 828 bytes content-type:application/octet-stream; name="ledtest1.zip" (decode)

part 3 79 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

____________________________________________

2004\12\08@192509 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Ralph Seguin" <rpseguinspam_OUTspam@spam@gmail.com>
Subject: [PIC] HELP!! PIC 16F88, Olimex PG4-D, Newbie problems...


> Windows NT --> 2000) and for 16F84A (there was no 16F88 line).

Ralph

The programming for an 88 is different than for an 84A or 877.  You cannot
program the 88 pretending to be a 84.  It *may* be similar to an 877A, but
I'm not so sure of that.  You need to get some programming software that
understands the new programming algorithms.  I have used WinPic successfully
on an 88 and it allows configuration for your hardware.

--McD


____________________________________________

2004\12\08@195512 by John J. McDonough

flavicon
face
----- Original Message -----
From: "John J. McDonough" <.....mcdspamspam.....is-sixsigma.com>

> I have used WinPic successfully
> on an 88 and it allows configuration for your hardware.

One bad thing about WinPic I should have mentioned - on XP, and I assume W2K
as well, you need to be an administrative user to use it.  This is mentioned
in the documentation but not very clearly.

--McD


____________________________________________

2004\12\08@195741 by Peter van Hoof

picon face
Ralph,

As far as I can see in the diagram , the programmer is a jdm style
programmer and this does have known problems if the voltage swing on the
serial port does not reach about + and -7volt ( has to create 13volt vpp
from this voltage)
ports that usually dont work are laptop , port replicator and usb to serial
converters.

Peter

{Original Message removed}

2004\12\08@202321 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Ralph Seguin" <rpseguinKILLspamspamEraseMEgmail.com>
Subject: [PIC] HELP!! PIC 16F88, Olimex PG4-D, Newbie problems...


> Set of sample programs for the 16F88?   16F877A (which I'm going to
> stick on an Olimex P40-B)?

Ralph

I should have caught this one earlier, too.  The 16F84A programs almost
identially to the 16F84.  However, the 16F877A programs entirely differently
than the 16F877, so don't get caught in the same problem when you move to
that chip.

There are a handful of different programming algorithms, but basically the
older parts program one word at a time.  For larger memories this gets slow.
So on the newer parts, they are programmed four words at a time.  The 88 and
877A are this way, but the 84A and 877 are not.  A lot of the older
programming software only knows the old way.

There actually is a tiny difference in programming between the 84 and the
84A, but it's so tiny that a programmer would have to work hard to write
software that would work on one and not the other.  But the difference
between the 877 and the 877A is night and day.

--McD


____________________________________________

2004\12\08@210341 by Byron A Jeff

face picon face
On Wed, Dec 08, 2004 at 08:23:15PM -0500, John J. McDonough wrote:
> ----- Original Message -----
> From: "Ralph Seguin" <EraseMErpseguin@spam@spam@spam@gmail.com>
> Subject: [PIC] HELP!! PIC 16F88, Olimex PG4-D, Newbie problems...
>
>
> > Set of sample programs for the 16F88?   16F877A (which I'm going to
> > stick on an Olimex P40-B)?
>
> Ralph
>
> I should have caught this one earlier, too.  The 16F84A programs almost
> identially to the 16F84.  However, the 16F877A programs entirely differently
> than the 16F877, so don't get caught in the same problem when you move to
> that chip.

It's not entirely different. All of the newer chips in the 16F family, and
all 18F chips IIRC, do block writes. So you have to write a group or 4 or 8
consecutive words if you want it to program properly.

Also each chip has a slightly different algorithm for erasure.

The upshot is that you generally cannot simply switch from one programming
algorithm to another blindly without consequences.

>
> There are a handful of different programming algorithms, but basically the
> older parts program one word at a time.  For larger memories this gets slow.
> So on the newer parts, they are programmed four words at a time.  The 88 and
> 877A are this way, but the 84A and 877 are not.  A lot of the older
> programming software only knows the old way.

Bingo. BTW I believe the 877A is 8 words writes.

>
> There actually is a tiny difference in programming between the 84 and the
> 84A, but it's so tiny that a programmer would have to work hard to write
> software that would work on one and not the other.  But the difference
> between the 877 and the 877A is night and day.

Not night and day, but sunrise and sunset. You can generally get away with
programming a 16F877A with the 16F877 algorithm if you write the entire
memory.

BAJ
____________________________________________

2004\12\09@033433 by Jan-Erik Soderholm

face picon face
Ralph Seguin wrote :

> Configuration:
> PIC16F88-I/P...
> ICPROG 1.05C,  configured for... 16F84A

> Firstly, a number of constants don't seem to be defined
> (_WRT_ENABLE_OFF is not defined,...


Well, what did you expect ?
You are using a F88 but are pretending it is an old F84.
That will of course not work.

> Anybody have a reasonable config value or list for this MCU?

Doesn't help a bit, as long you are not using tools that specificaly
supports the PIC you actualy are using.

> Anybody have a working program and/or MPLAB project to blink the LED
> (connected to RA2 on the Olimex PG4-D board) for the 16F88-I/P?

That would probably not help either, since you can't program
the F88 with your (current) tools anyway.

Regards,
Jan-Erik.



____________________________________________

2004\12\09@051835 by Rod Phillips

picon face
Ralph,

For a starting point on setting up a program for the 16F88 look at the
template.  Look in program
files\MPLAB_IDE\Mchip_tools\template\code\f88.temp.asm.  Copy it to your
working directory and re-name it to whatever.  It has the setup done
waiting for you to make any needed changes and start codeing.  If the
board you're using supports in-system programming it's an easy way to
go.  See Sparkfun website for a cheap programmer for this.

                                  Rod

Ralph Seguin wrote:
{Quote hidden}

> ______________________________________________


'[EE][PIC] UV bulb Help!!'
2005\05\10@173534 by Dave King
flavicon
face
Wondering if anyone in western Canada BC/Alta (or possibly Washington)
know where to get a uvc bulb aka germicidal bulb. Locally
the want $110 for anything that resembles the right bulb.
For that price I can make someone a deal on Ebay for
several eprom erasers.

Dave



2005\05\10@175838 by Tim_webb

flavicon
face
Try using http://www.google.com

here is the first link:

http://www.bulb-source.com/germicidal%20bulbs.htm

Hope that helps

{Original Message removed}

2005\05\10@180522 by mrgizmo

flavicon
face
I have a 3' floresent bulb I could sell you, What exactly are you looking
for?

----- Original Message -----
From: "Dave King" <@spam@KingDWSspamspamKILLspamshaw.ca>
To: "Microcontroller discussion list - Public." <spamBeGonepiclistRemoveMEspamEraseMEmit.edu>
Sent: Tuesday, May 10, 2005 5:35 PM
Subject: [EE][PIC] UV bulb Help!!


> Wondering if anyone in western Canada BC/Alta (or possibly Washington)
> know where to get a uvc bulb aka germicidal bulb. Locally
> the want $110 for anything that resembles the right bulb.
> For that price I can make someone a deal on Ebay for
> several eprom erasers.
>
> Dave
>
>
>
> --

2005\05\10@181550 by Dave King

flavicon
face
Google?? never heard of it ;-]

Thanks Tim but they are in Oklahoma
Was hoping to find something closer to home.
I live in a town of a bit over 150,000 and
its the electronic end of the earth. Ie if
they don't see it in the catalog, it doesn't
exist.

Thanks

Dave

-> Try using http://www.google.com
->
-> here is the first link:
->
-> www.bulb-source.com/germicidal%20bulbs.htm
->
-> Hope that helps
->
-> {Original Message removed}


'[SX] Embedded REPT's Crash/Error HELP!!'
2006\11\27@013656 by IsmStudiosn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Hello,
I'm using the latest version of the SX-Key IDE and SASM crashes when I do the following:


rept 5
       rept 3
       jmp $+1
       endr
       
       rept 3
       nop
       endr
endr

If I were to remove the rept 5 encasing the inner two rept's, it will assemble with no problem. But here's another weird scenario:

REPT 5
       mov        rc, #CBURST_HIGH
       rept 3
       nop
       endr
ENDR

This has an embedded rept and it assmebles without an issue but once I embedded another one in there, it crashes. My problem is that I'm working with a Delay MACRO written for the XGS and it seems to crash on me when the logic embeds 2 or more rept's inside another rept block.

Here's the Delay MACRO:


DELAY MACRO clocks
; the preprocessor can NOT do floating point math, so another construction would be to scale
; all values by 10 then multiply by 8 rather than 80, for example, a 4.5 uS delay could be
; written
; DELAY(8*45)
; first compute fractional remainder of 10 and delay
IF (((clocks) // 10) > 0)
 ; first 3 clock chunks
 REPT (((clocks) // 10)/3)
   JMP $ + 1
 ENDR
     ; now the remainder if any
 REPT (((clocks) // 10)//3)
   NOP
 ENDR
ENDIF
 ; next multiples of 100
 IF (((clocks) / 100) >= 1)
   ; truncated for brevity
 ENDIF
 ; last compute whole multiples of 10, and delay
 IF (( ((clocks) // 100) / 10) >= 1)
   ; truncated for brevity
 ENDIF
ENDM

And the code that I'm trying to write is this:


REPT 5
mov RC, #CBURST_HIGH        ; ( 2 cycles )
Delay(11-2)
mov RC, #CBURST_LOW        ; ( 2 cycles )
Delay(11-2)
ENDR

If you follow the logic of the MACRO, you will find that 9 or (11-2) causes the assembler to create two rept blocks in place of this Delay instruction--which happens to be within the outter REPT 5 block.

Please point me in the right direction  :smile: This is driving me nuts. I hope there's a workaround or a bugfix patch somewhere.

Thanks,
- Lewis [m80] -
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@084747 by PJMontyn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Lewis,
I haven't had a chance to look into the SASM code to see what is going on.  However, my first assumption is that the "rept" command was never designed to be nested.  The example that works may be getting by on a fluke.  The other possibility is that "rept" is designed to be nested, but that there is a bug in SASM that causes it to fail.  Either way, it will take a bit of time digging into SASM to come up with an answer.  Send me a PM in a few days if I haven't replied to this thread with some sort of update/answer.

[list]Thanks,
PeterM[/list]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157418
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@092709 by IsmStudiosn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Thanks Peter! I appreciate you taking a look at this. Are you the author of SASM?

- Lewie [m80] -
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157426
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@113453 by PJMontyn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Lewis,
I maintain and upgrade both SASM and the SX_Key IDE for Parallax.  I'm a freelance programmer, so I don't work for Parallax directly.

Thanks,
PeterM
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157466
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@165354 by PJMontyn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Lewis,
Tiny update - Yes, SASM allows nested REPTs.  The problem now is to figure out why actually taking advantage of that feature causes a crash.

[list]Thanks,
PeterM[/list]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157546
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@174437 by IsmStudiosn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Hey, maybe this might help--
When calling two Delay macros  that evaluate to only 1 rept block each would look like this:


REPT 5
mov RC, #CBURST_HIGH    ; ( 2 cycles )
Delay(4)
mov RC, #CBURST_LOW    ; ( 2 cycles )
Delay(4)
ENDR

Doesn't seem to crash for two reasons (even though two rept blocks are being nested within rept 5.
a) When Delay is 4, the macro seems to put only 1 rept block in it's place... Remember that a single nested block compiles fine.
b) Also notice that there are two Delays here but it compiles just fine because I think SASM first unravels the first Delay into "pure code" before evaluating the next macro.

Might look like this after one block is evaluated:


REPT 5
mov RC, #CBURST_HIGH    ; ( 2 cycles )
NOP
NOP
NOP
NOP mov RC, #CBURST_LOW    ; ( 2 cycles )
Delay(4)
ENDR

Which is fine... because the next Delay is going to place only 1 more rept block as well before it unravels it.

In my opinion, it seems SASM is having problem evaluating 1 block before the other--or it doesn't know how to prioritize them... might be a recursive issue. But let's hope not!

Anyway, hope that helps! Also, let me know if you need me to find more cases.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157557
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@184637 by PJMontyn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Lewis,
Hmm, getting ugly here in SASM-land.  The problem appears to be that whomever originally wrote SASM (or performed later updates) allowed nested REPT commands, but never took into account the possibility that inside a nested REPT there might be two or more sequential REPTs.

In other words, they assumed this:

REPT 5
   REPT 2
       REPT 4
       ENDR ; close the rept 4
   ENDR ; close the rept 2
ENDR ; close the rept 5

...and never saw this coming:

REPT 5
   REPT 2
   ENDR ; close the rept 2
   REPT 4
   ENDR ; close the rept 4
ENDR ; close the rept 5

In the second example, what ends up happening is that when SASM sees the closure for "REPT 2", it basically drops down a nesting level, since it assumes that not encountering another REPT means the code has no more nesting in it.  When it then hits the "REPT 4", it dutifully starts expanding the desired number of repeats.  This works great for the first pass of "REPT 4", but when it starts the next pass, it incorrectly starts using the code and number of repetitions for "REPT 2".  It then continues to repeat the "REPT 2", and when that is done it finds the "REPT 4" again, and the process repeats.  
Here was your code:

rept 2 ; Outermost rept
   rept 3 ; 1st inner rept
   jmp $+1
   endr  ; 1st inner rept closure
   
         rept 3 ; 2nd inner rept
   nop
   endr ; 2nd inner rept closure
endr ; Outermost rept closure

SASM (incorrectly) expands this into:

jmp$ + 1
jmp$ + 1
jmp$ + 1
nop
jmp$ + 1
jmp$ + 1
nop
jmp$ + 1
jmp$ + 1
nop
etc, etc, etc...

I am not 100% sure yet, but this may require an architectural change to SASM rather than a bug fix.  I have to give this some more thought for what the fix would entail (time = money) and then contact Parallax to see about whether this gets officially scheduled for fixing.  Sorry for the not so upbeat news...

[list]Thanks,
PeterM[/list]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157562
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@190428 by IsmStudiosn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Thank you once again for the updates! I hope Parallax approves this change--there are hundreds of people using this macro and assembler. It might be a headache for you, but like you said, time = $ :)
Is there a way to make it expand inner repts untouched until the outter rept is decoded?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157566
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\27@201905 by PJMontyn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Lewis,
There is where it becomes more of an architectural change than a bug fix.  Assemblers by their nature are linear beasts.  They go through the code line by line in the sequence it was written.  Without first finding all REPT blocks, there is no easy way to know you are working on the "inner" REPTs versus the outer REPT.  In addition, you're assuming a solution that handles your particular example without also assuming that there will someone else doing something even more "interesting" with the assembler.  For example, it's conceivable that someone might write code like this:

REPT 2
   REPT 3
   ENDR ; 3
   REPT 4
       REPT 5
       ENDR ; 5
       REPT 6
       ENDR ; 6
   ENDR ; 4
ENDR ; 2

Now there is an "inner-inner" block to handle as well as the previously mentioned "inner" block.  Furthermore, all of this is complicated by the presence of the IF assembler conditional and the possibility that inside REPT blocks may contain macros which themselve may contain nested or sequential (or both) REPT blocks.  It all gets nasty quickly, and it makes it impossible to test the assembler against all possible legal code sequences.

[list]Thanks,
PeterM[/list]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157579
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\28@045310 by IsmStudiosn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Nasty, ugly, disgusting, and who would've thought that parsing directives are more cryptic than translating mnemonic to machine code!

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m157630
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\11\30@103012 by IsmStudiosn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Hey Peter,
Any luck?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m158206
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)


'[SX] Embedded REPT's Crash/Error HELP!!'
2006\12\01@083109 by PJMontyn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Lewis,
Not really.  I thought I had a (relatively) simple solution that wouldn't require a lot of code "rip up and re-do", but it didn't work out.  Still working on it...

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m158363
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)

2006\12\08@100205 by IsmStudiosn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, IsmStudios wrote:

Peter,
Has the SASM driven you mad yet? I know it must be a pain to maintain an assembler like this. How's it going?

-Lewis
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=157382#m159669
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)


'[SX] Help!!! Badly need PIC16CXX programmer board'
2009\01\28@062120 by dy7783n/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, dy7783 wrote:

Does anyone know where I can buy PIC16CXX programmer board? I need it badly. Please Help me!!!! see attachment/website for picture. [http://marwww.in2p3.fr/~levansuu/projets_es2i/Parallax/parallax%20website/imgpic/picpgmr.gif]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=323725
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\28@071605 by couch-pilotn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, couch-pilot wrote:

You can use a Picstart Plus kit. Microchip still sells them. However, they are fairly expensive, around 200$ USD. They also come up on ebay from time to time.

-Benoit
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=323725#m323736
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\28@075122 by mgreenn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mgreen wrote:

It's against forum rules to post the same message on more than one forum.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=323725#m323741
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\01\28@104129 by tsaavikn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tsaavik wrote:

You could try building one:
http://www.semis.demon.co.uk/uJDM/uJDMmain.htm
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=323725#m323780
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...