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

_Sub string match.
PICList Thread
'snip those replies please'
1996\07\13@021929 by &Ltwouter Suverkropp

picon face
Hi Folks,

As a lurker I have no right to speak, so I'll write. Please don't be offended.

When replying to a message, please remove any part of the message that is not
totally relevant. Recently we've seen some threads in which the whole thread
is copied in every single message, wasting lots of bandwith and not really
adding much to the meaning of the reply.

Have mercy on those with low bandwith links.

Thank you,

Wouter


'snip'
1998\02\20@125123 by andre
flavicon
face
Hi to all piclisters.

I like  to know  meaning of *snip*.

Andre

1998\02\20@143907 by Bob Blick

face
flavicon
face
On Fri, 20 Feb 1998, Andre Abelian wrote:

> Hi to all piclisters.
>
> I like  to know  meaning of *snip*.
>
> Andre
>

Hi Andre,

Snip indicates that a part of the original message is being quoted, not
the whole message. It's like the sound that scissors make when cutting
paper.

Cheers,

Bob

1998\02\20@144514 by Bob Shaver

flavicon
face
When it appears in a response that quotes the original message, "snip"
means that some of the original (long) message has been deleted from the
response.  The "snip" is the sound of scissors cutting out non-relevant
text.

On Friday, February 20, 1998 11:05 AM, Andre Abelian
[SMTP:spam_OUTandreTakeThisOuTspamCOMPUFIRE.COM] wrote:
> Hi to all piclisters.
>
> I like  to know  meaning of *snip*.
>
> Andre
>

1998\02\20@155643 by Wim E. van Bemmel

picon face
part 0 1205 bytes content-type:text/x-vcard; charset=us-ascii; name="vcard.vcf" (decoded 7bit)

SNIP, autosnip!

bye... Wim (trying to find out why his signature is gone..)
Was there before reinstalling Winvirus95 !


Bob Shaver wrote:

{Quote hidden}

--

 Regards,

 -------------------------------------------------------------
 Wim E. van Bemmel

 No Unsollicited commercial bemspanspamKILLspamxs4all.nl

 Life is about Interfacing....
 -------------------------------------------------------------


Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Wim E. van Bemmel
Content-Disposition: attachment; filename="vcard.vcf"

Attachment converted: wonderland:vcard.vcf (TEXT/CSOm) (0001338F)

1998\02\20@190133 by Sean Breheny

face picon face
At 09:17 PM 2/20/98 +0100, you wrote:
>Hi!
>
>SNIP, autosnip!
>
>bye... Wim (trying to find out why his signature is gone..)
>Was there before reinstalling Winvirus95 !
>
>

<SNIP>

{Quote hidden}

Hi Wim,

Personally, I don't mind when people send test mail to the list, but I am
curious about why you can't just send mail directly to yourself to
determine things like this. Also, your signature IS being placed at the end
of the message. I am not sure if that attachment is being created on your
end or mine.

Sean

+--------------------------------+
| Sean Breheny                   |
| Amateur Radio Callsign: KA3YXM |
| Electrical Engineering Student |
+--------------------------------+
Fight injustice, please look at
http://homepages.enterprise.net/toolan/joanandrews/

Personal page: http://www.people.cornell.edu/pages/shb7
EraseMEshb7spam_OUTspamTakeThisOuTcornell.edu
Phone(USA): (607) 253-0315


'Snippet Page'
1998\07\14@190236 by myke predko
flavicon
face
Hi Folks,

I just wanted to point out that on my web page, I've added a "Snippet" page
with a few pieces of code I've found over the past year.

http://www.myke.com

It's right at the top, under the circling "new" GIF.

If you have anything you think should go in there as well, please let me
have it.

myke

This week in myke's Book Room: "The Night Crew" by John Sandford

http://www.myke.com/Book_Room


'Picstart 16b + A SNIPPET OF CODE'
1998\08\23@162956 by Mike Ghormley
flavicon
face
Bob Cousins wrote:

> I don't want to take sides or anything,  <snip>

Don McKenzie wrote:

> No, I'm not getting in the center of this Jim/Mike exchange, <snip>

It seems to me that there are no "sides" in this matter.  Both Jim and I are on
the
same side.  He wishes for his freeware to be used under certain restraints.  I c
ould
not divine from Jim's verbiage that this was his wish -- that may or may not be
my
fault, but it is incidental.  What is important is that now I (and others, I am
sure)
know how the author feels and I will acquiesce to his wishes in this matter, and
I
urge everyone else to do the same.  Both he and I want folks to act ethically an
d
responsibly, methinks.  We just seem to go about it in different ways.  I, for o
ne,
thank Jim for doing the work and releasing it at all.

I got this old 16B for $10 or something and I thought it would be nice to fix it
up
(if it didn't cost too much) and give it to a local school or some promising kid
, but
this amount of bandwidth is hardly worth it.  I will await Jim's instructions an
d
adhere to them in regards to his product -- provided that the instructions do no
t
invovle any bodily orifices!  ;^)

One of the refreshing things about this list as opposed to some (most) newsgroup
s is
the refreshing ratio of pissing contests to useful information.  An occasional s
pleen
venting can be endured, yes?  Let's not polarize this little issue, and move on
to
more meaty subjects.

Speaking of which, I have been using a little piece of code when I have the extr
a ROM
space.  I like it and I'll bet at least a couple of people will not have thought
of
it, even though it is hardly "rocket science."

;****************************************************************************
; SUBROUTINE:  DELAY4 thru DELAY25
; delays of 4 to 25 clock cycles
;****************************************************************************
DELAY25
       NOP
DELAY24
       NOP
DELAY23
       NOP
DELAY22
       NOP
DELAY21
       NOP
DELAY20
       NOP
DELAY19
       NOP
DELAY18
       NOP
DELAY17
       NOP
DELAY16
       NOP
DELAY15
       NOP
DELAY14
       NOP
DELAY13
       NOP
DELAY12
       NOP
DELAY11
       NOP
DELAY10
       NOP
DELAY9
       NOP
DELAY8
       NOP
DELAY7
       NOP
DELAY6
       NOP
DELAY5
       NOP
DELAY4
   RETLW       0

Just an offering to try to refocus our attention back to PICs...

Michael

*************************************************************************
When the way of the Tao is forgotten, kindness and ethics must be taught.
Men must learn to pretend to be wise and good.  --  Lao Tzu
*************************************************************************

'fine-tuned delays (was Picstart 16b + A SNIPPET OF'
1998\08\24@083849 by wwl

picon face
>Speaking of which, I have been using a little piece of code when I have the extra ROM
>space.  I like it and I'll bet at least a couple of people will not have thought of
>it, even though it is hardly "rocket science."
>
>;****************************************************************************
>; SUBROUTINE:  DELAY4 thru DELAY25
>; delays of 4 to 25 clock cycles
>;****************************************************************************
>DELAY25
>        NOP
...etc...
>DELAY5
>        NOP
>DELAY4
>    RETLW       0
>
>Just an offering to try to refocus our attention back to PICs...

How about this -use  macro wait(n) to delay *any* amount from 0 to 255
cycles - for 16cxx but could easily be adapted for 5x

shortwait macro del
if (del>3) && (del<8)
call del7+(7-(del))
endif

if del <4
 if del>=2
 goto $+1
 endif
 if ((del) & 1) == 1
 nop
 endif
endif
endm

wait macro del  ; wait for (del) cycles)
if (del)<0
error 'negative delay'
endif
if (del)>=8
movlw ((del)-8) /4
call delay
shortwait ((del-8) % 4)
else
shortwait (del)
endif
endm

del7 goto del5  ; 7 cycle delay
del6 goto del4  ; 6 cycle delay
del5 nop           ; 5 cycle delay
del4 return      ; 4 cycle delay

delay
addlw 0ff
skpnc  goto delay
return

    ____                                                           ____
  _/ L_/  Mike Harrison / White Wing Logic / wwlspamspam_OUTnetcomuk.co.uk  _/ L_/
_/ W_/  Hardware & Software design / PCB Design / Consultancy  _/ W_/
/_W_/  Industrial / Computer Peripherals / Hazardous Area      /_W_/


'Low Frequency, code snippit'
1999\06\03@030237 by Donald Riedinger
picon face
;16C5xxLP are good with 32.768 khz crystals and cheap
;With a 32.768 khz xtal this LED would flash once every 8 seconds:

; Loop 65536 times, then invert the LED
;
:Loop           djnz    Count0,:Loop    ;Decrement Count0 until it reaches zero
               djnz    Count1,:Loop    ;Decrement Count1.  If it's not zero,
                                       ;jump back to :Loop
               xor     RA,#00000010b   ;Invert the LED (bit 2 of port A)

;Add another loop and it's almost a day and a half

;You can size the first loop to the units you want to measure, then
count those loops
;This could be your input:

; Check button status.  If it's pressed, skip the additional delay and
jump
; back to the first loop
;

ChkBtn          jnb     RA.0,Start:Loop ;Jump to 1st loop if button is pressed
                                       ;(button is active low)
               mov     count0,#50      ;Limit first loop to time period you wan
t
:Loop           djnz    Count0,:Loop    ;Decrement Count0 until it reaches zero
               djnz    Count1,:Loop    ;Decrement Count1.  If it's not zero,
                                       ;jump back to :Loop
                                       ;Or limit Count1 to the number
of time periods
               jmp     Start:Loop      ;Jump back to first loop

;you can get into granularity and counting cycles but a stopwatch is the
way to go
;Code from Simple.src, Parallax Inc.


'Snippets'
1999\09\27@192617 by Tony Nixon
flavicon
picon face
Hi all,

In light of all the discussion recently this may be off topic now ;-)


Just a few code snippets I discovered in the last two weeks while
writing some new software.

if RAMx > Y

movf RAMx,w
addlw 255 - Y           ; eg if RAMx > 5 ... addlw d'250'
btfsc status,carry
goto True

if RAMx < Y

movf RAMx,w
addlw 255 - Y + 1       ; eg if RAMx < 5 ... addlw d'251'
btfss status,carry
goto True

if RAMx >= Y

movf RAMx,w
addlw 255 - Y + 1       ; eg if RAMx >= 5 ... addlw d'251'
btfsc status,carry
goto True

if RAMx <= Y

movf RAMx,w
addlw 255 - Y           ; eg if RAMx <= 5 ... addlw d'250'
btfss status,carry
goto True


--
Best regards

Tony

http://www.picnpoke.com
Email @spam@salesKILLspamspampicnpoke.com

