Your suggestion of using "goto" did not work.
If you add -v to your command line when compiling, it should highlight the offending line during the compilation process to give you a clue where to look.
As Paul said you should be using GOSUB BLINK because you are calling a subroutine, and not GOTO BLINK as in your original post, which makes me suspect that the code you posted on the forum is not exactly the same as the code you have in your working program, because you will get a Stack Underflow the instant your try to run it on a PIC.
------ I should have stated I am using the complier that comes with PidBasic Pro called MicroStudio, so I don't know how to do the command line option you suggested. Thank you though ----
If you add -v to your command line when compiling, it should highlight the offending line during the compilation process to give you a clue where to look.
I have tried both "goto and gosub" with same result... I'll try again this morning and see what I can get! (fingers crossed)
"As Paul said you should be using GOSUB BLINK because you are calling a subroutine, and not GOTO BLINK as in your original post, which makes me suspect that the code you posted on the forum is not exactly the same as the code you have in your working program, because you will get a Stack Underflow the instant your try to run it on a PIC. "
It's probably a setting in your Microcode Studio (which I don't use). The reason I say that is that the only difference between a 16F818 and 819 is the memory. PICBasic will not give you a clean compile on the 818 and then an error on the 819. Sometimes I think IDE's give you more problems than they're worth.
Eveybody can have their own opinion about any IDE but in this case it's not the problem source. In fact, since i use MicroCode Studio i'd never ever have a problem related to the IDE when compiling the code, using the Serial Monitor, Bootloader or else component of.
NOW, let's see where it may crash...
Come on.. read carefully the PBP manual, you must write the channel number not the PORT PIN nameCode:ADCIN PORTA.1, X
true about the Goto Gosub, you must write asCode:ADCIN 0,x
BUT, i also suspect of a corrupted file in your PBP folder. remove PBP then reinstall it.Code:Pause 50 If X > 100 Then GOSUB BLINK ENDIF GOTO LOOP
That's definately NOT an IDE problem. Work here with PM and MPASM with both PIC EVEN if i keep the Goto instead of using the GOSUB. I'll keep my own 'flames' about IDE.
Last edited by mister_e; - 21st April 2006 at 03:02.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well the following code got rid of that strange error... now the LED blinks no matter what the variable number is. So another issue to tackle... whoa is me.
"'''''''''''''''''''''''''
Define OSC 4
''''''''''''' DEFINE Analog Stuff '''''
Define ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SEAMPLEUS 50
ADCON1= %10000010 'Set PortA analog and right justify
TRISB = %00000000 'set PortB to output
TRISA = %10111111 'set A.0-5,7 as input/ A.6 as output
'MAKE A VARIABLE TO HOLD THE NUMBER!
Selection var byte
Main:
adcin 1,selection
serout2 PortB.6,16468,[DEC Selection, 10, 13]
If Selection > 100 Then
Gosub BLINK
ENDIF
goto Main
BLINK:
High PortB.3
Pause 200
Low PortB.3
GOTO Main
'''''''''''''''''''''''
Bookmarks