Program for 12F675 thet commutes two pins for drive a two MOS Transistor for generate 16.666 ms cycle for inverter proposites, compiles well with PROTON basic, do not work with GCBASIC, the two hex files would be very alike but not. what happens??????? thanks in advance for your sure attention. PCURVELO
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GCBASIC is different to Proton Basic, so the program will need to be changed a bit. If you post the program here, I'll be happy to change it so that it will work with GCBASIC.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! GCBasic is great.
I have an issue with pulsin command.
I use an ultrasonic wave detector (distance sensor) to detect the distance of an object and display it on LCD module.
The device has 4 pinouts, 1 for power, 1 for ground, 1 for trigger input and the last for echo. I connect trigger pin to portB.3 of pic and echo to portB.4. I use 4MHz oscillator
the code in pic basic pro is as follows:
main:
distance var word
distinch var word
xxxx
xxxx
sonar:
pulsout portB.2, 1 '10 micro-second
puslin portB.3, 1, distance
distinch = distance / 15
Then i want to display distinch on LCD module.
it works fine with picbasic pro,
But the main program has other codes that exceeds 50 lines so i cant possibly use picbasic pro free version.
i am just a student so cant afford to buy the software
i tried GCBasic graphical version and loved it.
i convert this program to gcbasic as follows:
sonar:
PulseOut portB.2, 1 1us
PuslIn portB.3, distance, 10 us
but it did not work.
I have tried with a do loop as follows:
distance = 0
do while portB.3 = on
wait 10 us
distance = distance +1
if distance = 0 then exit do
loop
it did not work either
distinch = distance / 15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a few suggestions:
First, it's usually important to understand error messages. I would ensure that compile.bat contains the directory where gcbaic is installed.
Second, once the compiler actually runs and compiles what you have typed in, any messages given are usually clues as to where problems may be in your instructions.
Your gcbasic code says Puslln, but there is no such command in the GCBASIC Command Guide (same for Pulsin). To get an echo time, consider starting a timer at pulseout, checking the pulsin pin for a change, then stop and read the timer.
-Bert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Welcome to Compiler Problems
Program for 12F675 thet commutes two pins for drive a two MOS Transistor for generate 16.666 ms cycle for inverter proposites, compiles well with PROTON basic, do not work with GCBASIC, the two hex files would be very alike but not. what happens??????? thanks in advance for your sure attention. PCURVELO
GCBASIC is different to Proton Basic, so the program will need to be changed a bit. If you post the program here, I'll be happy to change it so that it will work with GCBASIC.
When I will see added: PULSIN to Great Cow Basic
I can add it in the next version if you'd like.
Hi! GCBasic is great.
I have an issue with pulsin command.
I use an ultrasonic wave detector (distance sensor) to detect the distance of an object and display it on LCD module.
The device has 4 pinouts, 1 for power, 1 for ground, 1 for trigger input and the last for echo. I connect trigger pin to portB.3 of pic and echo to portB.4. I use 4MHz oscillator
the code in pic basic pro is as follows:
main:
distance var word
distinch var word
xxxx
xxxx
sonar:
pulsout portB.2, 1 '10 micro-second
puslin portB.3, 1, distance
distinch = distance / 15
Then i want to display distinch on LCD module.
it works fine with picbasic pro,
But the main program has other codes that exceeds 50 lines so i cant possibly use picbasic pro free version.
i am just a student so cant afford to buy the software
i tried GCBasic graphical version and loved it.
i convert this program to gcbasic as follows:
sonar:
PulseOut portB.2, 1 1us
PuslIn portB.3, distance, 10 us
but it did not work.
I have tried with a do loop as follows:
distance = 0
do while portB.3 = on
wait 10 us
distance = distance +1
if distance = 0 then exit do
loop
it did not work either
distinch = distance / 15
compile.bat not find the directory gcbasic
I have a few suggestions:
First, it's usually important to understand error messages. I would ensure that compile.bat contains the directory where gcbaic is installed.
Second, once the compiler actually runs and compiles what you have typed in, any messages given are usually clues as to where problems may be in your instructions.
Your gcbasic code says Puslln, but there is no such command in the GCBASIC Command Guide (same for Pulsin). To get an echo time, consider starting a timer at pulseout, checking the pulsin pin for a change, then stop and read the timer.
-Bert