Newbie Question


Results 1 to 15 of 15

Thread: Newbie Question

Threaded View

  1. #5
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Several things:

    1) First your crystal is connected incorrectly based on the text file. On a 16F628 the crystal needs to be tied to pins 15 and 16. (see datasheet for details)

    2) Depending on your baud rate you may want to move the speed of your crystal up. At 9600 baud I usually use 16 mhz crystal.

    3) Here is an example of a typical Device programming Options :

    @ DEVICE pic16F628, HS_OSC ' System clock Options
    @ DEVICE pic16F628, WDT_ON ' Watch Dog Timer
    @ DEVICE pic16F628, PWRT_ON ' Power-on timer
    @ DEVICE pic16F628, BOD_ON ' Brown-out detector
    @ DEVICE pic16F628, MCLR_OFF ' Master Clear Options
    @ DEVICE pic16F628, LVP_OFF ' Low-voltage programming
    @ DEVICE pic16F628, CPD_OFF ' Data Memory Code Protect
    @ DEVICE pic16F628, PROTECT_OFF ' Program Code Protections

    NOTE: If you noticed above I have clock option set to HS not XT. At 16mhz this is considered High-Speed.

    4) When using a crystal don't forget to define the speed:
    DEFINE OSC 16 ' 16mhz XTAL

    5) The word "SYMBOL" is unneeded when you are defining constants. Use the follwing instead:
    line1 CON 128

    6) TRISB=%11111111 ' PORTB all Inputs
    TRISB=%00000000 ' PORTB all Outputs
    TRISB = %00000001 ' PORTB.0 PIN input for button

    These things should help get you running.
    Last edited by DynamoBen; - 26th February 2006 at 06:58.

Similar Threads

  1. Newbie 74hc595 question
    By manjero in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd January 2008, 23:22
  2. newbie with serial com question...
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th December 2006, 06:34
  3. Newbie Question - Info Please
    By ehoskins in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd October 2006, 15:50
  4. Greetings from Newbie and a question
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th July 2006, 16:52
  5. Newbie question
    By senojlr in forum General
    Replies: 7
    Last Post: - 11th April 2006, 22:23

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