![]() | ![]() | ![]() |
| | #31 | ||
| Quote:
Quote:
I'm not sure how you do a computed GOTO, but I do it by doing arithmetic on PCL to select the GOTO in a table of GOTOs, since that modifies PCL then the table of GOTOs must be in the first 256 words of each page. In that case I have used space in that area for GOTO's rather than data tables. I don't see the gain. Using GOTO's will allow one to move the body of a subroutine out of the top half of the page as long as the entry point is there. My point was/is that one can do tricks to get around the limitations of baseline PICs, but that is something that is probably beyond the skills/understanding of a beginner. Mike you are most geneous with the help you give beginners here on the forum. Last edited by skyhawk; 8th September 2008 at 06:26 PM. | |||
| |
| | #32 |
|
Sorry Skyhawk, I didn't see your earlier post and was responding to your post immediately above mine. You are also correct on the computed gotos, I didn't realise the call bug also effected writes to PCL. Mike. | |
| |
| | #33 |
|
Well Mr. Darkstar, I got myself a couple 12F509's and some HEF4894B 12-stage shift registers in my Digikey order today. We shall see how well this crappy little chip can drive a 3x3x3 LED cube. ![]() The 12F509 took me some time to get used to. Took me an hour or two to figure out the chip's strange quirks and get an LED flashing on GPIO2. Now that I have the chip's oddities figured out I can move on. What a bare-bones chip! My blinky prog: Code: include "P12F509.INC" __config _IntRC_OSC & _WDT_OFF & _MCLRE_ON cblock 0x07 d1,d2 endc org 0x000 init movlw b'11001000' ;clear T0CS for output on GPIO2 option movlw b'001000' ;set pins to all outs tris GPIO clrf GPIO ;zero all pins main bsf GPIO,2 call delay bcf GPIO,2 call delay goto main delay movlw 0x3e ;0.2 second delay movwf d1 movlw 0x50 movwf d2 delay_0 decfsz d1, f goto del1 decfsz d2, f del1 goto delay_0 retlw 0 end
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 11th September 2008 at 04:55 AM. | |
| |
| | #34 | |
| Quote:
I can only use 3x3x3 of it with the 12F509 due to too few pins (509 has 5 outs). Need 2 pins to control the shift register and 3 for the anodes. Hmm... I guess I could add another shift register to control the anodes and would only need 4 output pins that way... And I could go to a 8x8x8 cube! (I'd probably run out of memory on this tiny chip though.)
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 11th September 2008 at 06:29 AM. | ||
| |
| | #35 |
|
Why not just cascade two (or more) shift registers. Mike. | |
| |
| | #36 |
| That had crossed my mind too. You're talking about controlling cathodes and anodes off a couple or three cascaded shift registers, right?
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 11th September 2008 at 06:33 AM. | |
| |
| | #37 |
|
Yes, you could drive the anodes via high side PNPs. So 4*4 is 16 cathodes plus 4 anodes can fit on two 12 bit shift registers. Mike. | |
| |
| | #38 | |
| Quote:
It shall be done! Might have to solder together a control board. It gets very hectic wiring that much stuff on a breadboard. I'll just socket the PIC so I can replace it with a 12F683 later when I run out of space (and patience) with the 12F509. No interrupts! Ridiculous!
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #39 |
|
I think you'll find the 2 level deep stack to be very constricting. And you'll miss things like addlw. ![]() Mike. | |
| |
| | #40 | |
| Quote:
In the distant past you had no choice if you wanted a tiny PIC, but for many years now you have been able to get 14 bit PIC's in 8 pin packages, even including A2D. | ||
| |
| | #41 | |
| Quote:
I understand (kinda) how to do a high side PNP switch, but what transistor can switch 320mA (16 LEDs @ 20mA)? Or should I be looking at MOSFET's or maybe Darlington arrays?
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 13th September 2008 at 07:14 AM. | ||
| |
| | #42 | |
| Quote:
Try a BC327 at 800mA. | ||
| |
| | #43 | |
| Quote:
PN2907A (PNP, Fairchild, 800 ma), TO-92 or SOT23 FDN304PZ (P-FET, Fairchild, 2.4a, Rds(on) = 0.052 ohms), SOT23 MIC2981 (eight 500 ma high side sourcing drivers), PDIP or SOIC Last edited by Mike, K8LH; 13th September 2008 at 11:55 AM. | ||
| |
| | #44 |
|
Thanks Nigel and Mike. All I have in stock is 2N3906. Guess I'll cook up another order and get some more parts.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |
| |
| | #45 |
|
Ha! Better yet, I had a look at one of the MM5451YN chips I recently bought just to see what they were about. Perfect! It's a 35-bit shift register with open-drain drivers for LEDs. Send a 1 as your first bit of 36 and it auto-latches when all 36 bits have been clocked in - so it only needs 2 pins, clock and data. Reasonable price too.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |
| |
|
| 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 |