1999\09\27@193239 by Richard Prosser

flavicon
face
I take this as an indication that I'm not the only one confused by the
result of the carry bit following subtraction - I always get it wrong - (but
thought I was just not suited to the mental gymnastics involved.)

Richard

> {Original Message removed}

'More snippets'
1999\09\27@200152 by Tony Nixon

flavicon
picon face
Hi all,

Just following on from the previous snippets, in an effort to make
comparisons easier to understand, here are some more. The best part is,
the Z flag is ignored.

if RAMx > RAMy

movf RAMy,w
sublw 0xFF
addwf RAMx,w
btfsc status,carry
goto true

if RAMx < RAMy

movf RAMx,w
sublw 0xFF
addwf RAMy,w
btfsc status,carry
goto true

if RAMx >= RAMy

movf RAMx,w
sublw 0xFF
addwf RAMy,w
btfss status,carry
goto true

if RAMx <= RAMy

movf RAMy,w
sublw 0xFF
addwf RAMx,w
btfss status,carry
goto true


--
Best regards

Tony

http://www.picnpoke.com
Email KILLspamsalesKILLspamspampicnpoke.com

1999\09\29@213031 by Scott Dattalo

face
flavicon
face
Let's see how the 18cxxx parts compare

On Tue, 28 Sep 1999, Tony Nixon wrote:

{Quote hidden}

 movf  RAMx,w  ;wreg = RAMx
 subwf RAMy,w  ;wreg = RAMy - RAMx
 bn    true    ;Branch if negative
               ;The N bit will be cleared if RAMx == RAMy or
               ;RAMy > RAMx, and will be set if RAMy < RAMx

(or you could use the bnc [branch if no carry] to achieve the same effect.
The negative bit has a clearer meaning in this context).

18cxxx 3*16 = 48 bits of program memory
16cxxx 5*14 = 70 bits of program memory


btw, Tony's example can be shortened to:

 movf  RAMx,w
 subwf RAMy,w
 skpc
  goto true

but there are still 4*14 = 52 bits. however this works on the 12bit core,
so only 4*12 = 48 bits of program memory are required there.


>
> if RAMx < RAMy
>
> movf RAMx,w
> sublw 0xFF
> addwf RAMy,w
> btfsc status,carry
> goto true
>

 Same as above with RAMx and RAMy exchanged.

> if RAMx >= RAMy
>
> movf RAMx,w
> sublw 0xFF
> addwf RAMy,w
> btfss status,carry
> goto true
>

 movf  RAMy,w    ;wreg = RAMy
 subwf RAMx,w    ;wreg = RAMx - RAMy
 bnn   true      ;branch if not negative
                 ;The N bit will be cleared if RAMx == RAMy or
                 ;RAMx > RAMy, and will be set if RAMy < RAMx

Again, you could use the bc (branch on carry) instruction too. Also,
Tony's sequence can be reduced by an instruction.

> if RAMx <= RAMy
>
> movf RAMy,w
> sublw 0xFF
> addwf RAMx,w
> btfss status,carry
> goto true



Scott


'More snippets'
1999\10\05@180639 by frmiller
flavicon
face
Just out of curiosity, if you're using an 18C (or 17C) part,
why wouldn't you use the CPFSEQ, CPFSLT, or CPFSGT
mnemonics?


Ryan



> {Original Message removed}

1999\10\05@193222 by Scott Dattalo

face
flavicon
face
On Tue, 5 Oct 1999, Ryan Miller wrote:

> Just out of curiosity, if you're using an 18C (or 17C) part,
> why wouldn't you use the CPFSEQ, CPFSLT, or CPFSGT
> mnemonics?

Hmmm. That IS a good question. The answer: I totally forgot about them!

Now the challenge, how would you use these for an efficient 16 bit
comparison?

Say

char compare(unsigned int a, unsigned int b)
{

if(a<b)
  {
    a is less than b
  }
else
  {
    a is greater than or equal to b
  }
}


 movf    b_hi,w
 cpfslt  a_hi
  bra    a_is_ge_b
 movf    b_lo,w
 cpfslt  a_lo
  bra    a_is_ge_b
a_is_lt_b
 ...


a_is_ge_b
 ...


But this can be made faster by using subtracts:

  movf   b_lo,w
  subwf  a_lo,w
  movf   b_hi,w
  subwfc a_hi,w
  bnc    ...      (or bc ...)

Any ideas?

Scott


'16F874 ADC snippet wanted.........'
1999\12\06@225304 by Rob Symmans
flavicon
face
I am new to using the ADC on the 'F874 and wondered if anyone had a
"code snippet" for setting up and reading an ADC channel. I could grind
my way through it but need to get a small job up and running as soon as
I can. I am jury rigging a 'F874 as a single channel logger and serially
outputting the result to a PC for data collection / processing.

Any gifts appreciated !!

thanks
rob


'Does anyone know a good snippet site?'
2000\01\18@060528 by Mordred of Logris
picon face
Hi, all!

Anyone knowing a good snippet-site, describing some
basics like, say, keypad reading, interrupt usage and
such, preferrably in c?

I am a new PIC programmer, and still experience the
"culture shock" in seeing how different is the
architecture from the PC...

Thanks in advance.

=====
May the ground never receive thee ...
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

2000\01\18@105045 by Ivan Dachev

picon face
----- Original Message -----
From: Mordred of Logris <RemoveMEmordred_picTakeThisOuTspamYAHOO.COM>
To: <spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU>
Sent: Tuesday, January 18, 2000 1:04 PM
Subject: Does anyone know a good snippet site?


{Quote hidden}

Mara Sasho

ti vze li si ot diskovete v Comet electroniks
tam ima baia neshta
po princip diska e Snap shot na Saita na microchip
ni si ima vsichko na nego samo triabva da se porazrovish

aide chao
Ejko of Gorata :P ;)


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


'[PIC]: Hi-Tech C maths code snippet please'
2000\11\15@091635 by JP.BROWN
flavicon
face
Hi Folks, could someone please send me a short program that uses some
maths functions. I have searched the net in vain.  I am writing some small
control programs and I am getting some strange linking error messages so I
would like to see some working code to see if I have missed something.

Ta  John

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



'[PIC]: ISR snippet'
2000\12\22@131218 by Drew Vassallo
picon face
Hi all,

Just looking through my code to try to reduce some cycles and came up with
this method for compensating for lost time during ISR servicing.

If you're doing a PWM loop or otherwise performing some loop count timing
and get interrupted, you might be able to compensate for the lost time with:

;; No context saving required.
btfsc   flag, 0    ; to indicate whether or not you're inside PWM loop
decfsz  counter    ; loop counter for PWM
retfie
incfsz  counter
retfie

Note that the last incfsz (not incf!) is needed so your counter doesn't go
below zero, which could hurt if you're using decfsz to monitor your loop
counter.  It would never skip the last retfie.

Of course, the path through the ISR has to be equal in time to the time
through one PWM loop for this to be at all valuable.

Just thought I'd throw it out there as a useful snippet if anyone is
intersted.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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


2000\12\26@134256 by rich+piclist

flavicon
face
Cool!

> ;; No context saving required.
> btfsc   flag, 0    ; to indicate whether or not you're inside PWM loop
> decfsz  counter    ; loop counter for PWM
> retfie
> incfsz  counter
> retfie

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



'[PIC]: Code snippet wanted .... or ... bit swap ch'
2001\02\06@181309 by Drew Vassallo
picon face
Having little free time to actually optimize my code to its fullest
potential, I'm frequently forced to take the brute force approach to many
problems.  Here's one:

I have 2 chips installed side by side that I would like to connect directly
parallel to each other's ports (8 bits each) rather than crossing the wires,
but the PORTB pins on my PIC are reversed from the matching port on the
other IC.  (RB0 lines up with IC7, etc.)

Here's my brute force bit-swapping code to reverse the output:

;------ Call into this routine with the output value in W.
;------ It will be swapped and returned in W.
;------ Example:  Input=0xA7, Output=0xE5
Bit_Swap
               movwf   InputReg
               movlw   0x08
               movwf   BCount
BS_Loop
               rrf     InputReg, f
               rlf     OutputReg, f
               decfsz  BCount, f
               goto    BS_Loop
               movf    OutputReg, w
               return

45 cycles is pretty lame.  Any ideas?

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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


2001\02\06@182322 by Drew Vassallo

picon face
Never mind my challenge, I should have known Dmitry had it covered:

;       Input X  = abcdefgh , Output X = hgfedcba
;       Written by Dmitry A. Kiryashov 2000
;       12 clocks/words

reverse8bit:

       swapf   X,W     ;efghabcd
       xorwf   X,W     ;efghabcd
                       ;abcdefgh

       andlw   0x66    ;.fg..bc.
                       ;.bc..fg.

       xorwf   X,F     ;afgdebch
;
       rrf     X,W
       rrf     X,F     ;hafgdebc
;
       andlw   0x55    ;.a.g.e.c
       addwf   X,F     ;h.f.d.b.
                       ;a.g.e.c.
       rrf     X,F     ;.h.f.d.b
                       ;.a.g.e.c

       addwf   X,F     ;ahgfedcb
;
       rlf     X,W
       rlf     X,F     ;hgfedcba
                       ;it can be replaced
                       ;with rlf X,W
                       ;if necessary...


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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


2001\02\06@185850 by jamesnewton

face picon face
This and several other versions (quickest, smallest, etc..) listed at

http://www.piclist.com/techref/microchip/math/bit/revbits.htm

---
James Newton (PICList Admin #3)
jamesnewtonEraseMEspam.....piclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

2001\02\06@192933 by Bob Ammerman

picon face
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f
   rrf    InputReg,f
   rlf    OutputReg,f

:-)

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

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


'[PIC]: RTC conversion snippets'
2001\02\16@113853 by Drew Vassallo

picon face
There's been some discussion about using RTCs lately.  Typically, they
send/receive in packed BCD.  Except for the year, which is 0-99, all of the
other variables are within 0-64 BCD.

After briefly searching the PICLIST archives, I couldn't really find any
snippets that weren't overkill for this purpose, so I made my own.  Most of
them were 0-FF converted to/from BCD.  These are more specific to RTC time
conversion and have reduced instruction counts over the "standard" code
fragments.

If you convert your hours to 12-hour format instead of the 24-hour output
format of the RTC, you can use the obvious:
; BCD conversion is limited to "Hours" values less than 16
               movf    Hours, 0
               addlw   0x06
               skpdc
               addlw   -0x06
               movwf   Hours
