PDA

View Full Version : Help with upgrading from PIC Basic Compiler to PIC Basic PRO



ERIK
- 17th January 2006, 09:14
Hi There, I've just upgraded from PIC Basic Compiler to the PRO version due to the obvious limitations with the standard version. I had PBC working great until I ran out of code space etc. But now I cant seem to get even the simplest LED blinking program to run. Everything seems to compile just fine, yet no joy in flashing an LED. So before I start ripping my complicated circuits apart on my breadboard I thought I'd ask if there is anything really simple that I might be missing in the upgrade process. Can anyone spare some time for your newest newby?

Melanie
- 17th January 2006, 09:25
The batteries are out in my crystal ball Erik. It would help if you could tell us what PIC you're using and post your super new and shiny blinky LED code... I need a laugh this morning....

ERIK
- 17th January 2006, 09:39
Well, I'm using a 12F675 and heres one of several that haven't worked:

CMCON = 7 ' Comparators OFF
ANSEL = 0 ' A/D OFF
loop: High GPIO.1 ' Turn on LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Low GPIO.1 ' Turn off LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Goto loop ' Go back to loop and blink LED forever
End

ERIK
- 17th January 2006, 09:48
PS: I forgot to change the comments regarding the port numbers. But I'm wondering about stuff like at the moment I'm running both PBC and PBP on the same computer and it doesn't seem to be a problem but maybe it is. I mean I'm obviously missing something at a basic level here, because all my PBCing was going just fine. Anyway, its getting late on this side of the panet and I'm burnt out from surfing so I'm going to bed. Catch you later, and thanks for any help/suggestions that might help get my LED's blinking again.

Melanie
- 17th January 2006, 16:40
Well, since you got a grown-up compiler, we might as well do things properly...



'
' PIC Defines
' -----------
@ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
' System Clock Options (Internal)
@ DEVICE pic12F675, WDT_ON
' Watchdog Timer
@ DEVICE pic12F675, PWRT_ON
' Power-On Timer
@ DEVICE pic12F675, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic12F675, BOD_ON
' Brown-Out Detect
@ DEVICE pic12F675, CPD_OFF
' Data Memory Code Protect
@ DEVICE pic12F675, PROTECT_OFF
' Program Code Protection
'
' Hardware Defines
' ----------------
LED var GPIO.1
'
' Initialise PIC
' --------------
TRISIO=%00001000 ' All Output except GPIO.3
CMCON=%00000111 ' Disable Comparators
ANSEL=%00000000 ' Disable ADC
'
' Let's do Blinky Thing...
' ------------------------
Start:
Toggle LED
Goto Start

end


Compile using the command line...

PBP -p12F675 myprog -v

Then if you want to be exotic with your 12F675 download yankeedoodle from here...

http://www.picbasic.co.uk/forum/showthread.php?t=64

ERIK
- 17th January 2006, 19:26
Thanks for your help, It looks like I was neglecting the defines (I was setting the fuses with my programmer, but they were obviously getting over-written). It looks like the reason all my stuff was running on PBC was that the INC file didn't turn MCLR on where as my new grown up compiler uses an INC file which turns it on (hmmmm). Anyway, now I am ready to seriously blink some LED's :) also thanks for the sound tables that was going to be my next question.