Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 7th October 2008, 12:48 PM   #91
Default

There's only 8 bits for this pattern because the inside/center Led is never on basically im just trying to cycle though the outside LED's one at a time on each layer so let me try to explain it better hence the rotation of the string of bits so I only need to have 4-10 lines of code per layer instead of writing the lines for each led to be turned on does this make any sense at all ? I need the rrf to move it so its like this as well there is too examples I used to try to explain it below only one led is on at all times but the rrf is used to move the high bit to the right and then I need something that puts the whole string into temp for it to be shifted out ?

10000000
-moves string into temp for LED 1 to go light up
01000000
-moves string into temp for LED 2 to go light up
00100000
-moves string into temp for LED 3 to go light up
00010000
-moves string into temp for LED 4 to go light up
00001000
-moves string into temp for LED 5 to go light up
00000100
-moves string into temp for LED 6 to go light up
00000010
-moves string into temp for LED 7 to go light up
00000001
-moves string into temp for LED 8 to go light up

-start of code/int
-first led lit on top layer
-delay
-turns off
-second led lit on top layer
-delay
-turns off
-third led lit on top layer
-delay
-turns off
-forth led lit on top layer
-delay
-turns off
-fith led lit on top layer
-delay
-turns off
-sixth led lit on top layer
-delay
-turns off
-seventh led lit on top layer
-delay
-turns off
-eight led lit on top layer
-delay
-turns off
-first led lit on mid layer
-delay
-turns off
-second led lit on mid layer
-delay
-turns off
-third led lit on mid layer
-delay
-turns off
-forth led lit on mid layer
-delay
-turns off
-fith led lit on mid layer
-delay
-turns off
-sixth led lit on mid layer
-delay
-turns off
-seventh led lit on mid layer
-delay
-turns off
-eight led lit on mid layer
Darkstar64 is offline  
Old 7th October 2008, 01:10 PM   #92
Default

If you are just trying to cycle the LEDs in a layer, why not clock out a one and latch it to light the first LED. After the delay clock out a zero shifting the one in the shift register. Then latch, delay and repeat until the one has been shifted out of the shift register.

OK, I see this won't work if you've cascaded shift registers to get 12 bits of output.

Last edited by skyhawk; 7th October 2008 at 01:14 PM.
skyhawk is online now  
Old 7th October 2008, 03:44 PM   #93
Default

Quote:
Originally Posted by Darkstar64 View Post
There's only 8 bits for this pattern because the inside/center Led is never on basically im just trying to cycle though the outside LED's one at a time on each layer so let me try to explain it better hence the rotation of the string of bits so I only need to have 4-10 lines of code per layer instead of writing the lines for each led to be turned on does this make any sense at all ? I need the rrf to move it so its like this as well there is too examples I used to try to explain it below only one led is on at all times but the rrf is used to move the high bit to the right and then I need something that puts the whole string into temp for it to be shifted out?
OK, now I get what you were ranting about! What you want to do is do your RRF, then check the carry and change the high bit of the byte you RRFed to match ("move" the bit from the carry to the byte), then get the byte in W (movf rot,w) and store it in temp (movwf temp). Simple.

Quote:
and then I need something that puts the whole string into temp for it to be shifted out?
Once again, a byte is NOT a string. It's a byte.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 8th October 2008, 02:14 PM   #94
Default

whats a good Shift Register where i can control a MINIMUM of 35 LED's? Today is shopping day lol

EDIT:

Alsot I need another shift register with a minimum of 9 outputs. Any Thoughts?

Last edited by AtomSoft; 8th October 2008 at 02:38 PM.
AtomSoft is online now  
Old 8th October 2008, 03:29 PM   #95
Default

Quote:
Originally Posted by AtomSoft View Post
whats a good Shift Register where i can control a MINIMUM of 35 LED's? Today is shopping day lol
Micrel MM5451YN

Quote:
Also I need another shift register with a minimum of 9 outputs. Any Thoughts?
HEF4894B by NXP. It's a 12-stage open drain chip.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================

Last edited by futz; 8th October 2008 at 03:32 PM.
futz is offline  
Old 8th October 2008, 04:26 PM   #96
Default

thanks futz. Ill be sure to add them to the list.
AtomSoft is online now  
Old 13th October 2008, 01:03 AM   #97
Default

Im a little confused what I think your getting at is first RRF, then test the carry flag, then move the bit in the carry flag to w, then move w too temp ? something like that im a little confused about getting the byte from w and what not ? But other then this I have a few pattern's working right now im soon going to go to the 4x4x4 Cube in hopes of going bigger after that and probably upgrading the PIC

Last edited by Darkstar64; 13th October 2008 at 01:05 AM.
Darkstar64 is offline  
Old 13th October 2008, 02:24 AM   #98
Default

im going to try a 4x4x4 in about a week and a month after that ill try a 8x8x8. Thats 512 LEDs. Thats gonna be fun. Maybe (MAYBE) ill try a 16x16x16 or just make a large table top design to go under my table and a clear glass over it and have a moving table but if i do ill be sure to use multiple (2-RB or 3-RGB) color leds. for a table it would be so nice with PWM control so i can control dimness.
AtomSoft is online now  
Old 13th October 2008, 02:27 AM   #99
Default

Nice I was going to do the same thing with the table but use some cheap bright red LED's with some motion sensor's/light sensor's to detect when something is placed on the table then light the led's under it something like that but I still need to understand what fuz is talking about haha
Darkstar64 is offline  
Old 13th October 2008, 12:07 PM   #100
Default

lol its funny i was going to use a blocked off light sensor like a photo resistor to determine if something is on the table. . The thing is i was goingg to make it look like a ball was bouncing around the table and when ever a object (light is blocked) it wil bounce off that surface.
AtomSoft is online now  
Old 14th October 2008, 05:05 AM   #101
Default

Quote:
Originally Posted by Darkstar64 View Post
I'm a little confused.

What I think your getting at is first RRF, then test the carry flag, then move the bit in the carry flag to W, then move W to temp? Something like that.
Not "something like that". Almost exactly like that! Don't actually move the bit in the carry. Just test it and change the high bit to match.

Quote:
I'm a little confused about getting the byte from W and what not?
Why? Seems pretty straightforward.

Quote:
But other then this I have a few pattern's working right now. I'm soon going to go to the 4x4x4 Cube in hopes of going bigger after that and probably upgrading the PIC
I have a much nicer pattern working now and need to get it posted on my site, but the site has been hacked. Anybody going there should be a bit careful to do a spyware check after visiting. I don't think it's doing anything terribly dangerous or destructive, but be careful anyway.

I'm going to do a full upgrade to the latest Joomla (supposedly much more secure), but it's a ton of work, so I've been putting it off...
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Reply

Tags
pic, registers, shift, working

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
16 bit serial in parallel out shift registers forder Electronic Projects Design/Ideas/Reviews 14 2nd March 2009 09:17 AM
Cascading Shift Registers Help Suraj143 Electronic Projects Design/Ideas/Reviews 13 5th June 2008 08:33 AM
Load shift-registers via SPI? Mike, K8LH Micro Controllers 14 14th February 2008 03:00 AM
Help loading shift registers... jrz126 Micro Controllers 0 14th November 2005 01:13 PM
shift registers jrz126 Electronic Projects Design/Ideas/Reviews 8 25th September 2004 02:35 AM



All times are GMT. The time now is 01:17 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker