Basic Stamp BS2P and the MAX7219 Display Driver
G McMurry
Posts: 134
I always get great suggestions here for my projects. I want to thank everyone in advance for your suggestions with my current situation.
I have been successful using the MAX7219 Display Driver along with both BS2 and BS2P for quite a while. All my projects are typically made up on PCBs and powered by 12VDC then 7805 regulators. This one is no exception
The problem I am having with this system is that it periodically comes up blank. I have to sometimes power it off and on to get it to start working. I always have a blinking LED attached directly to my STAMP and it is blinking so I know my STAMP software is running, at least inside the STAMP.
Upon power up, my software goes immediately into the MAX7219 initialization routine..
FOR index = 0 TO 7 ' Initialize MAX7219
LOOKUP index, [Scan, 7, Brite, 9, Decode, $FF, ShutDn, 1], d7219
SHIFTOUT doutPin, ioClkPin, MSBFIRST, [d7219]
IF (idxOdd = 0) THEN No_Load
PULSOUT DisLoadPin, 2 ' load parameter to Display 1 Top Display
No_Load:
NEXT
I am wondering if there is a recommended power on cycle I should use, like hold the MAX7219 clk pin low for a second while the BS2P comes up.
I have tried just inserting a PAUSE 20 before Initializing the MAX7219 but that doesn't help.
Once the system is up and the display is blank, pushing the Basic Stamp Reset doesn't help. I think the MAX7219 is crashed or out of sync. I have tried replacing it but a new device does the same thing.
I have a split power supply on this board. Two 7805 regulators. One for the digital logic (including the stamp) and one for the MAX7219. I am running the displays full bright and I didn't want to try to share power supplies with my logic.
Any thoughts would be appreciated.
Greg
I have been successful using the MAX7219 Display Driver along with both BS2 and BS2P for quite a while. All my projects are typically made up on PCBs and powered by 12VDC then 7805 regulators. This one is no exception
The problem I am having with this system is that it periodically comes up blank. I have to sometimes power it off and on to get it to start working. I always have a blinking LED attached directly to my STAMP and it is blinking so I know my STAMP software is running, at least inside the STAMP.
Upon power up, my software goes immediately into the MAX7219 initialization routine..
FOR index = 0 TO 7 ' Initialize MAX7219
LOOKUP index, [Scan, 7, Brite, 9, Decode, $FF, ShutDn, 1], d7219
SHIFTOUT doutPin, ioClkPin, MSBFIRST, [d7219]
IF (idxOdd = 0) THEN No_Load
PULSOUT DisLoadPin, 2 ' load parameter to Display 1 Top Display
No_Load:
NEXT
I am wondering if there is a recommended power on cycle I should use, like hold the MAX7219 clk pin low for a second while the BS2P comes up.
I have tried just inserting a PAUSE 20 before Initializing the MAX7219 but that doesn't help.
Once the system is up and the display is blank, pushing the Basic Stamp Reset doesn't help. I think the MAX7219 is crashed or out of sync. I have tried replacing it but a new device does the same thing.
I have a split power supply on this board. Two 7805 regulators. One for the digital logic (including the stamp) and one for the MAX7219. I am running the displays full bright and I didn't want to try to share power supplies with my logic.
Any thoughts would be appreciated.
Greg
Comments
2. I have found starting with a nop command is good, followed with a command to get it out of lamp test (don't remember the register number just now).
I was just looking at the Parallax example of using the 7219 and noticed the 10K termination resistor on the "load" pin. I didn't use anything... I imagine pull up or pull down, it doesn't matter, just keep the pin from floating around during powerup.
I have used this chip a few times before and never had that problem. Its not the first time that has happened -- (smile).
I will give it a try and post my results here.
THANKS!
Greg
PS Attaching my schematic.
I would use a pull-UP for sure. You want the signal to be not active during power up. In the immortal words of Jonnymac:
As a matter of habit I put pull-ups on all active-low chip select lines in my designs.
Here is a link to a little video I made about my project.
https://www.youtube.com/watch?v=A8wIAN6oiGE
AGAIN I am grateful for this forum. It has helped me many times.
Greg
I've been using pull downs on both the do, load and clock lines on all my (propellerbased) 7219-projects. The oldes project, been on the run 6 years 24/7, with eight digits, has faced no more then two issues, both times freezing the displays with all segments lit.
All three lines are propeller volts (3.3V) and pulldowns are 10k.
https://www.youtube.com/watch?v=IWoQFLMCKSs
https://www.youtube.com/watch?v=uUPdQIpoCEU
https://www.youtube.com/watch?v=8HzIgoaJ7pA
My project is to build two 1/6 scale Gas/Electric Locomotive that will operate on the Los Angeles Live Steamers railroad system. This is a 7.5" gauge train system and we have quite a bit of track located at Griffith Park in Southern California.
There is a Briggs and Stratton V-Twin (16 hp) engine with hobby servos on the throttle and choke that turns a 10KW alternator. The alternator feeds a bridge rectifier and then a few relays for forward/reverse/etc. I have a total of 4ea, 2HP high voltage DC Electric traction motors.
Trucks were laser cut and use a combination of chain and belt drive. There are 6 wheels on each truck approx 5" in diameter. With two locomotives, I have 24 traction wheels. Plenty of pulling power.
The basic idea is that the Alternator doesn't generate any electricity when at idle. As you start to speed up the alternator (by operating the throttle hobby servo) you slowly begin to generate electricity. The rest of the speed control is done by using the engine throttle. Careful selection of the gear ratio and I have a nicely operating Locomotive that will run at speeds up to 12 MPH. THATS WAY FASTER THAN IS SAVE ON 7.5" RAILROAD. We usually limit our speed to about 6 MPH.
I am using 4 Shinn Fu DC Treadmill motors. Running in pairs, there are two motors per engine (remember this is a two engine consist) each pair operates off of one of the 120VAC outlets on the alternator. Basically, half the alternator runs one engine and the other half runs the other engine. The result is a smooth accelerating locomotive with quite a bit of pulling power and plenty of speed.
HERE IS WHERE PARALLAX COMES IN.
The entire control system is operated with several Basic Stamp modules. I primarily use the BS2P 24.because of its operational speed.
Here is a little rundown of the processor usage:
1ea. BS2P on my "riding car" looks at my control panel where I have various switches and pots. Rev/Stop/Fwd along with High/Low Range. Emergency stop (the big red button, a Horn along with the throttle and brake controls. The result of the control panel feed a high speed serial bus that is available between all the cars on my train.
1ea. BS2P is on the engine receives the serial bus and performs housekeeping functions on the engine. There are power relays for Forward/Reverse, etc. There are relays to turn on the horn, lights, start the engine, etc. There are two servo controllers that operate the Throttle and Choke (the choke was a bit of overkill but still fun). There is also the master air brake controller. All of these signals are carried on a high speed serial bus of my own protocol from the control panel to the engine.
1ea. BS2P I call the Monitor. It samples pulses from the chain drive and feeds the serial bus with speed data so I can monitor the MPH of the train. The monitor also measures RPM of the motor, air pressurefor the brake system and two AC Current sensors, one on each half of the Alternator. This gives me 2 separate current readouts of the front and rear Locomotive. All these signals are sent on my high speed 38.4K baud RS-232 signal bus that can be read anywhere on my train.
2ea BS2P Back at my control panel shows me various status of the system. There are actually two MAX7219 devices on the control panel, each with its own STAMP decoding the data from the serial bus. I use the MAX 232 receive single ended serial data at 38.4K baud. Each MAX7219 drives two 4 digit displays for a total of 4 4-digits on the control panel.
Thats the short story... I would be happy to answer any additional questions about my project. It has been going on for several years and works like champ. Of course now, I wish I had used something a little more powerful like a Propeller, but I am too deep into this now.
I would like to build a video display panel using the Propeller Backpack but I am having a hard time finding a few of them. Right now I only have one. I need at least one for the train (would rather have two) and I need one for my development system at home. If anyone knows where I can find a few more, I would love to hear about it.
Cheers!
Greg
If you just want to use the Backpack as a video output you could easily get by with a Propeller Project Board and a few resistors.
The Propeller Backpack has circuitry to do video overlay but if you don't need to overlay the output on top of other video, then any Propeller board should work as a video slave.
For the price of a Propeller Backpack, I'd wire up a video output and serial input to one of my small Propeller boards.
I have a question, is this railroad made for people who is visiting Griffit park, a railroad they can ride on? I understand you sit on the locomotive while shooting those pictures.
I know, If I ever go to California, this is something I would like to take a look at, besides the Parallax HQ.
Indeed this is my hobby and my passion. I do work in technology but not doing this stuff. This is just what makes me happy.
I keep my trains, along with dozens of others, at Los Angeles Live Steamers.
http://www.lals.org
We are open to the public almost every Sunday from 11A to 3P. Members give the public rides for a small donation, $5 I think. Most all of the trains there are owned by members. We have Steam Locomotives, Gas/Hydraulic Locomotives, All Electric (battery) Locomotives and then mine. Mine is Gas/Electric and other than another guy I met on the Internet, its the only one I know of.
We love visitors.
Greg
Problems solved.
Greg