PDA

View Full Version : UP/DOWN counter circuit with basic stamp BS2p40



kingspud
09-29-2008, 02:45 AM
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 [2] 4510, [2] 4511, [1] BS2p40, and [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

Badger
09-29-2008, 03:20 AM
Hey

what was that file written in. I cant seem to find software to look at it.


Badger

kingspud
09-29-2008, 05:05 AM
Hi 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

Lab Rat
09-29-2008, 09:07 AM
thanks for the software link :)
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

Lab Rat
09-29-2008, 10:09 AM
wow this software is awesome i have been playing with it for like an hour now and i am looking at the sample programs and it is kicking my computers but it actually maxes out my cpu because the sample i was playing with actually ran an operating system (linux to be exact)
this was being done with the software being list from two postings up
/\
/\
/\

Lab Rat
09-29-2008, 10:38 AM
i even managed to beat it at chess

kingspud
09-29-2008, 01:02 PM
To all,

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!! [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

Mike Green
09-29-2008, 01:18 PM
A lot depends on your style of working. Some people are much happier when they can simulate a system before they build it. Some are very happy with blinking lights and displays. A Professional Development Board can give you pushbuttons and lights and, if you get a serial LCD display too, that can give you excellent debugging and status information. You can still get the Basic Stamp Logic Analyzer if you want to look at the I/O pins of your Stamp on your PC.

R4 CAD
10-17-2008, 02:24 AM
There are a lot of tools included with Proteus that make it easer and much faster to debug a design or program.· Such as I2C and SPI scopes and of course there is a 4 channel DSO and a 24 ch logic analyzer just to mention a few.· The ability to single step your program is a very powerful way to see what your program is doing.

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

kingspud
10-17-2008, 07:58 AM
Hello 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

R4 CAD
10-22-2008, 10:28 PM
Hi,

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