can someone help me check?


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    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  

  2. #2
    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 -·=»‡«=·-

  3. #3
    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 : 0

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