This can also be used for month and day of the week.

For minutes, seconds, and date, you can use:
; BCD conversion is limited to "Minutes" values less than 64
               clrw
               btfsc   Minutes, 4
               addlw   0x16
               btfsc   Minutes, 5
               addlw   0x32
               addlw   0x06
               skpdc
               addlw   -0x06
               movwf   Time_Temp
               movf    Minutes, 0
               andlw   0x0F
               addwf   Time_Temp, 0
               skpndc
               addlw   0x06
               addlw   0x06
               skpdc
               addlw   -0x06
               movwf   Minutes

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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



'[PIC]: PICLoader Code Snippet'
2001\12\06@114636 by phil
flavicon
face
All,

 I am just beginning to learn about the PIC and the programming environment.  I should be receiving in the next couple of days an EVB and 16F877’s already loaded with the Rick Farmer bootloader (from the Portland Area Robotics Society).

  I am basically a hardware person, so my understanding of machine level code is not as strong as it should be.   What I am looking for is a snippet or template of ASM code that is compatible with the Rick Farmer bootloader.  Does anyone have a small piece of code they would be willing to share?

 Thanks for your assistance,
Phil

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


2001\12\07@054955 by Vasile Surducan

flavicon
face
unfortunately you don't choose the right bootloader.
anyway, Rick farmer's have already inside a test program, i don't remember
what it does. I suggest you ( as a hardware guy also, who test this
bootloader ) to switch to one of these:

** http://www.bubblesoftonline.com/ROMzap.html ; only one are valid, try
** http://www.picnpoke.com/demo/ROMzap.zip
http://www.htsoft.com/files/samples/bootldr.zip * http://www.xs4all.nl/~wf/wouter/pic/wloader
www.workingtex.com/htpic/PIC_bootloader.htm
*** http://www.ise.pw.edu.pl/~wzab/linwload/linwload.html http://www.seanet.com/~karllunt/picload.htm
* dos
** windows
*** linux
To the others I don't know the platform
I like wloader but this means nothing.

Regards, Vasile

On Thu, 6 Dec 2001, Phil Keller wrote:

{Quote hidden}

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


2001\12\09@181425 by Tony Nixon

flavicon
picon face
Vasile Surducan wrote:
>
> unfortunately you don't choose the right bootloader.
> anyway, Rick farmer's have already inside a test program, i don't remember
> what it does. I suggest you ( as a hardware guy also, who test this
> bootloader ) to switch to one of these:
>
> ** http://www.bubblesoftonline.com/ROMzap.html ; only one are valid, try
> ** http://www.picnpoke.com/demo/ROMzap.zip


PicNPoke.com is dead now as far as PICs are concerned. Someone has now
turned it into a porn site.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
RemoveMEsalesTakeThisOuTspamspambubblesoftonline.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


2001\12\09@184948 by Josh Koffman

flavicon
face
I don't know if this is a touchy subject or anything Tony, but what is
the story with the whole name switch?

Just curious...

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

{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


2001\12\09@193632 by Tony Nixon

flavicon
picon face
Josh Koffman wrote:
>
> I don't know if this is a touchy subject or anything Tony, but what is
> the story with the whole name switch?
>
> Just curious...
>
> Josh

A request by Microchip to avoid using any names with "PIC" in them.


--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
RemoveMEsalesKILLspamspambubblesoftonline.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


2001\12\09@212121 by Josh Koffman

flavicon
face
Ahh...brilliant legal teams at work shooting themselves in their own
feet.

I'm sorry to hear you're the latest victim of misdirected "oh no, that's
my intellectual property".

Josh

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Tony Nixon 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


2001\12\09@212950 by Alexandre Domingos F. Souza

flavicon
face
>Ahh...brilliant legal teams at work shooting themselves in their own
>feet.
>I'm sorry to hear you're the latest victim of misdirected "oh no, that's
>my intellectual property".

       If I were Tony, I'd write in every place PIC is written on his site, something like "(that excellent processor from a damm company that denies me even the right of doing free ads for them)".

       So good in microchips, so bad in marketing...


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

Alexandre Souza
spamBeGonetaitoSTOPspamspamEraseMEterra.com.br
http://planeta.terra.com.br/lazer/pinball/

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

--
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\12\10@050118 by Bryan W

flavicon
face
I'd of thought they would have been more interested in selling silicon than
victimising people for using the PIC name in a legitimate PIC users site. Or
are they selling so many that they don't care.

Jeez, makes me glad other manufacturers aren't like that.

Bryan

{Original Message removed}

2001\12\10@082904 by Dale Botkin

flavicon
face
Gee, I wonder if the result was what they intended...  8-P

Dale
--
"Curiosity is the very basis of education and if you tell me that
curiosity killed the cat, I say only the cat died nobly."
         - Arnold Edinborough


On Mon, 10 Dec 2001, Tony Nixon wrote:

{Quote hidden}

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


2001\12\12@203513 by Alexandre Domingos F. Souza

flavicon
face
>I'd of thought they would have been more interested in selling silicon than
>victimising people for using the PIC name in a legitimate PIC users site. Or
>are they selling so many that they don't care.
>Jeez, makes me glad other manufacturers aren't like that.

       Remember: What are 5000 dead lawyers? A good start ;o)

       Sometimes this is all guilt of lawyers - they do these things and not even tell the presidential group what the hell they are doing. Oh complicated people!


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

Alexandre Souza
KILLspamtaitospamBeGonespamterra.com.br
http://planeta.terra.com.br/lazer/pinball/

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

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



'[PIC] Would appreciate code snippet to get me sta'
2002\09\06@092421 by Magnus von Rosen
flavicon
face
Howdy,

I have been trying to get started with PIC programming for a couple of
weeks now, but am having trouble getting something done. I read the
books but it seems like there is so much PIC-specific to learn before
it's possible to even blink a LED.
I have better experience in learning as I go...even though that probably
takes longer time. The problem here is I can't  'go' at all... "Iv'e
fallen, and I can't get up." :)

1. Does anyone have a nice piece of code that blinks a LED? I'm using
the 16F84/84A and the 16F628.
Preferably with some comments so I can figure out what it does and why.

2. My dream project is to design an awesome light-kit for an R/C model.
How should I go about decoding the PWM-signals from the reciever? Should
I count the milliseconds manually through the code, or is there a clever
system that does this for me? I need to know whether the PWM pulse is
between 1-1.4ms, 1.4-1.6ms or 1.6-2.0ms. Any design hints are
appreciated!

Thanks in advance

Magnus von Rosen, Sweden.

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


2002\09\06@093310 by Wouter van Ooijen

face picon face
> 1. Does anyone have a nice piece of code that blinks a LED? I'm using
> the 16F84/84A and the 16F628.
> Preferably with some comments so I can figure out what it
> does and why.

http://www.voti.nl/wisp628 : blink-a-led circuit diagrams, solderless
breadboard foto's, programs (Jal and .hex)

http://www.voti.nl/cursus/e_index.html : learn while you do starting at
a very simple level

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

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


2002\09\06@095152 by Magnus von Rosen

flavicon
face
Thanks for the reply,

JAL seems like a neat language, very smooth apparently. However, I need
to learn C or assembly. I have experience of both, from programming C on
the PC and ASM on the 68000.

This is in part for a "do what you like"-course where I eventually will
have to learn C for PIC, but I would actually like to learn to do it in
assembly first.
Regrettably, your page only have JAL-examples. I will however inlude it in my presenation as an example, I will
probably experiment with it later.

Thanks,

Magnus

-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list
[@spam@PICLIST@spam@spamspam_OUTmitvma.mit.edu] För Wouter van Ooijen
Skickat: den 6 september 2002 15:32
Till: spamBeGonePICLISTspamKILLspammitvma.mit.edu
Ämne: Re: [PIC] Would appreciate code snippet to get me started


> 1. Does anyone have a nice piece of code that blinks a LED? I'm using
> the 16F84/84A and the 16F628. Preferably with some comments so I can
> figure out what it does and why.

http://www.voti.nl/wisp628 : blink-a-led circuit diagrams, solderless
breadboard foto's, programs (Jal and .hex)

http://www.voti.nl/cursus/e_index.html : learn while you do starting at
a very simple level

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

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

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


2002\09\06@100047 by Wouter van Ooijen

face picon face
> However, I need to learn C or assembly.

The first advice still holds: make hardware, get 'known-correct'
blink-a-led (don't care which language) and only start writing code
yourself when that works. Take one step at a time.

> Regrettably, your page only have JAL-examples.

Sure, because I am mr. Jal. You could still take the assignments and
make them in C, the logic would remain the same.

succes!
Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

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


2002\09\06@100559 by kben

picon face
Hi,
Try the PICList - These pages should have all you need
to get started.

bincnt.asm - Count in binary on 4 LEDs
http://www.piclist.org/techref/piclist/cheapic/bincnt.htm

Cheapic Tutorial
http://www.piclist.org/techref/piclist/cheapic/index.htm

Beginner's Checklist
http://www.piclist.org/techref/piclist/begin.htm

Intro to the PIC
http://www.piclist.org/techref/microchip/intro/pic.htm

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


2002\09\06@102731 by Nelson Hochberg

flavicon
face
www.bubblesoftonline.com/projects.zip
{Quote hidden}

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


2002\09\06@111444 by Magnus von Rosen

flavicon
face
Projects.zip is beautiful! Looks like exactly what I need!
Thanks a bunch!!

Regards
Magnus

-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list
[.....PICLISTspam_OUTspammitvma.mit.edu] För Nelson Hochberg
Skickat: den 6 september 2002 16:23
Till: TakeThisOuTPICLIST.....spamTakeThisOuTmitvma.mit.edu
Ämne: Re: [PIC] Would appreciate code snippet to get me started


http://www.bubblesoftonline.com/projects.zip
{Quote hidden}

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

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


2002\09\06@212644 by Nelson Hochberg

flavicon
face
Be sure to thank Tony; he wrote it.  I highly recommend his V5 teaching
package.  I found it very helpful.

Nelson

{Quote hidden}

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


2002\09\07@110707 by miked

flavicon
face
Here are some r/c routines I have found.
>
> 2. My dream project is to design an awesome light-kit for an R/C model.
> How should I go about decoding the PWM-signals from the reciever? Should I
> count the milliseconds manually through the code, or is there a clever
> system that does this for me? I need to know whether the PWM pulse is
> between 1-1.4ms, 1.4-1.6ms or 1.6-2.0ms. Any design hints are appreciated!
>


Michiana R/C Choppers
http://www.mrcc.info
RemoveMEmikedspamspamBeGonemrcc.info

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


2002\09\08@141559 by Magnus von Rosen

flavicon
face
I don't know who everyone is yet, who is Tony and how do I get in touch
with him? I could on find any contact info in the file. I have also
found an error ( I think) which he might like to put in for future
versions.

Regards
Magnus, Sweden
TakeThisOuTpt98mvospamspamstudent.bth.se

-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list
[PICLISTEraseMEspammitvma.mit.edu] För Nelson Hochberg
Skickat: den 7 september 2002 03:26
Till: RemoveMEPICLISTEraseMEspamspam_OUTmitvma.mit.edu
Ämne: Re: [PIC] Would appreciate code snippet to get me started


Be sure to thank Tony; he wrote it.  I highly recommend his V5 teaching
package.  I found it very helpful.

Nelson

{Quote hidden}

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

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestspam_OUTspam.....mitvma.mit.edu


2002\09\08@144415 by Nelson Hochberg

flavicon
face
Sorry Magnus.  Toni is at http://www.bubblesortonline.com.  I thought the address
was obvious since it is the root for where projects.zip is found.

Nelson

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam@spam@mitvma.mit.edu


2002\09\08@182449 by Tony Nixon

flavicon
picon face
> > I don't know who everyone is yet, who is Tony and how do I get in touch
> > with him? I could on find any contact info in the file. I have also
> > found an error ( I think) which he might like to put in for future
> > versions.
> >
> > Regards
> > Magnus, Sweden
> > RemoveMEpt98mvospamspamBeGonestudent.bth.se

Here I am :-)

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
spamBeGonesalesKILLspamspam@spam@bubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspam_OUTspam@spam@mitvma.mit.edu



'[PIC]: PWM problem, error in original Code snippe'
2003\01\17@105504 by James Williams
picon face
Hello to all that have been replying, in particular to Nigel.

Nigel, you are correct in your statements and I apologize for making it
seem you were wrong.  You see, when you had posted your answer back I
would look at my actual code in MPLAB.  Hence I had left one important
line of code out in the example.  It should have been as follows:

SetTrickel:
1          ;1, set the period register.
2          MOVFF TRICKEL_FREQ_PERIOD,PR2
3          ;2. Write the duty cycle
4          MOVFF TRICKEL_DUTY_H,CCPR1L
5          MOVLW            B'11001111'
6          ANDWF            CCP1CON,W,A
7          IORWF TRICKEL_DUTY_L,W,BANKED
8          MOVWF           CCP1CON,A
9          ;3. Set prescale
10         MOVLW            B'00000011'
11         ANDLW            0X03                 ;Prescale bit for 16
;Replaces real code ANDWF TRICKEL_PRESCALE,F,A
12         MOVWF           TEMP
..
12A      MOVLW            0XFC                ;Strip bit 0 and 1 from
T2CON.
12B      ANDWF            T2CON,W,A
12C      IORWF             TEMP,W
12D      MOVWF           T2CON,A

..
13         ANDWF            T2CON,F,A
14         ;           BCF                  T2CON,T2CKPS0,A
15         ;           BSF                  T2CON,T2CKPS1,A
16         ;4. Turn timer 2 on and configure for PWM mode.
17         BSF                  T2CON,TMR2ON,A
18         RETURN


I had left out some vary import lines of code.  My mistake.  However,
this is the real segment that my real code contains.
MOVLW            0X03
ANDWF            TRICKEL_PRESCALE,F,BANKED
MOVLW            0XFC
ANDWF            T2CON,W,A
IORWF             TRICKEL_PRESCALE,W,BANKED
MOVWF           T2CON,F,A

This still does not work in the real running code though.

Regards,


James
P.S.  I decided to use a different email client just for the PIC so that
the reply is left out.  Otherwise I use my normal Outlook mail client
for normal mail in with I desire to leave the reply address set.

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


'[OT:] Pseudo-Snipping?'
2004\09\07@140034 by Dave VanHorn
flavicon
face

What's up with the "snip" thing that is now showing up in piclist posts?

When I reply, the whole thing is there, but when I'm viewing the message, large chunks of the message are hidden from me..  I've seen some where virtually everything in the message was hidden this way, and I had to do a reply to see anything useful.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\07@143944 by Josh Koffman

face picon face
Dave, I don't know what email client you are using, but on Gmail, they
are doing something kind of interesting. Basically emails are arranged
into "conversations", basically a thread with matching subject lines.
Anyway, it seems to hide text that shows up in an earlier email,
essentially hiding the quoted parts of a reply. Sometimes, if a reply
gets to me before the original post (yes, it is possible), then the
original post has all the text hidden.

Now, I'm not saying that's what your client is doing, but perhaps it's
a possibility?

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

On Tue, 07 Sep 2004 13:00:52 -0500, Dave VanHorn <spamBeGonedvanhorn@spam@spamdvanhorn.org> wrote:
>
> What's up with the "snip" thing that is now showing up in piclist posts?
>
> When I reply, the whole thing is there, but when I'm viewing the message, large chunks of the message are hidden from me..  I've seen some where virtually everything in the message was hidden this way, and I had to do a reply to see anything useful.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\07@150416 by Dave VanHorn

flavicon
face

>
>Now, I'm not saying that's what your client is doing, but perhaps it's
>a possibility?

Eudora here, 6.2.  Something's happening on the client end, but it seems a little broken when it occasionally obscures the only real content in the message.


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\07@162353 by hilip Stortz

picon face
definitely a problem with your' email reader.  i know some have problems
with email that starts with a space (there was a version of exploiter
that missed all the text in that case).  i've been seeing everything
that hasn't been politely trimmed in responses (and i do appreciate
people trimming when they respond, especially when adding one sentence
to several paragraphs of other people's responses)  perhaps your
software thinks "SNIP" is a tag of some kind, in which case this should
confuse you nicely...

Dave VanHorn wrote:
>
> What's up with the "snip" thing that is now showing up in piclist posts?
>
> When I reply, the whole thing is there, but when I'm viewing the message, large chunks of the message are hidden from me..  I've seen some where virtually everything in the message was hidden this way, and I had to do a reply to see anything useful.
>
> _______________________________________________
> http://www.piclist.com
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist

-- Philip Stortz--"In Germany they came first for the Communists, and I
didn't speak up because I wasn't a Communist. Then they came for the Jews, and I didn't speak up because I wasn't a
Jew. Then they came for the trade unionists, and I didn't speak up because I
wasn't a trade unionist. Then they came for the Catholics, and I didn't speak up because I was a
Protestant. Then they came for me, and by that time no one was left to speak up."
-- Martin Niemöller, 1892-1984 (German Lutheran Pastor), on the Nazi
Holocaust, Congressional Record 14th October 1968 p31636.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\07@163620 by Dave VanHorn

flavicon
face
I don't think it knows "snip" exactly..
I'm only seeing/noticing this in piclist messages.

Here's how I saw that message:

From: Philip Stortz <RemoveMEmadscientist.at.largeEraseMEspamKILLspamearthlink.net>
To: "Microcontroller discussion list - Public." <spamBeGonepiclistspam_OUTspamRemoveMEmit.edu>
Subject: Re: [OT:] Pseudo-Snipping?

definitely a problem with your' email reader.  i know some have problems
with email that starts with a space (there was a version of exploiter
that missed all the text in that case).  i've been seeing everything
that hasn't been politely trimmed in responses (and i do appreciate
people trimming when they respond, especially when adding one sentence
to several paragraphs of other people's responses)  perhaps your
software thinks "SNIP" is a tag of some kind, in which case this should
confuse you nicely...

Dave VanHorn wrote:
> What's up with the "snip" thing that is now showing up in piclist posts?
>
> When I reply, the whole thing is there, but when ...
...snip...
> http://www.piclist.com
> View/change your membership options at
> http://mailman.mit.edu/mailman/listinfo/piclist

And when I click to reply to you, I get this:

At 03:25 PM 9/7/2004, Philip Stortz wrote:

{Quote hidden}

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\07@170039 by hilip Stortz

picon face
very odd.  since it's only occurring on this list, it sounds like some
kind of "rule" or "preference" is involved.  might i ask, what domain is
your' mail being sent from (or is this coming from a server and not
going through an isp?).  it sounds like something aol would do to save
bandwidth, except that the whole message appears to be in the email
client (or it would have a hard time quoting it), which means it pretty
well must be your' email client.  in that case, what client and what os
would be the logical questions.

Dave VanHorn wrote:
>
> I don't think it knows "snip" exactly..
> I'm only seeing/noticing this in piclist messages.
>
> Here's how I saw that message:
-------

-- Philip Stortz--"In Germany they came first for the Communists, and I
didn't speak up because I wasn't a Communist. Then they came for the Jews, and I didn't speak up because I wasn't a
Jew. Then they came for the trade unionists, and I didn't speak up because I
wasn't a trade unionist. Then they came for the Catholics, and I didn't speak up because I was a
Protestant. Then they came for me, and by that time no one was left to speak up."
-- Martin Niemöller, 1892-1984 (German Lutheran Pastor), on the Nazi
Holocaust, Congressional Record 14th October 1968 p31636.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\07@174252 by Dave VanHorn

flavicon
face
At 04:02 PM 9/7/2004, Philip Stortz wrote:

>very odd.  since it's only occurring on this list, it sounds like some
>kind of "rule" or "preference" is involved.  might i ask, what domain is
>your' mail being sent from (or is this coming from a server and not
>going through an isp?).  it sounds like something aol would do to save
>bandwidth, except that the whole message appears to be in the email
>client (or it would have a hard time quoting it), which means it pretty
>well must be your' email client.  in that case, what client and what os
>would be the logical questions.

No AOL involved, I get it though my own domain.
I'm running XP pro, second try, with Eudora 6.2

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist


'[PIC] SHT71 code snippets'
2005\01\30@105605 by alan smith
picon face
Anyone tied a PIC to this device and mind sharing code
snippets?  (this is the humidty sensor)


               
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

2005\01\30@112745 by Ake Hedman

flavicon
face
alan smith wrote:

>Anyone tied a PIC to this device and mind sharing code
>snippets?  (this is the humidty sensor)
>
>
>                
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - Helps protect you from nasty viruses.
>http://promotions.yahoo.com/new_mail
>  
>

There is some MCC code here http://www.vscp.org/vscp/modules/index.html

Regards
/Ake

--  ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org

