Notifications
Clear all

An intro to the 74HC595...

9 Posts
3 Users
2 Likes
1,190 Views
itsCaseyDambit
(@itscaseydambit)
Member
Joined: 4 years ago
Posts: 40
Topic starter  

Ok, my fellow Arduinovians, here's the story. I only became aware of Arduino in early January of 2020 (please don't walk away), and after my introduction to the 74HC595 bit shifter, I had to know what made that little devil tick inside.

Attached is the code I wrote, which is no big thing, BUT, what I'd appreciate is, if there is anyone out there who well knows the 74HC595, please look over the preamble to the code and let me know if I got anything wrong or how I might better express my point.

It's a bit lengthy, granted. My intent was to help those new to bit shifting, and to show that what's ticking inside the 74HC isn't all that difficult to understand, once you put your mind into 0s and 1s.

Muchos thanks!

 


   
Quote
itsCaseyDambit
(@itscaseydambit)
Member
Joined: 4 years ago
Posts: 40
Topic starter  

Just when you think you've got it right...

Me thinks on line 216 of the code, it should be:

    *buf_p = pgm_read_byte_near(

not 

    *buf_p = pgm_read_word_near(

Monumental OOOPS!

But, the code still works (I think), it's just reading more than it should from that address. I guess I'll throw the prototype back together again and test some more to make sure. 


   
ReplyQuote
itsCaseyDambit
(@itscaseydambit)
Member
Joined: 4 years ago
Posts: 40
Topic starter  

EGADS! Yes, the *buf_p = pgm_read_byte_near() was the correct function call to use, and I'm trying to remember when that got changed (and not returned back to its original state) because the project was always intended to have a  data definition of one byte and not a word (two bytes).

But, the LEDs are not sequencing the way I had planned and something is foul, afoot. And this is where one may find just how valuable the DroneBot Workshop community may indeed be.

I'm going to setup the sketch for troubleshooting so I can better show the situation, and return with my problem.

Meanwhile...


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
 

@itscaseydambit

Hi Casey.  I thought I should chime in just to let you know that someone read your post.  I downloaded your sketch, and I even opened it in the Arduino IDE briefly just to take a quick peak at it.  Unfortunately I'm quite busy lately and I'm not currently working with 74HC595.   I have used them before on several projects so I'm already familiar with how they work.   In any case, I didn't check out your code yet at all.   But I saved it to my digital chips folder and the next time I'm working with the 74HC595 I'll give it another peek then.

In the meantime, I thought I'd just post a quick reply here so you don't think you're being ignored. 😊 

Just busy with other things right now is all. 😎 

With the nice spring weather I've been playing myself out doing gardening work.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@robo-pi

Posted by: @robo-pi

Hi Casey.

LOL... No, it's Don Knotts 🙂

 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@itscaseydambit

What about: "pgm_read_ptr_near" ?

 


   
ReplyQuote
itsCaseyDambit
(@itscaseydambit)
Member
Joined: 4 years ago
Posts: 40
Topic starter  

@frogandtoad

pgm_read_byte_near is all it needs. 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@itscaseydambit

Posted by: @itscaseydambit

I'm going to setup the sketch for troubleshooting so I can better show the situation, and return with my problem.

Meanwhile...

Posted by: @frogandtoad

@itscaseydambit

What about: "pgm_read_ptr_near" ?

Posted by: @itscaseydambit

@frogandtoad

pgm_read_byte_near is all it needs. 

No problem... you never actually provided us with a solution to your problem, so I thought I would post an alternative suggestion.  So what exactly was the problem in the end?

 


   
ReplyQuote
itsCaseyDambit
(@itscaseydambit)
Member
Joined: 4 years ago
Posts: 40
Topic starter  

@frogandtoad

we bought a new house and have been moving the last week or so. Furniture goes on Monday, so, haven't had much time to play.

time to set up a new shop.


   
ReplyQuote