Announcement

Collapse
No announcement yet.

Driving a JFET from a micro

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by ivconic View Post
    I checked this again, just to be sure.
    It works slightly BETTER than with CD40106.
    And much more cleaner!
    Watch the new video i just posted here:

    https://www.geotech1.com/forums/show...136#post269136


    Quite good results. In fact, very good.
    I suppose the same could be done with the Arduino nano? much smaller board.

    Comment


    • #47
      Originally posted by ivconic View Post
      I checked this again, just to be sure.
      It works slightly BETTER than with CD40106.
      And much more cleaner!
      Watch the new video i just posted here:

      https://www.geotech1.com/forums/show...136#post269136

      Well done, good job

      Comment


      • #48
        Not that I know what I am doing but wrote some UNO R3 code with Tinkercad code blocks, passes verify, I have set the first sample delay to 35 uS, I dont know how to make it variable
        void setup()
        {
        pinMode(12, OUTPUT);
        pinMode(8, OUTPUT);
        pinMode(7, OUTPUT);
        }

        void loop()
        {
        // Bara TX 80uS
        digitalWrite(12, HIGH);
        delayMicroseconds(80); // pauses for 80 microseconds
        digitalWrite(12, LOW);
        // wait first sample delay, make variable
        delayMicroseconds(35); // set at 35 microseconds till first sample
        // first sample 42 uS
        digitalWrite(8, HIGH);
        delayMicroseconds(42); // pauses for 42 microseconds pulse width
        digitalWrite(8, LOW);
        // wait till second sample 120 uS
        delayMicroseconds(120); // pauses for 120 microseconds between samples
        digitalWrite(7, HIGH);
        delayMicroseconds(42); // pauses for 42 microseconds pulse width
        digitalWrite(7, LOW);
        // wait till next tx pulse 25 uS
        delayMicroseconds(25); // pauses for 25 microseconds till next TX

        }

        Comment


        • #49
          Originally posted by dbanner View Post
          Quite good results. In fact, very good.
          I suppose the same could be done with the Arduino nano? much smaller board.
          Uno, Nano and Mini Pro are exactly the same and 100% compatible.
          Same chip on them.

          Comment


          • #50
            Originally posted by 6666 View Post
            Not that I know what I am doing but wrote some UNO R3 code with Tinkercad code blocks, passes verify, I have set the first sample delay to 35 uS, I dont know how to make it variable
            void setup()
            {
            pinMode(12, OUTPUT);
            pinMode(8, OUTPUT);
            pinMode(7, OUTPUT);
            }

            void loop()
            {
            // Bara TX 80uS
            digitalWrite(12, HIGH);
            delayMicroseconds(80); // pauses for 80 microseconds
            digitalWrite(12, LOW);
            // wait first sample delay, make variable
            delayMicroseconds(35); // set at 35 microseconds till first sample
            // first sample 42 uS
            digitalWrite(8, HIGH);
            delayMicroseconds(42); // pauses for 42 microseconds pulse width
            digitalWrite(8, LOW);
            // wait till second sample 120 uS
            delayMicroseconds(120); // pauses for 120 microseconds between samples
            digitalWrite(7, HIGH);
            delayMicroseconds(42); // pauses for 42 microseconds pulse width
            digitalWrite(7, LOW);
            // wait till next tx pulse 25 uS
            delayMicroseconds(25); // pauses for 25 microseconds till next TX

            }
            I am afraid that if you write time critically functions in Cpp; you'll not have what you expect.
            Overall timing schedule will be distorted and longer than you planned.
            Direct port/pin manipulation turns to be 12x faster and more reliable than when using Cpp.
            Especially DO NOT USE delay() in such schedules.
            Or you can use it but calculating how much of the time the function itself will spend.
            I might be wrong, i think i tested this in the past and it takes 4uS (or 14!? not sure) for function itself without operand.
            So you must have this in mind too.
            As for direct port/pin manipulation here is simple example:
            digitalWrite(12, HIGH); equals to PORTB |=(1<< PORTB4);
            or
            digitalWrite(12, LOW); equals to PORTB &=~ (1<<PORTB4);
            but direct pin manipulation is 12x faster and you loose no cycles.
            I based my code on whats Joop did long time ago when translated Carl's PIC code to AVR.
            Joop posted it here on forum.
            I think i also posted it slightly changed, somewhere on forum too.
            But problem is i don't remember where!?
            Try to search it over the forum.

            Comment


            • #51
              Correct ivconic.

              Not only use direct pin manipulation but also use the hardware timers to ensure timing is always exact.

              There are threads on doing this here:
              https://www.geotech1.com/forums/foru...72-Programming

              Comment


              • #52
                I saw a wonderful deal on eBay for Arduino kit, it was the display options which caught my eye.
                https://www.ebay.com/itm/Arduino-Kit...wAAOSwbDpegZHY
                Attached Files

                Comment


                • #53
                  Originally posted by waltr View Post
                  Correct ivconic.

                  Not only use direct pin manipulation but also use the hardware timers to ensure timing is always exact.

                  There are threads on doing this here:
                  https://www.geotech1.com/forums/foru...72-Programming
                  But of course!
                  It is horrible how i have holes in memory!!
                  I am keep forgetting lot of things so easily!

                  Comment


                  • #54
                    Originally posted by dbanner View Post
                    I saw a wonderful deal on eBay for Arduino kit, it was the display options which caught my eye.
                    https://www.ebay.com/itm/Arduino-Kit...wAAOSwbDpegZHY
                    Splendid offer!
                    Impossible to find anything affordable close to that.

                    Comment


                    • #55
                      So the code made in Arduino IDE is useless , just checked pulses on CRO. not even close to being correct times

                      The 80 uS TX pulse measured at 24uS, the main delay 20uS, the first 42uS sample measured 14uS, the separation between samples 58uS, the second 42uS sample measured 14uS

                      Comment


                      • #56
                        Something is not right here, I have a brand new UNO here somewhere going to try it.

                        AAAAHHH, the old UNO is faulty, tried new UNO works fine, pulses are now correct length, the falling edges are a bit jittery but working.

                        Comment


                        • #57
                          Possibly the Fuzes in the UNO are set for internal RC oscillator and not external XTAL.

                          Yes, you do need to check pulses with an O'scope to verify.

                          Comment


                          • #58
                            Originally posted by Carl-NC View Post
                            For the TX FET, I now mostly used a SPDT analog switch, such as 1/3rd of a 4053. Many of the MOSFETs like to have a high drive level (maybe 10V) and having very low impedance drives is a plus for both turn-on and turn-off. And the 4053 can be driven from 3V logic.

                            Hi, do you bother to tie all the unused pins to ground or is the 4053 not required to do that ?

                            Comment


                            • #59
                              Originally posted by 6666 View Post
                              Hi, do you bother to tie all the unused pins to ground or is the 4053 not required to do that ?
                              It's generally a good idea to at least tie the unused control pins to ground, but I've never had a problem leaving them floating.

                              Comment


                              • #60
                                Originally posted by Carl-NC View Post
                                It's generally a good idea to at least tie the unused control pins to ground, but I've never had a problem leaving them floating.

                                Thanks, so far I have shied away from experimenting with a 4053 on breadboard because of having to ground all the floating pins, I have been driving my TX fets IRF740 gates direct from my micros, 12f683, 12f1840, just with a series resistor, I have found that a 740 is fully turned on with 4.7 volts, so with 5 volts works nice. Been trying to do away with totem pole drivers.

                                Comment

                                Working...
                                X