2005\01\30@114817 by Scott Fraser

flavicon
face
www.phanderson.com/basicx/sht71_1.html

Third hit after a google search for SHT71

At 08:27 AM 1/30/05, you wrote:
{Quote hidden}

2005\01\30@121003 by Howard McGinnis

flavicon
face
I've used the SHT11 and SHT15's - the code from the app notes works quite well.

Howard


At 05:56 AM 1/30/2005, you wrote:
>Anyone tied a PIC to this device and mind sharing code
>snippets?  (this is the humidty sensor)
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - Helps protect you from nasty viruses.
>http://promotions.yahoo.com/new_mail
>

2005\01\31@011823 by cdb

flavicon
face
Look on my website, one temp/humid project, plus code you can download
for the SHT11/71

Colin

--
cdb, .....colinspamRemoveMEbtech-online.co.uk on Monday,31 January,2005

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359

Light travels faster than sound. That's why some people appear bright
until they speak!



2005\01\31@084417 by alan smith

picon face
ahh...the only code reference I found was a hiking
computer and someone who said they had done a weather
computer, but no code references.  I am actually
looking for assembly, but this gives me a start. Thanks
--- Scott Fraser <kn6fspam@spam@dolphinsci.com> wrote:

{Quote hidden}

> >-

2005\01\31@085750 by Ake Hedman

flavicon
face
OK. Test this then. At least I can find the code and its in assembly... ;-)

Regards
/Ake

alan smith wrote:

{Quote hidden}

>>>-

2005\01\31@092356 by Ake Hedman

flavicon
face
And the link  http://www.njqrp.org/digitalhomebrewing/pic-wx/pic-wx-3.html

/Ake

Ake Hedman wrote:

{Quote hidden}


'[OT] email auto snipper sought'
2005\04\28@080741 by Robin.Bussell
flavicon
face


Hi Folks,
               mail communications here at my boring day job seem to consist
mainly
of mails that have been forwarded through many people and eventually end up
with me after accumulating a large amount of kruft in the form of standard
disclaimers
(see below) and  headers.

Extracting the actual information from these is getting frustrating.

I'd love to have an app which you can teach about these useless blocks of text
(which don't vary) and which would snip them out of anything you paste into
it. I started to think about bunging something quick and dirty together in VB
but thought I'd
run this past the list to see if anyone knows of an existing app which will do
this job already.

Anyone?

Cheers,
           Robin.

(P.S. the mail client we're stuck with is lotus notes so outlook plugins won't
do any good)





This email originates from AXA Sun Life Services Plc (reg. no. 3424940) which is a service company for the following companies within the AXA UK plc Group:
AXA Sun Life Plc (reg. no. 3291349)
Sun Life Assurance Society Plc (reg. no. 776273)
Sun Life Unit Assurance Limited (reg. no. 975601)
Sun Life Pensions Management Limited (reg. no. 1105141)
AXA Equity & Law Life Assurance Society Plc (reg. no. 575435)

All of the above mentioned companies are registered in England and have their registered office at 107 Cheapside, London EC2V 6DU, England.

This message and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed.  If you have received this in error, you should not disseminate or copy this email.  Please notify the sender immediately and delete this email from your system.  

Please also note that any opinions presented in this email are solely those of the author and do not necessarily represent those of The AXA UK Plc Group.

Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process.  The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

Finally, the recipient should check this email and any attachments for viruses.  The AXA UK Plc Group accept no liability for any damage caused by any virus transmitted by this email.

2005\04\28@092638 by Howard Winter

face
flavicon
picon face
Robin,

On Thu, 28 Apr 2005 12:59:00 +0100, spamBeGoneRobin.Bussellspam@spam@axa-sunlife.co.uk wrote:
>...<
> I'd love to have an app which you can teach about these useless blocks of text
> (which don't vary) and which would snip them out of anything you paste into
> it.

Well there was a "standard" that "tags" at the end of emails be preceded by a line containing just two dashes
(--) but it doesn't seem to be widely followed.  I think the PIClis does, though, as you'll see below!

Cheers,


Howard Winter
St.Albans, England


2005\04\28@103429 by Dan Smith

face picon face
On 4/28/05, Howard Winter <RemoveMEHDRWspam_OUTspamh2org.demon.co.uk> wrote:
> Well there was a "standard" that "tags" at the end of emails be preceded by a line containing just two dashes
> (--) but it doesn't seem to be widely followed.  I think the PIClis does, though, as you'll see below!

The signature delimiter is actually two dashes followed by a space '--
', and yes, the Piclist does use this in the standard footer - I put
it there myself :-)

Dan

2005\04\28@103536 by Dave Tweed

face
flavicon
face
Howard Winter <HDRWspamspamH2Org.demon.co.uk> wrote:
> Well there was a "standard" that "tags" at the end of emails be preceded
> by a line containing just two dashes (--) but it doesn't seem to be
> widely followed.  I think the PIClis does, though, as you'll see below!

Almost, but not quite. A lot of people get this wrong. The "standard", such
as it is/was, is that a "signature" (i.e., something you might put into
your .signature file) begins with a line that has the three characters
hyphen, hyphen, space at the beginning, as mine does below. It doesn't
matter if additional text follows the space. Back when both bandwidth
and screen space were much more dear, it was strongly suggested that
.signaures be limited to 4 lines, and no one wanted to waste an entire
line for the delimiter. The key point is that the space IS significant,
but most people -- and the PIClist server -- leave it off, deviating
from the standard.

-- Dave Tweed

2005\04\28@104547 by Dave Tweed

face
flavicon
face
I wrote:
> The key point is that the space IS significant, but most people -- and
> the PIClist server -- leave it off, deviating from the standard.

I stand corrected. The server does indeed put the space there.

-- Dave Tweed

2005\04\28@185533 by Hector Martin

flavicon
face
> (P.S. the mail client we're stuck with is lotus notes so outlook plugins won't
> do any good)

Notes is quite cool for these kinds of things. Remember it's a
database system, and it has quite a bunch of ways you can customize
it. You can edit the mail database template and update the design on
your mail database once you have made the appropriate changes. You can
add agents and stuff, or even add some @-formulas or lotusscript to
strip out that junk upon viewing of the message (although it would
still be present in the text just in case). Lotusscript is basically a
clone of VB in practice, so if you have ever programmed any Basic it
should be easy.

It's been a while since I used notes, but I remember you could do
anything you liked with it. I even wrote a database that would have
documents as instructions and a script that imported the Win32 API
DLLs and opened the serial port to talk to a robot over the RS232
port, sending each document as an instruction to do a certain action.


'Code snippet / comparision vs several constants'
2005\05\06@021449 by Dmitriy Kiryashov
picon face
Hi All.

I was squeezing some folks assembler code today and ran across
part of it when one needs to compare variable against several
constants one by one and if case is equivalency found jump to
some address.

What I originally had :

       movfw        var

       xorlw        A        ;first compare vs A constant
       skpnz
       goto        addr_its_equal

       xorlw        B^A        ;then compare vs B constant
       skpnz
       goto        addr_its_equal

       xorlw        C^B        ;then compare vs C constant
       skpnz
       goto        addr_its_equal

etc...

Interesting squeeze was found :) so I decided to share
in case if somebody else might find idea helpful.

       movfw        var
       xorlw        A
       skpz
       xorlw        B^A
       skpz
       xorlw        C^B
       skpnz                ;
       goto        addr_its_equal


WBR Dmitry.


'[SX] SX asm snippet'
2005\12\12@151215 by Rsadeikan/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Rsadeika wrote:

I can not figure out what is going on with this program. What I expect is the LED to be off until the IRpin gets an IR signal, then it breaks out of the SNB loop, turns the LED on, and then loops back to Main, where it turns the LED off, and finally it waits for an IR signal, again. What it is doing right now, is the LED goes on, and stays on. When I step it through DEBUG, it works as expected.

Any ideas or suggestions.

Thanks in advance

******CODE device sx52
device oschs3      ;High speed crystal, 1MHz - 75MHz
IRC_CAL IRC_FAST   ;For use with external crystal/oscillator
freq 4_000_000 reset 0      
;; I/O definition
IRpin = re.1     ;IR detector
LEDon = rd.0     ;LED

mov !rd,#%11111110  ;Set rd.0 to output

Main
setb rd.0          ;Turn off LED
again
snb IRpin          ;Waits for IR signal
jmp again

clrb rd.0          ;Turn on LED
nop
nop
nop
nop
jmp Main

sleep
end                ;End of code
---------- End of Message ----------

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

2005\12\12@160904 by mebikeridern/a

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

If the mode register is not correctly configured then your direction setting command will not work.

Before you write a value to !rd, you should set the mode register, otherwise you are depending on whatever mode the CPU happened to be in for what effect your value will have.

SX28s and smaller may set the mode with the mode command, but the 48 and 52 need to write the right value to W, then transfer W to the M register.

Look up and read about using the mode register in the documentation.

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

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

2005\12\12@163545 by beann/a

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

You may need a delay loop before you start sampling the IRPin. That is probably why it works in the debugger.
Bean.

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

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

2005\12\12@193634 by williamn/a

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

oschs3 is too fast for 4Mhz.
You should try oschs1 first.....

I think your oscillation is not stable, that's why only debug works b'cos the oscillation is controlled by the SX-Key.

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

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

2005\12\13@073022 by Rsadeikan/a

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

Feedback:
Since their were a couple of different suggestions made, I want to share my results.


The major culprit is a freq and NOP issue. When I increased the freq setting to 50_000_000, and removed the three NOP's, the program worked as expected. But it was still getting some random flickers on the LED; IR detcter was picking up some random stuff. I inserted a
MODE #$0f mov w,%11111110 mov !rd,w that took care of the random flickers, still not sure how that works. Then, one at a time, inserted an NOP, worked as expected. Inserted the second NOP, worked as expected. The third NOP, started disrupting the timing, in this particular case, never gets back to the top of the Main loop, LED never shuts off.


So, I thought the NOP was just a simple 4 cycle timing delay. Why is it having an affect on or with the freq choices? With two NOP's works fine , the third one disrupts everything. I would hate to think of what would happen if I used this within an interrupt.


Any ideas of what the proper use of the NOP instructions are.

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

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

2005\12\13@074720 by beann/a

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

Please post the whole program.

When you say "I inserted a" we have no idea where you inserted it.

I think you meant to do this:

MODE #$1f  ' Mode to SET direction on SX48/52
mov w,#%11111110 ' You were missing the "#"
mov !rd,w
NOPs are just that, they should have no effect other than taking 1 cycle (not 4 cycles).

