If the 16F877 is on the drop list it must work.
remove your config fuse to see. If there's any other problem, tell us your PBP version, Microcode Studio version and also post your code here.
If the 16F877 is on the drop list it must work.
remove your config fuse to see. If there's any other problem, tell us your PBP version, Microcode Studio version and also post your code here.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Err... I don't know where the drop list is. THe version of Micro Code Studio is v 2.2.1.1Originally Posted by mister_e
The Read.me file says this:-
PICBASIC(TM) Compiler Ver. 1.45 README.TXT
Copyright 2005 microEngineering Labs, Inc.
I don't know if it's integrated correctly Into PIC BASIC Standard.
The code is one of the Samples:-
' Simulate BS2 Shiftin and Shiftout
Symbol DDIR = Dir0 ' Shift data pin direction is Dir0
Symbol DPIN = Pin0 ' Shift data pin is 0
Symbol CPIN = 1 ' Shift clock pin is 1
Symbol I = B2 ' Loop counter
' Shift in some data
Low CPIN ' Start shift clock low
Gosub shiftin ' Shift in some data
' Shift out some data
Low CPIN ' Start shift clock low
B0 = 100 ' Data to shift out
Gosub shiftout ' Go do it
End
' Subroutine to synchronously shift in one byte
shiftin: DDIR = 0 ' Set data pin direction to input
For I = 1 to 8 ' 8 bits to a byte
B0 = B0 * 2 ' Shift result 1 bit to the left
Toggle CPIN ' Toggle shift clock
Bit0 = DPIN ' Move data into LSB
Toggle CPIN ' Toggle shift clock once more
Next I ' Loop
Return ' Go back to caller
' Subroutine to synchronously shift out one byte
shiftout: DDIR = 1 ' Set data pin direction to output
For I = 1 to 8 ' 8 bits to a byte
DPIN = Bit0 ' Data out is LSB
Toggle CPIN ' Toggle shift clock
B0 = B0 / 2 ' Shift byte 1 bit to the right
Toggle CPIN ' Toggle shift clock once more
Next I ' Loop
Return
Last edited by timmoore47; - 18th May 2006 at 14:48.
Drop list <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=872&stc=1&d=1147960259 ">
Now with PBC... iiiish i'm sorry i couldn't be much help but i believe that...
Is invalid. I know you must use or redefine specific variable name.. about the PORTA, PORTB.. name it's sure you can't use Dir0, Pin0 and 1Code:Symbol DDIR = Dir0 ' Shift data pin direction is Dir0 Symbol DPIN = Pin0 ' Shift data pin is 0 Symbol CPIN = 1 ' Shift clock pin is 1 Symbol I = B2 ' Loop counter
Fortunately, there's some user here who use PBC and can help.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Ok, Has anyone got a very simple code fragment I could try?
So far I've not got off ground zero!
Maybe I've got a duff install?
Tim
I have a few, what type program are you after. I have one that runs two servos, to move my robot dog (PWM commands to servos). It is old and I would have to clean it up.
I have one that reads and LDR and buzzes a Piezo buzzer every 30 seconds.
What are you tryig to do?
Thank you for responding.
I'm building a video switching unit. To choose between 5 video channels and just switch one of them to a DVD Recorder. It's monitoring nocturnal wild Hedgehog activityin a UK garden.
I've got 5 PIR Sensors which kick out +5 volts when a hedgehog passes by.
So for each binary pattern on PortA, a single relay attatched to the first 5 of PortB pins is switched.
So I need to set PortA to be inputs, PortB to be outputs then read portA, make a decision, set a relay and delay, then do it again.
Easy enough on paper but PBC code seems to use different commands to other PicBasics I've used and I got confused badly on setting up and reading PortA and defining variables.
Tim
I am heading for work now. So not much time.
You need to symbol portA and portB to there locations.
Then peek portA (say into B0), do any logic on it
Then poke portB with your results from B0.
What happened if two PIRs are tripped? Do you have a priority for them?
You will probably want to make sure there is only one bit set in B0 otherwise
you will have two or more relays flip on (multiple video coming in).
If this does not help, later I will see if I can send a sample. Just running late right now.
Bookmarks