The worst programmer ever to grace this forum - ME!


Results 1 to 40 of 50

Threaded View

  1. #1
    Join Date
    Mar 2009
    Posts
    653

    Default The worst programmer ever to grace this forum - ME!

    Ok, I've been on about 8 hours trying to get a damn LED to light using PICBAsic - nothing!

    I have a PICkit 2 (the board comes with a PIC16F690), everything works fine with 'hello world' tutorial Microchip provide (which proves the chip & LED is fine). Assembly language make my brain spontaneously combust so I would like to learn a higher level language such as basic (which seems at least a little akin to DEC DCL...something I used about 10 years ago)...I'm beginning to wish I hadn't.


    Right to my simple problem - more than anything in the world right now, I want to see that stupid little LED on my PICkit 2 low pin count board light up!

    Most of the 'flash an led' example basic programs work on the PIC's Port A...now I thought it would be a simple case of changing the references conatined therein to PortC (the 4 leds on the Pickit board are attached to Port C)

    But when I change not a lot happens!

    I'm aware that the 16f690 has analogue ports turned on as default & Ive seen some mention that this can be remedied with a commands along these lines

    ANSEL = 0
    ANSELH = 0

    but the microcode studio GUI doesn't seem to recognise those commands (I'm new to this interface but it seems to darken/bold commands it's happy with)

    Could some one humour me here & cut/paste in the ludicrously simple basic code for PIC Basic Pro that I need to light an LED on portc.1 of my 16f690.

    I can then put this all to rest & pour petrol over my pickit 2 whilst moonwalking backwards to "The eye of the Tiger".




    FWIW, This is the latest code I've tried (based on this link http://www.digital-diy.net/16F%20Exa...LED's.aspx )....

    Symbol LED_1 = PortC.0 ' Define a symbol in the program

    TRISC.0 = 0 ' Make PORTC.0 an output
    PORTC.0 = 0 ' and set it low (0V)

    Main:

    If LED_1 = 0 then ' Check the status of the LED
    LED_1 = 1 ' and toggle it
    Else
    LED_1 = 0
    Endif

    DelaymS 1000 ' Delay for 1 second (compiler errors with this line - I guess the command isn't right!)
    Goto Main ' Loop forever




    Basic Schhmasic....
    Last edited by HankMcSpank; - 14th March 2009 at 00:41.

Similar Threads

  1. Melabs U2 Programmer Command Line Options
    By Robert Wells in forum General
    Replies: 5
    Last Post: - 3rd July 2009, 02:11
  2. problems with USB programmer
    By malc-c in forum General
    Replies: 7
    Last Post: - 10th May 2007, 20:14
  3. USB programmer problems
    By uiucee2003 in forum USB
    Replies: 2
    Last Post: - 15th August 2006, 23:47
  4. General Programmer Questions
    By mslaney in forum General
    Replies: 1
    Last Post: - 17th December 2004, 18:16

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