Jump to content
43oh

MSP430 LaunchPad, 74HC595, Four 7 Segment Displays


Recommended Posts

I'll assume you need some rest (grin), and I apologize if I made you feel a little defensive. That was not my intention Sir.

 

Hopefully, someone gleaned some insight into the use of a switch state latch and parallel switch state logic (a worthy subject by itself).

 

Take care. Have fun.

 

Cheerful regards, Mike McLaren, K8LH

Link to post
Share on other sites

No you didn't. Constructive critique is always a good thing, that's how we learn. I would probably reuse that piece over and over and then I would be surprised why stuff doesn't work. And I would assume that my code is fine. That's why we should have peer reviews.

 

73

 

Rob

Link to post
Share on other sites

Well Rob, there's still a couple things wrong with that section. Then there's your misconceptions about debouncing (grin). But how about if we save those discussions for another day? I don't want to wear out my welcome (lol)...

 

Vy 73, Mike, K8LH

Link to post
Share on other sites

Ha, ha, yeah, I really need the rest, or test my changes before posting.

Since switchReady is int, we need to either change it (and the switchStatus) to char

unsigned char switchReady = 0;            // when BITn is 0, means switch is unstable H->L or L->H
unsigned char switchStatus = 0;            // pressed or released

or change if statement

if(switchReady == 0xFFFF)

As I wrote before, I had that code in another project where I used 16 switches and full USISR register (hence int) but in my if statement I only needed few of them tested.

 

Not sure what you mean by misconceptions about de-bouncing though. Again, as I wrote before, this is just an example of how it could be done. Someone might have a requirement to scan every 5ms, or use switches that have long bounce time, or that all switches must be in sync. I wish I had more time to elaborate and make some drawings, but I think we can leave it at that. Is it perfect, no, is it needed for this particular example, probably not, it can be removed.

Link to post
Share on other sites
  • 1 year later...
  • 4 weeks later...

The 74595 shift registers can be replaced by a single chip max 7221. It can drive up to 8 seven segments and uses SPI to communicate to msp430. It saves quite a few I/o pins. Price wise, it's about the same price too ( even cheaper, if we buy from china. I just put an order to purchase 10 pcs of the chip for total of $6 including shipping)

Link to post
Share on other sites
  • 8 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...