Again please post the whole program and we'll get this problem licked...

Bean.

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

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

2005\12\13@080308 by Rsadeikan/a

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

Sorry, I keep thinking, I got straight in my head.



******CODE device sx52
device oschs3      ;High speed crystal, 1MHz - 75MHz
IRC_CAL IRC_FAST   ;For use with external crystal/oscillator
freq 50_000_000

reset 0  
   
;; I/O definition
IRpin = re.1     ;IR detector
LEDon = rd.0     ;LED

; mov !rd,#%11111110  ;Set rd.0 to output

mode #$0f           ;0f -> TRIS_
mov w, #%11111110
mov !rd,w

Main
setb rd.0          ;Turn off LED

again
snb IRpin          ;Waits for IR signal
jmp again

clrb rd.0          ;Turn on LED
nop                ;Works as expected at 50_000_000
nop                ;Works as expected at 50_000_000
;; nop                ;This creates a problem
                          ;prevents completion of
                          ;jmp Main
jmp Main

sleep
end                ;End of code
---------- End of Message ----------

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

2005\12\13@100559 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi There;
If the code you posted is literally what you are executing, then you have two problems with the mode portion.

Firstly, for the SX 48/52 (only) the mode register CANNOT be written directly as you are doing. You do "mode #$0f", and instead you MUST go through the W register to set the mode correctly:

          mov   w,#modevalue
          mov   m,w
You see, the SX 48/52 only uses the lower 4 bits (bits 3 through bit 0) of the "mode" write instruction, leaving the 5th bit (bit 4) be whatever its previous state was. On the other hand, transferring w into m transfers all 5 active bits of w (bits 4 through bit 0) into m.

Secondly, again for the SX 48/52 only, your use of a modevalue of #$0f is incorrect for SETTING the direction registers; that is the mode value for READING the direction registers. To SET them you must use a modevalue of #$1F, not the modevalue of #$0f that you have......that is used by the SX 28 series.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2005\12\13@123303 by Rsadeikan/a

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

Thanks Peter,
I made the suggested changes, the compiler did not complain.

I tried putting in some 'pause' code, as described in the Guenther book, the program did not like it. I can get two NOP's in, but no pause loops.

I am comming to a conclussion that the sx52 is very, very tempermental, or the SX52 proto board has its own temperment (interesting that I give it human qualities). I guess I simply have no idea as to how to get around the problem that is occuring in the very straight forward snippet. And the worst part is, their is no easy method of narrowing down the problem, is it the compiler, the Sx52 proto board, or what. I guess, since no else is posting any concerns about their SX52 proto board experience, then it must be me, as I toss my hands up in the air.

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

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

2005\12\13@132011 by mebikeridern/a

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

I also had a lot of trouble getting my sx52 to run properly. When I wasn't using the mode and bank commands properly, or was sticking variables into bad memory locations, the chip seemed to me to be flaky, too.

But after I learned about the changed mode command usage, and the changed bank command usage, and the different memory banks as compared to the sx18 or sx28, the chip worked exactly as it should.

You may actually be ok in this specific case with your use of the mode command. The sx28 is documented to reset to a value of mode #$F, which is "set IO direction" mode. I don't know whether the sx52 resets to a corresponding #$1F, but if it does, then you may (accidently) be ok either not setting mode or issuing "mode #$F", because the fifth bit would already be correctly set, even though what Peter and I said about using W to load M instead of "mode" is still what you will need to use for changing modes.

So my advice would be to take it slow and make sure you've taken into account all the things people warn about before totally giving up.

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

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

2005\12\13@135838 by Rsadeikan/a

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

Thanks David,
I have lowered my hands, settled down a bit, and am ready to push forward. If this was easy, then everybody would be doing it.

The next thing I have to get straightened out is the memory usage thing. I think that the problem is exactly that, even the smallest piece of code, takes up more room than one would expect. I noticed in the debugger, code wise, there is a lot of stuff that gets inserted before it even gets to my piece of code. So, I do not have any idea as to where my code starts or ends in memory, and with paging, another hurdle to get over.

So, now I will take into consideration that the third NOP, in my program, may have gone beyond the page boundry. And that, the many examples that are shown for the sx28, may not function properly on the sx52.

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

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

2005\12\13@141409 by beann/a

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

There are several things that I would change.

1st
 Use "RESET Start" and put a Start label where you want your program to start at
2nd use this to set rd.0 to an output mov w,#$1F
mov m,w
mov !rd,#%11111110
3rd
 Because of your code as soon as you turn the LED on you go right back and turn it off, I see no point to the code.  
 If you want the LED pin to go low when the IRPin goes low then just do this:
 
Main:
 MOVB LEDon,IRPin
 JMP Main
There is no reason why the number of NOPs would make it not run. It's not the SX52's fault. There is something funky in the setup.
I would try removing the IR receiver and just connect the pin with a wire to Gnd or Vcc.

Keep trying different things...

Bean.

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

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

2005\12\13@145855 by Rsadeikan/a

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

Bean,
Thanks for the detail. As to the 1st point, I tried RESET Main instead of RESET 0, that corrupted my results. The 2nd point, I finally figured that one out, and my code is exactly like your code. 3rd point, I wanted to create some code that would tell me that my IR detector was working properly (I already fried two of them) as I pushed a button on the remote controll. When the snippet is working, and I hold the button down, the LED flashes, as expected, I wanted to put in a slight pause so the LED stays on for a second. I am trying to lay the ground work for a functioning IR remote controll program in assembly.

After I get this small snippet to work then I want to go ahead and add the rest of the code, capture the remote controller command code, and start working with the data.

One way to learn is if you build it yourself, hopefully, this is not re-inventing the wheel.

Oh, I tried Guenthers tut003.src, on the SX52 proto board, that did not work either. The LED turned on and stayed on. That code is supposed to pause, turn the LED on, pause, and turn the LED off. So, there is something strange that is going on, that is what is so frustrating.

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

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

2005\12\13@162559 by Rsadeikan/a

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

Here is a new snippet, right out of Guenthers book. I had this code setup on my SX28 tech  board, so I know that it works.

I made the modification for it to run on my SX52 board. All I have is an LED circuit on the breadboard, just as described in the book. Again, what is expected is a pause, turn the LED on, a pause, turn the LED off, jmp to the top of the loop and do it over again and again.

When I run it, the LED turns on and never turns off, no pauses what so ever. In the tutorial a freq 50_000_000 is used, so the freq are matched. The only difference is, the tut uses OSCHS2, I use the OSCHS3. So, I am wondering, does the SX52 have some kind of effect on the pause part of the the code. On the SX28 you could definitely see the LED pause.

Ray

*****CODE
;;;
;; tut003sx52.src
;;;
device sx52
device oschs3      ;High speed crystal, 1MHz - 75MHz
IRC_CAL IRC_FAST   ;For use with external crystal/oscillator
freq 50_000_000
RESET Main
org $08
Counter1 ds 1
Counter2 ds 1
Counter3 ds 1
org $100
Main
mov w,#$1f          ;SX52 specific
mov m,w
mov !rd, #%11111110

Loop
decsz Counter1
  jmp Loop
decsz Counter2
  jmp Loop
decsz Counter3
  jmp Loop
clrb rd.0
Loop1
decsz Counter1
  jmp Loop1
decsz Counter2
  jmp Loop1
decsz Counter3
  jmp Loop1
setb rd.0
jmp Loop end                ;End of code
---------- End of Message ----------

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

2005\12\14@082124 by mebikeridern/a

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

You've run into one more of the minor differences between the sx52 and the sx28's.

In the sx52, variable space starts at $A, not $8.

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

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

2005\12\14@100452 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

David, You're The Man.....nice find!

So in starting the variables in the wrong spot (at $08 instead of at $0A) the variable "Counter1" lands right on top of Port D, and Counter2 lands right on top of port E.

Clearly then, the program starts a $100, sets the mode (now correctly), and configures port D as all inputs except for bit 0 as an output. Good so far.

The value of  port outputs are not defined at power-up, so reading port D would produce either 0000_0000 or 0000_0001, as bits 7 through 1 are inputs which read as zero, and only bit 0 is an output.

Now the trouble starts.

The next instruction decrements Counter1 which really is port D. So the value of port D is decremented. If it had been 0000_0000 at power up, now Counter1 (port D) will have a content of 0000_0001, yielding a no-skip condition, so proceding on to the next instruction which jumps back to "loop".

Again the next instruction decrements Counter1 (port D), which will subsequently contain 0000_0000 and yields a skip condition.

So the next instruction attempts to decrement Counter2 (port E) which has not been configured as an output, so its value is not decrementable and remains 0000_0000, never yielding a skip condition, hence always jumping to "loop".

So what we have here is an endless loop with port D bit 0 (LED ) alternating on/off every time through the loop, because that bit is altered by the decrementing instruction. So the LED sees a very fast 50% duty cycle and will appear as steady "on" at half brightness.

The fix of course as David alludes is starting the variables at $0A.

This expample demonstrates several things:

1. Post your COMPLETE code including the things you think are not important. In this case the "org $08" was the culprit, and was not shown until the last post.

2. Debugging with the SX-Key and single stepping would have shown the sequence and isolated the programming error immediately.

3. Guenther's simulator also would have shown up the problem immediately.

4. Things are not always what they appear. The statement "the LED turns on and never turns off" is an incorrect observation. It DOES turn on and off, just very rapdily. Again, single stepping in debug or SX-Sim demonstrates this.


All in all, a very good learning exercise for Rsadeika, and probably good advice for all beginners.

Cheers,
Peter (pjv)

Use these tools and they WILL save you a lot of agravation.

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

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

2005\12\14@130034 by Rsadeikan/a

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

Thank You David and Peter,

I did not run the program through the debugger because I was so convinced that the pauses were supposed to be visible. Now, I am starting to see how to use the tools, from now on I will have to be a little less stuburn and little more logical.


The other big problem that I found was, I had a corrupted SX-Key system. It was very subtle, when I was doing a Save or a Run, the changed file was not really being saved, not on the first try, so that added to the confusion of everything. I stumbled across that late last night, double checked this morning, the problem was there. So I did a new install of the latest SX-Key system, and I noticed some other problems disappeared. The only thing that I did recently was update the SX/B stuff as it became available. So now I am very suspect of my SX-Key system, everything else on my computer is in order, only the SX-key got corrupted somehow.


Thanks again guys
---------- End of Message ----------

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

