Author Topic: Somebody goofed up  (Read 4385 times)

0 Members and 1 Guest are viewing this topic.

Offline GeorgeOfTheJungleTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Somebody goofed up
« Reply #25 on: October 09, 2019, 10:54:03 am »
Just having bought a Apple II from Captain Crunch makes you a legend!

Bought him the Forth not the Apple II!

Quote
Yes I could see your extra Words.

Forth people never copy each others code, for one we don't need to, and 2) our systems are all different.

Your code is:
: invert 0= if 1 else 0 then ;

26 output: speaker
: beep
    begin
        speaker speaker digr invert digw
        350 delay.us
        key?
    until
    speaker 0 digw
;

Mine would be something like:
( not inverts all bits)

 : beep
    begin
           speaker dup digr not digw
           350 delay.us
           key?
   until
   speaker 0 digw
;

"not"? Hahaha. Thanks! I'm a beginner, my Forth-fu betters every day, albeit slowly.
« Last Edit: October 09, 2019, 12:48:33 pm by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Somebody goofed up
« Reply #26 on: October 09, 2019, 11:35:32 am »
Just having bought a Apple II from Captain Crunch makes you a legend!

Bought him the Forth not the Apple II!

Quote
Yes I could see your extra Words.

Forth people never copy each others code, for one we don't need to, and 2) our systems are all different.

Your code is:
: invert 0= if 1 else 0 then ;

26 output: speaker
: beep
    begin
        speaker speaker digr invert digw
        350 delay.us
        key?
    until
    speaker 0 digw
;

Mine would be something like:
( not inverts all bits)

 : beep
    begin
           speaker dup digr not digw
           350 delay.us
           key?
   until
   speaker 0 digw
;

not? Hahaha. Thanks! I'm a beginner, my Forth-fu betters every day, albeit slowly.

Buying anything from Captain Crunch makes you a legend :)

I'm a Forth beginner also. Forth is easy to learn, but harder to master.

 "not" is part of my default dictionary, but ": invert 0= if 1 else 0 then ; " works perfectly. I mention it because Atlast has "not" in its default dictionary also :)

Oddly the Word "words" only lists part of the actual Wordlist, this is unusual however the "Atlast Primitives: Alphabetical Reference" in the 64 bit html has a complete list of Words, and it is extensive! The Word "WORDSUNUSED" does list all unused Words.  These methods are foreign to me, but certainly not wrong, just different to what I'm used to.

To check if a "not" Word is available: the number returned is the memory location of the Word itself
-> ' not .
34378764744 -> words

This fails because there is no such word as xanadu
-> ' xanadu .
 'XANADU' undefined


Atlast includes these cool packages:
 The REAL package. Enables floating point operations. Primitives: (FLIT), F+, F-, F*, F/, FMIN, FMAX, FNEGATE, FABS, F=, F<>, F>, F<, F>=, F<=, F., FLOAT, FIX.

The SHORTCUTA package. Enables shortcut integer arithmetic operations. Primitives: 1+, 2+, 1-, 2-, 2*, 2/.

The SHORTCUTC package. Enables shortcut integer comparison operations. Primitives: 0=, 0<>, 0<, 0>.

The STRING package. Enables string operations. Primitives: (STRLIT), STRING, STRCPY, S!, STRCAT, S+, STRLEN, STRCMP, STRCHAR, SUBSTR, COMPARE, STRFORM, STRINT, STRREAL. If the REAL package is also enabled, the FSTRFORM primitive is available, as well.

The SYSTEM package. Enables submission of commands in strings to the operating system for execution. This package may be enabled only if the implementation of C used to build Atlast provides the system() function. Primitives: SYSTEM.

The TRACE package. Enables runtime word execution trace. Primitives: TRACE.

The WALKBACK package. Enables the walkback through nested invocation of words when an error is detected at runtime. Primitives: WALKBACK.

The WORDSUSED package. Enables the collection of information on which words are used and not used by a program, and the primitives that list words used and words not used. This facility allows you to determine, in the development phase of an Atlast application, which packages are needed and which can be safely dispensed with. Primitives: WORDSUSED, WORDSUNUSED.


I'm very impressed, I may consider using Atlast on this PC for some X86 programs.
 

Offline GeorgeOfTheJungleTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Somebody goofed up
« Reply #27 on: October 09, 2019, 12:47:26 pm »
Oddly the Word "words" only lists part of the actual Wordlist, this is unusual however the "Atlast Primitives: Alphabetical Reference" in the 64 bit html has a complete list of Words, and it is extensive! The Word "WORDSUNUSED" does list all unused Words.  These methods are foreign to me, but certainly not wrong, just different to what I'm used to.

I think I noticed that and fixed it. Not sure if the fix is in the gitlab repo or not, though. It's an easy fix anyway.

Quote
I'm very impressed, I may consider using Atlast on this PC for some X86 programs.

LOL. Good! I'm glad to know. This man is (or was?) the owner of AutoDesk. He wrote most of AutoCAD if I'm not mistaken.
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: Somebody goofed up
« Reply #28 on: October 09, 2019, 10:18:21 pm »

Somebody goofed up... Or not?

Reverse connect is not common, as already mentioned. It does work : it gives lower HFE, and lower VCE, but can give lower VCEsat (at low currents)
Not usually seen when driving a power load.
Did you check the actual device pinout, to verify it actually is wired up 'reversed' ?

The posted link says 120mA, but does not mention the resistance or inductance.

Did you scope the transistor & measure the resistance of DET402 ?
With no flyback clamp diodes, the little npn is doing both the drive and the clamping.

It's demise is trying to tell you, that's too much, on a continuous basis... :)

 
The following users thanked this post: GeorgeOfTheJungle

Offline GeorgeOfTheJungleTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Somebody goofed up
« Reply #29 on: October 10, 2019, 08:07:24 am »
Did you check the actual device pinout, to verify it actually is wired up 'reversed' ?

Yes, it was connected as in the schematics.

Quote
The posted link says 120mA, but does not mention the resistance or inductance.

Did you scope the transistor & measure the resistance of DET402 ?
With no flyback clamp diodes, the little npn is doing both the drive and the clamping.

It's demise is trying to tell you, that's too much, on a continuous basis... :)

I haven't checked anything else other than its upside-down-ness.

Wonder why they use these tiny fleas that are nowadays all over the place, lol. What's with a good old proven 2n3055 that would still be alive? Or even a bd139? :)

Other than that, the thing is a beauty:



Just delete the buzzer, because if you use it the thing catches fire! (LITERALLY)
« Last Edit: October 10, 2019, 10:05:16 am by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf