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....
Bookmarks