2005\12\14@144003 by Rsadeikan/a

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

The drama continues,
I changed the org $08 to $A. This time I ran it through the debugger first. As I single stepped through the program everything was working until it got to first Loop. The loop gets stuck at decsz Counter1 jmp Loop. The reason the LED never pauses is because it never gets out of that first Loop. I ran it through the walk function, it just continued to loop in the same place. I tried changing some of the org values, like changing it back to $08 to see what would happen, same thing, never gets out of the first decsz loop.

The way I understand decsz to work is the Counter1 gets assingned a size and location, in this case $0a is the location, the decrement starts at 7 (eight bits) and decreases its way back to 0, at which point it moves to the next decsz. Since it gets stuck in the loop, it never reaches 0, so it just keeps on looping. So now I am wondering if Counter1 has really been treated like a variable or for some reason its being treated like a label. I think I am in over my head on this one.

The SX-sim confirms the constant looping in the same place.

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

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

2005\12\14@151906 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Ray;
PLEASE, HOW MANY TIMES DO YOU NEED TO HEAR THIS.....POST YOUR NON-WORKING CODE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

There is obviously a problem with what you're doing because it works perfectly on my test set-up as well as in Guenther's simulator, and that uses no hardware.

So by not posting EXACTLY what you are running, you're your own worst enemy by just making us guess, and that's a waste of your time as well as ours.

And that's unfair. So unless you participate better, I'm outta here!

Peter (pjv)
---------- End of Message ----------

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

2005\12\14@151937 by beann/a

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

You do realize that the first loop WILL loop for 255 times before it falls through to the next loop ?
Bean.

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

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

2005\12\14@153515 by mebikeridern/a

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

Well, I don't get it.

I ran that code in SxSim, and while it did spend most of its time in the decrement $0A loop, every time it passed zero it DID decrement $0B, just like it is supposed to.

Are you sure your SIM test isn't decrementing $0B on every zero pass of $0A?

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

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

2005\12\14@154525 by Rsadeikan/a

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

The code has not changed, the code is a cut and paste from my computer to this post.

Bean, when I had it in Walk, I am pretty certain that I let it run long enough, I checked again, I let it run for at least a minute. It never gets out of the first Loop. What I expected it to do was walk in the first Loop, then move down to the second Loop1, do its walk in there, and then head back to the top, and do it all over again.

Now their is something wrong, if Peter is running the same code on his system, and it works for him, and I am running the same code on my system (just did a fresh installation of SX-Key), and it does not work the same way as Peter describes it, then maybe my sytem is corrupted again.


*****CODE
;;;
;; Tut003.src
;;;
device sx52
device oschs3      ;High speed crystal, 1MHz - 75MHz
IRC_CAL IRC_FAST   ;For use with external crystal/oscillator
freq 50_000_000 reset Main
org $0a
Counter1 ds 1
Counter2 ds 1
Counter3 ds 1
org $100
Main
mov w,#$1f
mov m,w
mov !rd,#%11111110
Loop

decsz Counter1
  jmp Loop
decsz Counter2
  jmp Loop
decsz Counter3
  jmp Loop
clrb rd.0
Loop1
     decsz Counter1
  jmp Loop
decsz Counter2
  jmp Loop
decsz Counter3
  jmp Loop
setb rd.0
jmp Loop end
---------- End of Message ----------

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

2005\12\14@155314 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

OK Ray;
The problem is in your code!

In the bottom, "Loop1" section, you are now returning by juming to "Loop" instead of "Loop1" as you had posted earlier.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2005\12\14@160220 by Rsadeikan/a

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

Sorry, another lesson learned. Sorry about the waste of time.

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

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

2005\12\14@161559 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Ray it's not a waste if you learned something and take it to heart!

A good lesson for all beginners; be as detailed as practical, and describe the problem as precisely as possible.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2005\12\15@111643 by Rsadeikan/a

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

The new code is a fully functinal, adjusted to run on the SX48/52 proto board. After a couple of written brow beatings, I finaly got it. Hopefully I will not get lazy again, and revert back to my old ways.

David mentioned that you first have to get the concept of variable memory and program memory straight in your head. So, here goes. From the compiler point of view, for the beginer, there are two areas in processor memory, one for the variables and one for the program space. From the programmers point of view, I have to define or designate which is which. As an aside, for the 16bit x86 assembly people, think DATA segment (DS) and CODE segment (CS).

Start with the variables, for the SX28 it is $08, for the SX52 it is $0A. So, when you code org $0A, SX48/52 specific, the compiler is alerted that everything after this point is going to be variables, and to be put into the variable memory space.

For the program, or code, you would use RESET plus a label, for example RESET Main. The compiler is alerted and it will place the code into the program memory. I lean towards stucture, so I know what is what.

The trick is that you want keep the contents seperate, if you place a variable, or at least what you want to be treated as a variable, into the program space, that is going to be a problem.

So now you are thinking, where does variable space end and where does the program space begin, from a programmers poit of view. For the variables it is org $08 or $0A, as explained earlier. And RESET for the program, or code. You have to be very aware of this, you do not want to be putting code into variable space and vice-versa.

Best thing that I can recomend is, take some example code, like Guenther's , which I have at the end of this post, run it first, to make sure it works, then use the spider (debugger) to play around with. Change some of the org values around an see what happens.

If I went astray somewhere, somebody put me back on track. I feel that this concept is very, very important, and you may want to make sure that it is well embedded in the brain. I know some of this was being talked about in another thread, but I wanted to keep as simple as possible, and not get into the minutae of achitecture, and other stuff.



******CODE
;;;
;; Tut003.src
;;;
device sx52
device oschs3      ;High speed crystal, 1MHz - 75MHz
IRC_CAL IRC_FAST   ;For use with external crystal/oscillator
freq 50_000_000 reset Main                 ;Label where the program starts
;Data memory
org $0A            ;SX52 -> $0A, SX28 -> $08 Data memory
                          ;                         satrt
Counter1 ds 1
Counter2 ds 1
Counter3 ds 1
;End of data
;Code memory
org $0             ;Code memory start position
Main
mov w,#$1f         ;
mov m,w
mov !rd,#%11111110
Loop

decsz Counter1
  jmp Loop
decsz Counter2
  jmp Loop
decsz Counter3
  jmp Loop
clrb rd.0
Loop1
     decsz Counter1
  jmp Loop1
decsz Counter2
  jmp Loop1
decsz Counter3
  jmp Loop1
setb rd.0
jmp Loop

jmp $      ;I like to use this to end my code
          ;at this point it is in endless loop.
end
---------- End of Message ----------

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

2005\12\15@114824 by beann/a

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

Just one small correction. There is only one ORG pointer. Just because you set the ORG $0A does not tell the assembler that you are defining variables. That is done on a line-by-line basis.
It's kind of ignorant but if you do this:

ORG $0A
counter1 DS 1  ; counter1 = $0A in variable space
NOP ; This instruction is at address $0B in program space
counter2 DS 1 ; counter2 = $0C in variable space
NOP ; This instruction is at address $0D in program space
counter3 DS 1 ; counter3 = $0E in variable space
So you see the ORG pointer is incremented the same for variables or instructions. You see how we have left "holes" in the variables space and in the code space.
Bean.

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

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

2005\12\15@125517 by Rsadeikan/a

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

Bean,
This could cause some serious nitemares.

Wow, I thought I was making some headway.

Back to square one, org $00 - $07 (SX-28), these are designated for other things, $08 is the first position where you can start variables or CODE, and the compiler sorts the two apart. In your example, the NOP $0B, and NOP $0D would be CODE addresses, and $0B and $0D positions would still be availble in the variable space. What I get out of this, is that there is a specific area where you can start, $08 (SX-28), the RESET is a programming convience tool.

Technically it is not as complex as I thought, you have to start at certain point, $08 or $0A, and the compiler decides according to the text of your program, in this particular case Counter DS 1, is to be treated as a variable, and it is put into the variable memory space, code, decsz Counter1, is treated as CODE and put into program memory space. The trick is to keep everything straight in your head, making sure that program is in the sequence that you want.

Am I getting close.

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

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

2005\12\15@135446 by g_daubachn/a

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

Rsadeika,
the RESET is not just a programming convenience tool - it is an important directive.

When any SX starts program execution after a reset or power-on, it reads and executes the instruction located at the highest available program memory first, so this address should always contain a JMP instruction sending program execution to a point where YOU want to start it.

With a directive like
RESET Main the assembler automatically generates a JMP

for the highest location in program memory.  Note that after power-on/reset, the high page select bits in the STATUS register are automatically cleared, i.e. PAGE 0 is automatically selected. This is why the start of the main program can only be located in the first page of program memory.

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

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

2005\12\15@140424 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi Ray;
You are indeed very close.

There are two addressable sections to the processor's memory; the RAM (variables) part and the ROM (program code) part. They are separate.

The org $xx command is used to set the starting point of either section; the compiler understands the DS or DW assignments to imply RAM, and all other assignments as ROM. As Bean pointed out, every RAM assignment and every line of code increments the memory pointer, so it is usual to not inter-mix varable assignments inside of your code. If you do, you will need to specifically keep track yourself otherwise you will get a mess.

So it is easiest to define ALL your variables at the beginning of your program after setting the org to $08 or $0A, followed by the code portion after setting org to $0, or $100, or whatever. The compiler will realize that code statements are not intended for the RAM section, and in ROM you need not "skip over" the area of $0 through $0A.

RESET is the reserved word that references the start point of your program (any point you choose) on a power-up or reset. The org $00 location is somewhat special; only if you have interrupts enabled. That is the point where the processor goes to on detection of an interrupt, and it will be the first loction of any ISR routine you might have.

That is why typically you see the "Main" programs starting at some point other than $00; for convenience often at a new page, say $100, but could be anywhere.

Have fun.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2005\12\15@142453 by g_daubachn/a

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

Peter,
the SX datasheets say that the page select bits in the STATUS register are all cleared at power-on/reset. Thus page 0 is in force when the first JMP at the highest program memory location is executed. SASM will even generate a "Reset address not in page 0" error if you try to place it into some other page.

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

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

2005\12\15@152238 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi Guenther;
Right, thanks for clearing that up. That makes sense, and I should have known better. In my work, I guess I never tried to start anywhere but in the first page.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2005\12\15@160931 by Rsadeikan/a

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

Thanks everybody,

I think it is starting to sink in, I will have to play around with the Guenther code for awhile, and see what other mischieve I can come up with. So, all of you beginner "lurkers" that are thinking about SX assembly, jump right in, the bit pool is just fine.


