can someone help me check?


Closed Thread
Results 1 to 18 of 18
  1. #1
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42

    Unhappy can someone help me check?

    I was wondering if i could get feedback from you guys. Attached are 3 files:

    1. Schematics of the robot
    2. My connections on the breadboard with the motor cable plugged in
    2. My Connections without the motor cable

    I only had 1 motor plugged in to test the circuit if it was working and the end result was that the motor jerked (i think that's the word) a little then nothing happened. the codes is based on the one the i posted in MeLabs PICBasic thread/discussion. If you could help me it would be great.

    i am concered about the diode connection. can't really see it in the picture but currently the silver band is facing away from positive terminal but it heats up. is that normal for it to heat up? is it possible that i might have the wrong diode type?

    if you could help it is much appreciated
    Attached Images Attached Images    
    -·=»‡«=·- saturnX -·=»‡«=·-

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The use of a diode to reduce the voltage is not the best solution if the target circuit don't need much current. In this case, the voltage drop on the diode will be less than what you wish.

    SO, your PIC is probably dead now and short. This is why your DIODE comes HOT.

    You should double check your crystal connection also.

    What is between the PIC and the Motor?
    Last edited by mister_e; - 12th September 2005 at 03:45.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default hi steve!

    do you know how glad i am to see your nick online on the forum! is there a manual way of testing if the chip is dead? i don't get you on the part of the where you asked whats between the motor and the chip. If i get you correctly there isnt anything except a link to RB0 from the chip to the motor. Remember the codes i posted on the other discussion where u helped me convert to basic. yeah that is the codes and the schematics are attached here.

    you reckon i should get a batch of fresh new chips? oh the other question which i forgot to mentioned (maybe i did) in the first post, is there a difference in the type of chip it uses. In the book it says 16F84 but when i got this batch from the robot store where they sold the parts to make this robot, they sent the 16F84A chip.
    Last edited by saturnX; - 12th September 2005 at 03:51.
    -·=»‡«=·- saturnX -·=»‡«=·-

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    OK now we have two reason to believe that the PIC is dead now. As the motor need more than 25 mA, you blow the I/O and the PIC. You MUST use a driver (MOSFET, Transistor) to drive your Motor.

    There's not really a manual way to Test if the Chip is good or bad BUT, try to erase it and reprogram it again. There's lot of chance that you'll get some error message from your programmer software.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    16F84 or 16F84A... the one you have is a newer version. There's no big difference. But if you want to have the truth, there's probably some Migration document or errata on this chip on the Microchip website.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    i just so happen to have just erased and reprogramed it but i didn't get any errors when it was doin so. i even got it to verify the burn to the chip and it came back OK including the blank check.

    when i disconnect and reconnect back the diode the motor jumps to life for 1 second then nothing.. the diode heats up from there. but have a look at the original schematics from the book (attached drawing.jpg) the author did not include any transistors in between the chip and motors.
    -·=»‡«=·- saturnX -·=»‡«=·-

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yeah i see but you must have it. As your pin is probably dead, try with another i/o it will work for a few, then blow again.

    Do you have any spec of the motor you use?

    Do you have some Npn, PNP transistor or mosfet on hand? If so wich ?

    Double and triple check your Crystal and capacitor connection...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    no i don't have any at hand right now. the electronic shop is 5mins from my house. i want to ask about the crystal and capacitor connections... have a look at this website schematics: http://home.planet.nl/~j.havinga/servo/servo.htm
    how come the crystal is and capacitors are only hooked up to pin 15 where as in my book it says it has to be connected to both 15 and 16. can share some light on this?

    servo motor: HiTEC HS-322HD (recommended by the author)
    Class: Standard
    Digital: No
    Programmable: No
    Voltage: 4.8v or 6.0v
    General Specs:
    - Bearings: bushing
    - Gears: Karbonite
    - 60° speed: .19 sec @ 4.8v
    - 60° speed: .15 sec @ 6.0v
    - Torque: 42.00 oz/in @ 4.8v
    - Torque: 51.00 oz/in @ 6.0v
    -- 1.57 x.79x1.46 inches
    - 1.52 ounces


    In the book the author incorporated the diode to keep the power at least consistent at around 5.3v to make it possible to run the motors.
    -·=»‡«=·- saturnX -·=»‡«=·-

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    ARGH forget me, i didn't notice it was a ServoMotor. So the i/o current is not a problem now.

    While i don't see the same thing as you about the only one pin connection... it is connected on 15 and 16.

    BTW, do something. Remove both capacitor, crystal and their jumpers, and sit the crystal directly on pin 15 and 16. It will work without the cap... on bread board only.

    Next thing, did you set the osc mode to HS in your programmer software???
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    i am using epic programmer to program the chip. are you familiar with that? umm if not explain to me "osc mode to HS" so i can find it and change it...



    found it... but what is HS mode?
    Last edited by saturnX; - 12th September 2005 at 04:57.
    -·=»‡«=·- saturnX -·=»‡«=·-

  11. #11
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    the good news is that the diode is not heating up.. the bad news is that the "servo motor" doesn't move until i break the diode connection and reconnect it back. even so its a small little jerk then nothing else.
    -·=»‡«=·- saturnX -·=»‡«=·-

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    no i'm not familiar with EPIC. BUT place the following line on the top of your code. It will set the HS mode for you.
    Code:
    @ __config _HS_OSC & _WDT_OFF & _PWRTE_ON
    more info on the following link. Pay attention on #1 and #5
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    i'm over for tonight.. good night and good luck!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    thanks for the help steve... guess i'm on my own for now. only 4 more hours to my presentation of this project. i am going to die! lolz!
    -·=»‡«=·- saturnX -·=»‡«=·-

  14. #14
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by saturnX
    thanks for the help steve... guess i'm on my own for now. only 4 more hours to my presentation of this project. i am going to die! lolz!
    I am so sorry to hear that!

    After all this hard work in the previous three days you must be exhausted!
    (Three threads in three days).

    Stay home, don't go to school.


    Luciano

  15. #15
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Smile

    hi Luciano, i guess there is so only so much one person can do even with the help of the best. i just never understood why it didn't want to work. thanks for dropping by and the support. anything you can help me wif i welcome if with open arms
    -·=»‡«=·- saturnX -·=»‡«=·-

  16. #16
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Hi Andrew

    You've probably missed your deadline... that's what happens when you do your project the night before. You gotta cut down on beer and girls...

    In answer to your email... (not in any particular order)...

    They wire Power Stations using thinner wire!

    Get some single-strand insulated solid conductor wire - kinda fits into breadboards easy!

    The way you got the Diode in your picture is correct. If things are heating up as you say in your email, then you have a major problem... you might have killed your PIC. If so, DON'T replace it with another F84... see my comment further down.

    Can't see too clearly as your pics aren't that focused, but I think you've MISSWIRED your crystal. It also should have SHORT leads to your PIC... as short as possible. In future use a three-pin Resonator (one with built-in Capacitors) as it's easier to play with and breadboard - or use a PIC with a built-in oscillator. Depending on your breadboard, you might even be able to dispense with the Capacitors.

    I HATE schematics out of books, they always omit things as the author assumes the reader has a basic knowledge... take a 100nF Capacitor between Vss (5) and Vdd (14) on your PIC... it'll kill any noise. Along with it connect a 10uF Capacitor (to smooth any supply irregularities) the same way.

    You don't need the RESET Switch to make things work. It should fly as soon as you apply power.

    The 16F84A is for all intents and purposes the same as the 16F84.

    In future, get yourself a 16F628 or 16F628A... cheaper than an F84 and more fun... (you can make those work without Xtals or Resonators)... as well as being fully compatible with the F84's (with just one line of code difference).

    See the Breadboard picture I've included. yes, I've used a F628, but you can pretend it's an F84. The salient points are keeping the xtal and capacitor paths SHORT... that's why I've got Vss running across the top rather than your Vdd. I've connecetd an LED between Vdd and RB0 (shorter lead of LED to RB0) via a 330R resistor (use anything in the range 220R-390R). I have a 100nF capacitor between the PICs Vss and Vdd, and a 10uF electrolytic similarly. Finally, the PIC doesn't draw a great deal of current, and consequentially the Diode may not drop 0.6/0.7v across it (another reason for hating schematics out of books). I've added a 1K resistor between Vss and Vdd to force a few mA through it. Either way, you're flying close to the 5.5v maximum limit of an F84A.

    Put that LED and Resistor per my example temporarily (in place of your Servo) and run the appended code. It should blink once per second (half second ON, half second OFF - this assumes you have a 4MHz Xtal). If it does, you are in business, it it doesn't you have a problem.

    Code:
        @ DEVICE pic16F84A, XT_OSC
        @ DEVICE pic16F84A, WDT_ON
        @ DEVICE pic16F84A, PWRT_ON
        LED var PortB.0
        TRISA=%00000000
        TRISB=%00000000
    Loop:
        High LED
        Pause 500
        Low LED
        Pause 500
        Goto Loop
        end
    Try to keep things on the forum in furture.

    Melanie
    Attached Images Attached Images  

  17. #17
    Join Date
    Sep 2005
    Location
    Malaysia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    hi melanie!

    i will try your method of going about the whole wiring and placement of components on the board and post my results later on tonite (now since i know how to take proper snap shots of the board). have to go dig out my LED's. hehe. oh just wondering the language you're using? is it basic stamp? i don't recognise it really and i tried certain codes which were written that way and the compiler didn't recognise it. I'm using PICBasic Pro for compiler, Microcode as editor and Epic Programmer to burn to the chip. But your way of coding seems a lot more easier. this is the one i have for PICBASIC PRO. does the same thing but differently.

    Code:
    'PicBasic Pro codes
    Loop:
        High PORTB.0
        Low PORTB.1
        Pause 500
        Low PORTB.0
        High PORTB.1
        Pause 500
        Goto Loop
    -·=»‡«=·- saturnX -·=»‡«=·-

  18. #18
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I am using PICBasic Pro in my example (this is a MeLabs compiler site after all!). That example WILL compile with the command line...

    pbp -p16F84A Filename

    All I did was alias PortB.0 to LED, and use LED thereafter... applying this to your example...

    Code:
        @ DEVICE pic16F84A, XT_OSC
        @ DEVICE pic16F84A, WDT_ON
        @ DEVICE pic16F84A, PWRT_ON
        LED var PortB.0
        AntiLED var PortB.1
        TRISA=%00000000
        TRISB=%00000000
    Loop:
        High LED
        Low AntiLED
        Pause 500
        Low LED
        High AntiLED
        Pause 500
        Goto Loop
    of course you can always simplify the whole (original) loop...
    Code:
    Loop:
        Toggle LED
        Pause 500
        Goto Loop
    Aliasing you will find in your PBP manual. TRISA/TRISB you will find in the PICs Datasheet, and @ DEVICE you will find here...

    http://www.picbasic.co.uk/forum/showthread.php?t=543

Similar Threads

  1. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 18:11
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. Even Parity Check, How?
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th January 2005, 09:21

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts