UP/DOWN counter circuit with basic stamp BS2p40
kingspud
Posts: 128
Hello all,
I finally figured out an UP/DOWN counter circuit with the basic stamp BS2p40 module.·
Here is the circuit and the source code.
The source code will count up to 99 then count down to 0 and repeat!
I hope this helps anyone who is looking for this type of circuit with the basic stamp!
Joe
·
' {$STAMP BS2p}
' {$PBASIC 2.5}
·
counter1·· VAR·· BYTE
counter2·· VAR·· BYTE
·
countingdown·· VAR·· BYTE
countingup···· VAR· BYTE
·
countingdown··· = 100
countingup····· = 100
counter2··· = 6
·
Main:
·
MAINIO:·
· HIGH 0
·
AUXIO:
·
· LOW counter2 ' This input determines the up or down count start, if high then count up if low then count down ·······
· HIGH counter1
·
PAUSE 100
·
MAINIO:
· LOW 0
·
·
· countingdown· = countingdown - 1
· countingup··· = countingup + 1
·
· IF countingup = 99 THEN
··············· countingdown = 100
··· ····counter1 = 2
······· counter2 = 6
· ENDIF
· IF countingdown = 0 THEN
··············· countingup = 0
······· counter1 = 6
······· counter2 = 2
· ENDIF
····
pause 100
·
· GOTO Main
· END
This chips used in this circuit are [noparse][[/noparse]2] 4510, [noparse][[/noparse]2] 4511, [noparse][[/noparse]1] BS2p40, and [noparse][[/noparse]2] 7-segment common cathod displays.
Have fun and let me know if you have any questions.
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“Intellectual growth should commence at birth and cease only at death”
Albert Einstein
Post Edited (kingspud) : 9/28/2008 6:58:06 PM GMT
I finally figured out an UP/DOWN counter circuit with the basic stamp BS2p40 module.·
Here is the circuit and the source code.
The source code will count up to 99 then count down to 0 and repeat!
I hope this helps anyone who is looking for this type of circuit with the basic stamp!
Joe
·
' {$STAMP BS2p}
' {$PBASIC 2.5}
·
counter1·· VAR·· BYTE
counter2·· VAR·· BYTE
·
countingdown·· VAR·· BYTE
countingup···· VAR· BYTE
·
countingdown··· = 100
countingup····· = 100
counter2··· = 6
·
Main:
·
MAINIO:·
· HIGH 0
·
AUXIO:
·
· LOW counter2 ' This input determines the up or down count start, if high then count up if low then count down ·······
· HIGH counter1
·
PAUSE 100
·
MAINIO:
· LOW 0
·
·
· countingdown· = countingdown - 1
· countingup··· = countingup + 1
·
· IF countingup = 99 THEN
··············· countingdown = 100
··· ····counter1 = 2
······· counter2 = 6
· ENDIF
· IF countingdown = 0 THEN
··············· countingup = 0
······· counter1 = 6
······· counter2 = 2
· ENDIF
····
pause 100
·
· GOTO Main
· END
This chips used in this circuit are [noparse][[/noparse]2] 4510, [noparse][[/noparse]2] 4511, [noparse][[/noparse]1] BS2p40, and [noparse][[/noparse]2] 7-segment common cathod displays.
Have fun and let me know if you have any questions.
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“Intellectual growth should commence at birth and cease only at death”
Albert Einstein
Post Edited (kingspud) : 9/28/2008 6:58:06 PM GMT
Comments
what was that file written in. I cant seem to find software to look at it.
Badger
This file is a word document with a paste image of the circuit.
If you are refering to the program used to generate the circuit, I use Proteus 7. It is a simulation software package that uses the Basic stamp modules.
http://www.labcenter.co.uk/products/bstamp.cfm
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“Intellectual growth should commence at birth and cease only at death”
Albert Einstein
I have a copy of the Electronics Workbench Free ware edition Multisim9 (wow, what a mouth full lol)
it is a 45 day free trial but since it is a disk i just keep reinstalling it every other month lol
i have been using it for a few years now and i like it but i like everyone reading this have a basic stamp
so multisim is useless because it does not contain the stamps
now did you buy your copy or can you download it again and again?
thanks
this was being done with the software being list from two postings up
/\
/\
/\
I purchased the Proteus 7 software package and it is without a doubt the best simulation program I have ever uesd to simulate electronic circuit with the basic stamp! Period!! [noparse][[/noparse]And I also own Multisim] It cost me about $345 for the Proteus VSM for Basic Stamp Microprocessor application a year ago and has been worth every penny!
The more I use the more fun I have with it! If you are a Basic Stamp project person and you love doing small or large circuits with the basic stamp then this is THE program for you!
I have already completed 3 projects with this program and did all the testing on the computer before I ever push a chip onto a breadboard.· You can test LEDs, servos, motors, ICs of all kinds, LCD displays, you name it!!
This is a must purchase program if you love playing with the Bsic Stamp!
http://www.r4systems.com/
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“Intellectual growth should commence at birth and cease only at death”
Albert Einstein
Post Edited (kingspud) : 9/29/2008 5:25:19 AM GMT
There is also something called a Real Time Digital Breakpoint (RTDBREAK).· These have 1 to 16 inputs and can be setup to trigger a breakpoint in your schematic when a trigger pattern is hit.· This is a very powerful way to see what your code was doing when a special I/O existed.· These can be used on any wire or wires in the schematic to test for a condition your looking for.· There are also Voltage Breakpoints as well.
If you have not tried using the Real Time Digital Breakpoints in Proteus you are missing a great tool.
If there is interest in these topics, I'll be happy to post some pages on our website on how to use these features.
r4 CAD
I would really like to hear more about the functionality of the Proteus 7 package and the basic stamp package because I am using it more and more for my design process and if may get others interested!
I would love to get a community created to expand the circuit library of basic stamp projects!
Note to Mike Green... Your comment was not necessary for this topic and I feel you think we are trying to take something away from Parallax when actually we are trying to get people to use more tools with Parallax systems. I have seen you do this before and I don't really know why you do it, but I would appreciate it if you would please refrain from taking anything away from what this topic was all about, and that is to deliver more information about a product that will help people learn how to use Basic Stamp! Unless you have used Proteus 7, want additional information about P7, or have anything positive to add to this topic please refrain from adding miss-guided or misdirected comments.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“Intellectual growth should commence at birth and cease only at death”
Albert Einstein
I like your idea of posting more circuits that will simulate in Proteus VSM.· Because you can get so much more information when debugging a design, I think this would be a big help to anyone new to the BasicStamp·or·experienced users.·
I have a "help" file of Proteus tips.· These are tips that would help both a new or experienced user.· I'll try to pull this together and post it as you and others might find it helpful.
R4 Cad