Oh, I highly recommend, again, Guenther's book, that comes with the SX28 tech kit. I have only one suggestion for Guenther, in the next edition of the book, you may want to think about what was talked about in the end of this thread, memory, basic program structure, ..., etc., and maybe cover it in a quick and conceise way so that even a beginner can understand.


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

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

'[SX] SX asm IRC_CAL Snippet'
2005\12\17@132204 by Rsadeikan/a

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

I am still using the Guenther code, the listing that I have is functional, I have some remarks through out the code, so if somebody notices a glaring mistake, please make me aware of it.

Now, I have a question about the proper usage of IRC_CAL.


The DEVICE OSC4MHZ selects the SX internal RC, and you get three choices of IRC_CAL IRC_SLOW, IRC_4MHZ, and IRC_FAST. In the data sheet it states something about a +-8%, I assume that IRC_SLOW would be a calibration at -8%, and IRC_FAST would be a calibration of +8%. What kind of calibration does IRC_4MHS get? So, I guess you get a warning here, do not use this setting if you will be using this to send a rocket to Mars.


The DEVICE OSCHSx selects one of the High speed crystal/res. choices, and as turns out you get to use an IRC_CAL setting, also. So, when you select IRC_SLOW or IRC_FAST, what exactly do you get? When you leave out the IRC_CAL setting, the compiler gives a warning that it is using the default IRQ_SLOW setting. When I am using a freq 50_000_000, in the run window it just shows that the freq of the program is 50_000_000. Does the same warning apply here, do not use for rocket science.


I guess my question is for the more experienced programmers, down the road, will this come in handy, the usage of IRQ_CAL. At this point I am sort of missing the utility of the IRC_CAL setting. A couple of examples could be in order, if possible.


Ray
Thanks in advance

****CODE
;;;
;; Tut003.src
;;;
device sx52
device oschs3       ;High speed crystal, 1MHz - 75MHz
;IRC_CAL IRC_FAST   ;Real life utility still undecided
freq 50_000_000
;****
;device osc4mhz      ;This uses the SX internal RC
;IRC_CAL IRC_FAST    ;Specific for 4MHz selection
                    ;Selections are IRC_CAL IRC_FAST,
                    ;IRC_4MHZ, IRC_SLOW
;freq 4_000_000      ;Can use different freq's up to 4MHz
;****
reset Main                 ;Label where the program starts
;Data area         ;I lean towards structure, this notation
                  ;is for me to make things a little easier

org $0A            ;This is the starting point for Data
                          ;and Code, the compiler sorts it out
                          ;SX52 -> $0A, SX28 -> $08
                          ;                        
Counter1 ds 1              ;Remember code can be placed here
Counter2 ds 1              ;also, the compiler distinguishes
Counter3 ds 1              ;between variables and code
;End of data
;Code area
org $0             ;Code start position on reset
Main
mov w,#$1f         ;This is SX52 specific -> TRIS_
mov m,w
mov !rd,#%11111110 ;Set rd.0 to output
Loop

decsz Counter1      ;Counter1 is a byte, descsz starts at 255
                           ;and decrements until it hits 0
  jmp Loop
decsz Counter2
  jmp Loop
decsz Counter3
  jmp Loop
clrb rd.0           ;Turn on the LED
Loop1
     decsz Counter1
  jmp Loop1
decsz Counter2
  jmp Loop1
decsz Counter3
  jmp Loop1
setb rd.0           ;Turn off the LED
jmp Loop

jmp $      ;I like to use this to end my code,
          ;at this point it is in an endless loop.

end        ;End of source code, remmarks can be placed
          ;here after 'end'. The compiler treats
          ;it as text and is ignored.

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

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

2005\12\17@133511 by beann/a

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

No it's not rocket science, your making it way harder than it is...

IRC_CAL is used to adjust the INTERAL oscillator ONLY. It has no effect if an external anything is used.

IRC_FAST will just set the internal oscillator as fast as it can be adjusted, but not nessaccarly +8%, same with IRC_SLOW.

IRC_CAL uses the SX-Key to measure the internal oscillator and sets it as close as possible to 4Mhz (this could still be several percent off).

The +/- 8% figure means that the interal oscillator can vary upto +/- 8% with supply voltage and temperature.

Bean.

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

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

2005\12\17@152817 by g_daubachn/a

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

A rule of thumb:

When using any other clock source but the internal RC clock, add an IDC_CAL IRC_FAST or IDC_CAL IRC_SLOW directive to your code, just to keep the SX-Key IDE from performing an IRC calibration process when you select the "Program", "Run", or "Debug" options from the menu, just to avoid the extra time required for the calibration process. The IDE will perform the calibration whenever it "sees" an IRC_CAL IRC_4MHZ directive in the code, no matter if you have specified the internal RC clock (DEVICE OSC4MHZ) or not.

When you want to use the internal RC clock, use the DEVICE OSC4MHZ directive (or any other one also activating the clock prescaler). You may still may still leave the IRC_CAL IRC_FAST or IRC_CAL IRC_SLOW directive in your code if precision of the internal RC clock is not an issue. In case you want to have the internal RC clock adjusted to 4 MHz as close as possible, use an IRC_CAL IRC_4MHZ directive instead. When the SX is programmed, some extra time is required to allow the SX-Key IDE to perform this calibration. Please keep in mind that the internal RC clock (even if calibrated) may be not stable/precise enough for certain purposes, like executing a UART VP, etc.

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

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


'[SX] Simple Stepper Code Snippet'
2006\10\02@124938 by Peter Van der Zeen/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi All;

There has been some significant activity in the forum recently in regard to software for driving stepper motors. To that end, I have introduced callable snippet of code that is a very simple pseudo state machine, and is easy to integrate into anyone's code by just calling it.........





Your Code
        .

        .

        .

        call Forward      ;take a step forward
        .

        .


        call Reverse      ;take a step backwards

        .

        .

        .


 
;Step Routines ==============================================================
 
Forward  inc Position      ;new forward location and desired motor coil state
        call Step         ;lookup the new motor state
        mov port,w        ;output the new motor coil state
        retp              ;return to mainline
 
Reverse  dec Position      ;new reverse location and desired motor coil state
        call Step         ;lookup the new motor state
        mov port,w        ;output the new motor coil state
        retp              ;return to mainline
 
Step     mov w,Position    ;get the new position
        and w,#%0000_0011 ;pay attention only to least significant four states
        add pc,w          ;jump into the table and return with the coil combination
 
Table00  retw %0000_0001   ;state 00 return with selected motor coil combination... can be any desired combination
Table01  retw %0000_0010   ;state 01 return with selected motor coil combination... can be any desired combination
Table10  retw %0000_0100   ;state 10 return with selected motor coil combination... can be any desired combination
Table11  retw %0000_1000   ;state 11 return with selected motor coil combination... can be any desired combination
 


The four entries in the table need to be made to match what your motor needs for each of its step positions; my selection here is arbitrary, just for demonstration.


I hope this is of some help.


Cheers,

Peter (pjv)



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

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=147178
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] Woah is me: SX28 Failure Snippit'
2010\04\20@203634 by rodneymcn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, rodneymc wrote:

Just a little personal story to share...


Well, here I was, having a couple hours and in the right frame of mind to do some coding on my project with my sx tech board.


Things weren't working well... I tried some known working coded, and still no dice.


I notice that my status led...instead of turning on/off, it goes on, and dims.


Examined code, take off my aux breadboard, check for shorts, etc. nada.


Double checked my code, then eliminated everything except code for pulsing the led.


Still... On/Dim...On/Dim.


Measureing the voltage 5V on, 2.5 Volts off - Man, wondering if eletronics is really for me?  What's going on?


Turns out all the pin showed 2.5 volts!    

I was thinking I had some stray AC voltages from somewhere - isolation proved nothing.  (In another related 'why me' story, i was able to magically turn on an LED by touching the wire instead of the piezo film.  Turned out I had been placing my foot on my KVM switch, which had some sort of AC signal from it impacting the circuit.  That took a bit of time to figuring out!)

Well, lucky I had another sx28 and popped it in, and all worked great!


Not sure what happened.  Must've been some sort of static issue or something - i've never had that happen to me before.  It always just stays on my desk.


What's facinating about this foir me, is that it only did it when it had a program uploaded, and the program (at least the led part) essentially still worked, althoug it wasn't truely off. .  

I guess something happened in the output stage of the SX.


I guess I'll be ording a few more SX28's.in the near future!


So much for my time on this tonight.  Just thought I'd vent and see anyones thoughts.


Thanks for listening!

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

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

2010\04\21@065911 by robotworkshopn/a

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

Those chips are usually pretty robust.  How did you have the LED wired?  Also, what programs are you using to develop and test in (SX/B, Assembly, etc)  In the beginning part of your program are you setting the port (pin) as an output?

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

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

2010\04\21@121608 by rodneymcn/a

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

Hi Robert,
Thanks for your post, and I agree.

LED is essentially RB0 to a 330 ohm resistor to the LED to VSS (Gnd)
I used SX/B, and the  I/O was set up in code to be:

LED Pin RB.0 Output

Would have never thought it was the micro - esp. all pins!

Hmm,  maybe I can now sell this chip as an April fool's gag!

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

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


'[OT]:: Nerd sniping'
2012\05\09@103950 by RussellMc
face picon face
This induced a bout of uncontrollable laughter.
I guess I see too much of myself in their target victim (even though
engineers were not mentioned).

          http://xkcd.com/356/

Work calls ...



               Russell


FWIW:
  The resistor problem appears hard at first glance but may have a
assymptotic solution.
FWIW

2012\05\09@120650 by Peter Johansson

picon face
On Wed, May 9, 2012 at 10:39 AM, RussellMc <spam_OUTapptechnzspam_OUTspamspam_OUTgmail.com> wrote:

> This induced a bout of uncontrollable laughter.
> I guess I see too much of myself in their target victim (even though
> engineers were not mentioned).
>
>           http://xkcd.com/356/

Link to solution:

http://www.mathpages.com/home/kmath668/kmath668.htm

-p.

2012\05\09@124256 by John Gardner

picon face
"Unphysical", eh?

We can infer the tribal affiliation, I think...   :)

Jac

2012\05\09@203320 by Jim Franklin

flavicon
face
I was with you as far as "simply"



>Link to solution:
>
>http://www.mathpages.com/home/kmath668/kmath668.htm
>
>-p.

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