noobie question


Closed Thread
Results 1 to 2 of 2

Thread: noobie question

  1. #1
    02GF74's Avatar
    02GF74 Guest

    Question noobie question

    I have bought a USB PIC prgrammer and want to verify that I have programmed a 16F676 device successfully.

    So my program initially was to toggle one line on port C and device configrued to use internal osciallator.

    that didn't work so I removed the int. osc code and wired up a 10 MHz crystal and capacitors but no difference - I'm pretty sure the device needs to be configured so it knows there is an external clock souce but ain't figure that one out yet - which may explain why that failed too.


    So in short, in both cases the device did not do what I expected so I have a plea for some sample code as follows:

    1. configure device to use internal oscillator
    2. config device to use external crystal
    3. some code to toggle a line on Port C at say every second so I can measure using DVM.

    I'm going trhough the device spec. sheet but is it rather hard going - any links to beginners programming guide, idealy specific to 676 device would be muchly appreciated.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Noobie Help

    Hi 02GF74,
    this should get you started, if any of these cause the compiler to hang, just comment it out.
    JS

    Code:
    ADCON1 = 7  'Disable A/D converter
    CMCON=7     ' DISABLE ANALOG ON 676
    @ DEVICE PIC16F676,HS_OSC
    @ DEVICE PIC16F676, WDT_OFF
    ' Watchdog Timer
    @ DEVICE PIC16F676, PWRT_ON
    ' Power-On Timer
    @ DEVICE PIC16F676, MCLR_ON
    ' Master Clear Options (Internal)
    @ DEVICE PIC16F676, BOD_OFF
    ' Brown-Out Detect
    @ DEVICE PIC16F676, LVP_OFF
    ' Low-Voltage Programming
    @ DEVICE PIC16F676, CPD_OFF
    ' Data Memory Code Protect
    ' Set to CPD_OFF for Development Copy
    ' Set to CPD_ON for Release Copy
    @ DEVICE PIC16F676, PROTECT_OFF
    ' Program Code Protection
    ' Set to PROTECT_OFF for Development Copy
    ' Set to PROTECT_ON for Release Copy
    http://ww1.microchip.com/downloads/e...Doc/40039D.pdf

Similar Threads

  1. Extreme Noobie question 12F675
    By Jeff in forum mel PIC BASIC
    Replies: 11
    Last Post: - 22nd September 2009, 01:13
  2. noobie to PICs and PBPro... Programming question.
    By mcphill in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th October 2007, 18:35
  3. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  4. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49
  5. Noobie Question
    By mel4853 in forum mel PIC BASIC
    Replies: 19
    Last Post: - 2nd July 2006, 12:45

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