Jump to content
43oh

EngIP

Members
  • Content Count

    120
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Like
    EngIP got a reaction from jsolarski in POV with G2211 and little else   
    Just a little update with this "project".
     
    I put the circuit on stripboard, a bit easier than frantically swinging a breadboard about in my efforts to impress the wife.
     

     
    A few attempts at more than a pretty green face...
     

     
    An attempt at mixing inverse and regular text...Not great
     

     
    About the best picture I managed to get...
     

  2. Like
    EngIP got a reaction from zeke in POV with G2211 and little else   
    Just a little update with this "project".
     
    I put the circuit on stripboard, a bit easier than frantically swinging a breadboard about in my efforts to impress the wife.
     

     
    A few attempts at more than a pretty green face...
     

     
    An attempt at mixing inverse and regular text...Not great
     

     
    About the best picture I managed to get...
     

  3. Like
    EngIP reacted to gordon in What's the big idea with Linux?   
    Because it is there on the majority of (at least a certain class of) embedded devices and systems. If you scale up from micros to bigger SOCs (which you probably will, eventually), the encounter will be unavoidable. Best get ahead of it.
     
    For me it's about as natural as (I'm guessing) Windows is to you. After the obligatory 8bit home computers and DOS I started using Linux. From my POV the question really is, why would anyone not use Linux? . Kidding, though. It's probably (likely) still quite a horrible (desktop) experience if you expect things to Just Work (disclaimer: I'm saying this with a little over 15 years of systems operations under my belt; I do know my way around), but at the same time this statement is quite biased: I have reasonably concrete ideas of how my (desktop) systems should look, smell and behave. This apparently contradicts about 110% of the current mainstream trends, so I tend to be grumpy about it (and at the same time I am shamelessly enjoying the exact same look and feel of my desktop for the last ~10 years).
     
    It completely doesn't matter on what system you learn. ISO C is ISO C on Windows, on Linux, and everywhere else. POSIX is the same everywhere. Platform-specific things exist everywhere, so there's no escape anyway. Trying to write truly portable code will greatly extend your swearing vocabulary.
     
    Start with Cygwin. It will give you most everything you would have on Linux for the getting familiar/doing programming aspect, without having to leave the comfort of the environment you got used to.
     
    Let it be on record that by replying to this, I am in no way, shape or form to be considered an "expert in C".
  4. Like
    EngIP got a reaction from bluehash in POV with G2211 and little else   
    Just a little update with this "project".
     
    I put the circuit on stripboard, a bit easier than frantically swinging a breadboard about in my efforts to impress the wife.
     

     
    A few attempts at more than a pretty green face...
     

     
    An attempt at mixing inverse and regular text...Not great
     

     
    About the best picture I managed to get...
     

  5. Like
    EngIP reacted to oPossum in LED matrix weird glitch   
    It has 2 I/O on port 2. Pins 12 and 13.

  6. Like
    EngIP reacted to zeke in Are the ValueLine chip outputs current limited?   
    Yeah, I smoked a port pin on a g2231 recently when I tried to make it pull down a 5V line - active low style.
     
    It wasn't happy. It got real hot. I had to replace it then redesign the circuit.
     
    If you try to pull a pin above 4.3V then the protection diode will get damaged. That's 3.6V + 0.7V for reference.
  7. Like
    EngIP reacted to cde in Are the ValueLine chip outputs current limited?   
    Current is practically limited by it's voltage drop. At 6ma (Per pin, 48ma per port), the valueline chips drop 0.3v. Too much current draw, and the voltage drops enough to make the pin useless.
     
    Current is not physically limited by the chip. Always use resistors.
  8. Like
    EngIP reacted to NatureTM in Are the ValueLine chip outputs current limited?   
    The other day I was driving some transistors, and I forgot to put a resistor between the base of the transistor and the MSP430 pin -- effectively a short. It took awhile, but I ended up frying the port. I could run and upload code and stop at breakpoints, but toggling pins didn't have an effect on the output. When I realized my mistake, I touched the MSP and it was pretty warm.
     
    I don't know if this really answers your question, but it seemed worth mentioning.
  9. Like
    EngIP got a reaction from jsolarski in How to program a Matrix   
    First off, I'd like to point out that I'm very much a noob. Bearing this in mind, please check everything I say against a reliable source.
     
    I don't know how much you understand about multiplexing etc. so I'll start from the beginning.
     
    A matrix consists of rows of LED's. Each row has all of the annodes (positive) or cathodes (negative) connected together. Each individual LED on the row has it's other leg connected to the same leg on all LED's in that column. So in your example, there are 4 rows and 6 columns. For the sake of argument let's say the row's have all of their annodes connected together, and all of the cathodes connected together on the columns. You're using a 10 x GPIO chip, so you can connect your rows to output pins 0-3, and your columns to 4-9.
     
    Now, you want to make row 1, column 1 illuminate. Row 1 has it's annode connected to output 0, column 1 has it's cathode connected to output 3. So to illuminate R1C1, you need output 0 to be 'ON', to put +V dc on the annode, and you need output 3 to be off, to put the cathode at 0v dc. However, because all of the LED's on the row share the same annode, you need to make the cathodes of LED's you DON'T want to switch on high.
     
    Look at it like this - you select which ROW to illuminate by turning the appropriate output to that ROW high. You select which COLUMN to illuminate by turning the appropriate output to that COLUMN low (on a common annode display).
     
    So now you know how to illuminate an individual LED, how do you create "images"? There are two ways, and it really depends on the hardware capabilities of your particular set-up.
     
    If you can supply enough current to drive all of the LED's in one row from the one pin, then you could write to your row once, setting the columns you want to be lit all in one go. For example, set row 1 high (and all other rows low), and set columns 2,3,4 and 5 low(with columns 1 and 6 high), and you'll have OFF,ON,ON,ON,ON,OFF on the top row of your matrix.
     
    If you can't drive enough power to the rows through one pin, you can illuminate each LED individually. To achieve the same display as mentioned above (OFF, ON, ON, ON, ON, OFF on Row 1), you would have to write to the row 3 times, setting each required column low in turn (and the other columns high).
     
    As for the code - that really depends on what you're trying to achieve. What might be the best approach for one outcome wouldn't necessarily be the best approach for another. Because of this, and because you'r hardware set-up is unknown, it's really down to you. But if you get something wired together, and have a go, I and others would be more than happy to help you fix your code.
     
    I hope this has cleared things up a little for you, but if not feel free to keep asking questions. Just don't expect anyone to do the work for you - it's hard enough to get motivated to work on our own projects, never mind anyone else's
  10. Like
    EngIP reacted to bluehash in POV with G2211 and little else   
    EngIp, if you need some parts, let us know. I can look for some in my parts box.
  11. Like
    EngIP got a reaction from Fe2o3Fish in POV with G2211 and little else   
    Something I was messing about with today - I'm quite pleased with the results
     


     
    I suppose the next step would be to put it on a PCB and stick it to the fan in the conservatory, but I can see timing it in being a pain in the neck.
     
    Code:

    #include //This is the header file for your chip. void delay(unsigned int delayTime); void main(void) { WDTCTL = WDTPW + WDTHOLD; //Hold the WDT (WatchDog Timer) P1DIR = 0xff; //Set Port 1 (P1) to output. unsigned int i=250; //This is the delay value between each column (found by trial and error) while(1){ P1OUT = 0x00; delay(i); P1OUT = 0x7C; //Mr GreenFace's first column. delay(i); //The delay P1OUT = 0x82; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0xA1; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0x82; delay(i); P1OUT = 0x7C; //Mr GreenFace's last column. delay(i); P1OUT = 0x00; delay(i); } } void delay(unsigned int delayTime){ int x; for (x=0;x x=x*1; } }
  12. Like
    EngIP got a reaction from bluehash in [ ENDED ] June 2011 - 43oh Project of the Month Contest   
    I'll open the competition (and set the bar low enough to encourage others) with my latest creation - Persistence of vision on a diet. Essentially just a proof of concept for me to waste a few hours on, but the results were good enough to put a satisfied smile on my face. It uses 8 LEDs and 1 resistor in conjunction with an MSP430G2211, and the code just switches columns after a pre-set delay. The keen eyed out there might spot the lack of a resistor in series with the LEDs - I'm relying on the current limited outputs of the uC to prevent any excess current/heat/smoke/fire and it seems to work.
     
    EDIT: I'm "getting away with it" but the outputs aren't current limited, and should have a resistor in series.
     
    Enough babble, the circuit in all it's glory.
     

     
    The code.

    #include //This is the header file for your chip. void delay(unsigned int delayTime); void main(void) { WDTCTL = WDTPW + WDTHOLD; //Hold the WDT (WatchDog Timer) P1DIR = 0xff; //Set Port 1 (P1) to output. unsigned int i=250; //This is the delay value between each column (found by trial and error) while(1){ P1OUT = 0x00; delay(i); P1OUT = 0x7C; //Mr GreenFace's first column. delay(i); //The delay P1OUT = 0x82; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0xA1; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0x82; delay(i); P1OUT = 0x7C; //Mr GreenFace's last column. delay(i); P1OUT = 0x00; delay(i); } } void delay(unsigned int delayTime){ int x; for (x=0;x x=x*1; } }
     
    The (very dodgy) schematic is attached.
     
    Video of the project in action.
     


     
    The circuit on stripboard.
     

     
    First text effort.
     

     
    An attempt at mixing inverse and regular text...Not great
     

     
    About the best picture I managed to get...
     


  13. Like
    EngIP got a reaction from bluehash in POV with G2211 and little else   
    Something I was messing about with today - I'm quite pleased with the results
     


     
    I suppose the next step would be to put it on a PCB and stick it to the fan in the conservatory, but I can see timing it in being a pain in the neck.
     
    Code:

    #include //This is the header file for your chip. void delay(unsigned int delayTime); void main(void) { WDTCTL = WDTPW + WDTHOLD; //Hold the WDT (WatchDog Timer) P1DIR = 0xff; //Set Port 1 (P1) to output. unsigned int i=250; //This is the delay value between each column (found by trial and error) while(1){ P1OUT = 0x00; delay(i); P1OUT = 0x7C; //Mr GreenFace's first column. delay(i); //The delay P1OUT = 0x82; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0xA1; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0x82; delay(i); P1OUT = 0x7C; //Mr GreenFace's last column. delay(i); P1OUT = 0x00; delay(i); } } void delay(unsigned int delayTime){ int x; for (x=0;x x=x*1; } }
  14. Like
    EngIP got a reaction from NatureTM in POV with G2211 and little else   
    Something I was messing about with today - I'm quite pleased with the results
     


     
    I suppose the next step would be to put it on a PCB and stick it to the fan in the conservatory, but I can see timing it in being a pain in the neck.
     
    Code:

    #include //This is the header file for your chip. void delay(unsigned int delayTime); void main(void) { WDTCTL = WDTPW + WDTHOLD; //Hold the WDT (WatchDog Timer) P1DIR = 0xff; //Set Port 1 (P1) to output. unsigned int i=250; //This is the delay value between each column (found by trial and error) while(1){ P1OUT = 0x00; delay(i); P1OUT = 0x7C; //Mr GreenFace's first column. delay(i); //The delay P1OUT = 0x82; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0xA1; delay(i); P1OUT = 0xA9; delay(i); P1OUT = 0x82; delay(i); P1OUT = 0x7C; //Mr GreenFace's last column. delay(i); P1OUT = 0x00; delay(i); } } void delay(unsigned int delayTime){ int x; for (x=0;x x=x*1; } }
  15. Like
    EngIP got a reaction from gordon in Active high input?   
    Sorry if the point of this thread has sailed over my head, but does this page explain things better?
  16. Like
    EngIP got a reaction from RobG in Active high input?   
    Sorry if the point of this thread has sailed over my head, but does this page explain things better?
  17. Like
    EngIP got a reaction from bluehash in How to program a Matrix   
    First off, I'd like to point out that I'm very much a noob. Bearing this in mind, please check everything I say against a reliable source.
     
    I don't know how much you understand about multiplexing etc. so I'll start from the beginning.
     
    A matrix consists of rows of LED's. Each row has all of the annodes (positive) or cathodes (negative) connected together. Each individual LED on the row has it's other leg connected to the same leg on all LED's in that column. So in your example, there are 4 rows and 6 columns. For the sake of argument let's say the row's have all of their annodes connected together, and all of the cathodes connected together on the columns. You're using a 10 x GPIO chip, so you can connect your rows to output pins 0-3, and your columns to 4-9.
     
    Now, you want to make row 1, column 1 illuminate. Row 1 has it's annode connected to output 0, column 1 has it's cathode connected to output 3. So to illuminate R1C1, you need output 0 to be 'ON', to put +V dc on the annode, and you need output 3 to be off, to put the cathode at 0v dc. However, because all of the LED's on the row share the same annode, you need to make the cathodes of LED's you DON'T want to switch on high.
     
    Look at it like this - you select which ROW to illuminate by turning the appropriate output to that ROW high. You select which COLUMN to illuminate by turning the appropriate output to that COLUMN low (on a common annode display).
     
    So now you know how to illuminate an individual LED, how do you create "images"? There are two ways, and it really depends on the hardware capabilities of your particular set-up.
     
    If you can supply enough current to drive all of the LED's in one row from the one pin, then you could write to your row once, setting the columns you want to be lit all in one go. For example, set row 1 high (and all other rows low), and set columns 2,3,4 and 5 low(with columns 1 and 6 high), and you'll have OFF,ON,ON,ON,ON,OFF on the top row of your matrix.
     
    If you can't drive enough power to the rows through one pin, you can illuminate each LED individually. To achieve the same display as mentioned above (OFF, ON, ON, ON, ON, OFF on Row 1), you would have to write to the row 3 times, setting each required column low in turn (and the other columns high).
     
    As for the code - that really depends on what you're trying to achieve. What might be the best approach for one outcome wouldn't necessarily be the best approach for another. Because of this, and because you'r hardware set-up is unknown, it's really down to you. But if you get something wired together, and have a go, I and others would be more than happy to help you fix your code.
     
    I hope this has cleared things up a little for you, but if not feel free to keep asking questions. Just don't expect anyone to do the work for you - it's hard enough to get motivated to work on our own projects, never mind anyone else's
  18. Like
    EngIP reacted to nexusone1984 in Scrolling text on a Dot matrix display...   
    I have a link to the source code on my youtube page. I using a ASCII 5X7 Character set I found in the internet, and because of memory limitations on the Micro that comes with the Launchpad(other MSP430's have little more memory). I had to trim it down some, also found using some standard C functions eat up to much RAM, so making some trimmed down ones or just write code to do only what you need.
     
    As someone pointed out function calls use RAM, so if you call too many you can end up running out of RAM.
    I want to write a trimmed down printf type routine, always a choice between neat looking code and code that will fit into the limited memory space.
     
     
     
  19. Like
    EngIP got a reaction from gwdeveloper in Little 5x7 LED matrix project.   
    Update, it's now doing something a little bit more useful than chasing an LED 8-)
     

    http://www.youtube.com/watch?v=WZNMLf6zzEU
     
    Here's my code.
     

    #include const unsigned char COL[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; const unsigned char ROW[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; //Letter format //make first char in array = the length of the array, //PV[n]= the nth LED in the sequence for that letter. //PV = letter 'P' 'V'ertical const unsigned char PH[14] = {13, 5, 4, 3, 5, 2, 5, 2, 5, 4, 3, 5, 5, 5}; const unsigned char PV[14] = {13, 1, 1, 1, 2,2,3,3,4,4,4,5,6,7}; const unsigned char AH[19] = {18, 4,3,2,5,1,5,1,5,4,3,2,1,5,1,5,1,5,1}; const unsigned char AV[19] = {18, 1,1,1,2,2,3,3,4,4,4,4,4,5,5,6,6,7,7}; const unsigned char MH[19] = {18, 5,1,5,4,2,1,5,3,1,5,3,1,5,1,5,1,5,1}; const unsigned char MV[19] = {18, 1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7}; const unsigned char SH[16] = {15, 4,3,2,5,1,5,4,3,2,1,5,1,4,3,2}; const unsigned char SV[16] = {15, 1,1,1,2,2,3,4,4,4,5,6,6,7,7,7}; const unsigned char FourH[14] = {13, 5,5,5,3,5,3,5,4,3,2,1,3,3}; const unsigned char FourV[14] = {13, 1,2,3,3,4,4,5,5,5,5,5,6,7}; const unsigned char ThreeH[16] = {15, 5,4,3,2,1,1,2,3,4,1,1,4,3,2,5}; const unsigned char ThreeV[16] = {15, 1,1,1,1,2,3,4,4,4,5,6,7,7,7,7}; const unsigned char ZeroH[17] = {16, 4,3,2,5,1,5,1,5,1,5,1,5,1,4,3,2}; const unsigned char ZeroV[17] = {16, 1,1,1,2,2,3,3,4,4,5,5,6,6,7,7,7}; //Serial function, adapted from wikipedia entry on bitbanging. void sendSerial(unsigned char dataGreen, unsigned char dataColumn, unsigned char dataRed); void delay(unsigned int delayTime); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Hold the WDT (WatchDog Timer) P1DIR = 0xFF; //Set Port 1 as outputs /* * p1.1 DS Serial data Red Row * p1.0 DS Serial data Column * p1.5 DS Serial data Green Row * p1.3 ST CP storage register clock input * P1.4 SH CP shift register clock */ while(1){ int x,y; int loops; loops = 2000/MV[0]; for(y=0;y for (x=(MV[0]);x>0;x--){ sendSerial(0, COL[MV[x]],ROW[MH[x]]); } } loops = 2000/SV[0]; for(y=0;y for (x=(SV[0]);x>0;x--){ sendSerial(ROW[sH[x]], COL[sV[x]],0); } } loops = 2000/PV[0]; for(y=0;y for (x=(PV[0]);x>0;x--){ sendSerial(ROW[PH[x]], COL[PV[x]], ROW[PH[x]]); } } loops = 2000/FourV[0]; for(y=0;y for (x=(FourV[0]);x>0;x--){ sendSerial(ROW[FourH[x]], COL[FourV[x]],0); } } loops = 2000/ThreeV[0]; for(y=0;y for (x=(ThreeV[0]);x>0;x--){ sendSerial(0, COL[ThreeV[x]],ROW[ThreeH[x]]); } } loops = 2000/ZeroV[0]; for(y=0;y for (x=(ZeroV[0]);x>0;x--){ sendSerial(ROW[ZeroH[x]], COL[ZeroV[x]], ROW[ZeroH[x]]); } } } } void delay(unsigned int delayTime){ int t1; for (t1=0;t1 t1=t1*1; } } void sendSerial(unsigned char dataGreen, unsigned char dataColumn, unsigned char dataRed) { int i; // send bits 7..0 for (i = 0; i < 8; i++) { // consider leftmost bit // set P1.5 (Green cathode) low if bit is 1, High if bit is 0 // set P1.1 (Red cathode) low if bit is 1, High if bit is 0 // set P1.0 (Data column) low if bit is 1, High if bit is 0 if (dataGreen & 0x80){ P1OUT &= ~BIT5; } else{ P1OUT |= BIT5; } if (dataRed & 0x80){ P1OUT &= ~BIT1; } else{ P1OUT |= BIT1; } if (dataColumn & 0x80){ P1OUT |= BIT0; } else{ P1OUT &= ~BIT0; } //Send Clk signal high to all shift registers. P1OUT |= BIT4; //Then set it low again. P1OUT ^= BIT4; //Shift all the data and cycle through 8 times. dataGreen <<= 1; dataColumn <<= 1; dataRed <<=1; } // Set storage register to update outputs of shift registers. P1OUT |= BIT3; P1OUT &= ~BIT3; }
  20. Like
    EngIP got a reaction from bluehash in Little 5x7 LED matrix project.   
    Update, it's now doing something a little bit more useful than chasing an LED 8-)
     

    http://www.youtube.com/watch?v=WZNMLf6zzEU
     
    Here's my code.
     

    #include const unsigned char COL[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; const unsigned char ROW[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; //Letter format //make first char in array = the length of the array, //PV[n]= the nth LED in the sequence for that letter. //PV = letter 'P' 'V'ertical const unsigned char PH[14] = {13, 5, 4, 3, 5, 2, 5, 2, 5, 4, 3, 5, 5, 5}; const unsigned char PV[14] = {13, 1, 1, 1, 2,2,3,3,4,4,4,5,6,7}; const unsigned char AH[19] = {18, 4,3,2,5,1,5,1,5,4,3,2,1,5,1,5,1,5,1}; const unsigned char AV[19] = {18, 1,1,1,2,2,3,3,4,4,4,4,4,5,5,6,6,7,7}; const unsigned char MH[19] = {18, 5,1,5,4,2,1,5,3,1,5,3,1,5,1,5,1,5,1}; const unsigned char MV[19] = {18, 1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7}; const unsigned char SH[16] = {15, 4,3,2,5,1,5,4,3,2,1,5,1,4,3,2}; const unsigned char SV[16] = {15, 1,1,1,2,2,3,4,4,4,5,6,6,7,7,7}; const unsigned char FourH[14] = {13, 5,5,5,3,5,3,5,4,3,2,1,3,3}; const unsigned char FourV[14] = {13, 1,2,3,3,4,4,5,5,5,5,5,6,7}; const unsigned char ThreeH[16] = {15, 5,4,3,2,1,1,2,3,4,1,1,4,3,2,5}; const unsigned char ThreeV[16] = {15, 1,1,1,1,2,3,4,4,4,5,6,7,7,7,7}; const unsigned char ZeroH[17] = {16, 4,3,2,5,1,5,1,5,1,5,1,5,1,4,3,2}; const unsigned char ZeroV[17] = {16, 1,1,1,2,2,3,3,4,4,5,5,6,6,7,7,7}; //Serial function, adapted from wikipedia entry on bitbanging. void sendSerial(unsigned char dataGreen, unsigned char dataColumn, unsigned char dataRed); void delay(unsigned int delayTime); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Hold the WDT (WatchDog Timer) P1DIR = 0xFF; //Set Port 1 as outputs /* * p1.1 DS Serial data Red Row * p1.0 DS Serial data Column * p1.5 DS Serial data Green Row * p1.3 ST CP storage register clock input * P1.4 SH CP shift register clock */ while(1){ int x,y; int loops; loops = 2000/MV[0]; for(y=0;y for (x=(MV[0]);x>0;x--){ sendSerial(0, COL[MV[x]],ROW[MH[x]]); } } loops = 2000/SV[0]; for(y=0;y for (x=(SV[0]);x>0;x--){ sendSerial(ROW[sH[x]], COL[sV[x]],0); } } loops = 2000/PV[0]; for(y=0;y for (x=(PV[0]);x>0;x--){ sendSerial(ROW[PH[x]], COL[PV[x]], ROW[PH[x]]); } } loops = 2000/FourV[0]; for(y=0;y for (x=(FourV[0]);x>0;x--){ sendSerial(ROW[FourH[x]], COL[FourV[x]],0); } } loops = 2000/ThreeV[0]; for(y=0;y for (x=(ThreeV[0]);x>0;x--){ sendSerial(0, COL[ThreeV[x]],ROW[ThreeH[x]]); } } loops = 2000/ZeroV[0]; for(y=0;y for (x=(ZeroV[0]);x>0;x--){ sendSerial(ROW[ZeroH[x]], COL[ZeroV[x]], ROW[ZeroH[x]]); } } } } void delay(unsigned int delayTime){ int t1; for (t1=0;t1 t1=t1*1; } } void sendSerial(unsigned char dataGreen, unsigned char dataColumn, unsigned char dataRed) { int i; // send bits 7..0 for (i = 0; i < 8; i++) { // consider leftmost bit // set P1.5 (Green cathode) low if bit is 1, High if bit is 0 // set P1.1 (Red cathode) low if bit is 1, High if bit is 0 // set P1.0 (Data column) low if bit is 1, High if bit is 0 if (dataGreen & 0x80){ P1OUT &= ~BIT5; } else{ P1OUT |= BIT5; } if (dataRed & 0x80){ P1OUT &= ~BIT1; } else{ P1OUT |= BIT1; } if (dataColumn & 0x80){ P1OUT |= BIT0; } else{ P1OUT &= ~BIT0; } //Send Clk signal high to all shift registers. P1OUT |= BIT4; //Then set it low again. P1OUT ^= BIT4; //Shift all the data and cycle through 8 times. dataGreen <<= 1; dataColumn <<= 1; dataRed <<=1; } // Set storage register to update outputs of shift registers. P1OUT |= BIT3; P1OUT &= ~BIT3; }
  21. Like
    EngIP got a reaction from bluehash in Little 5x7 LED matrix project.   
    Here's my current progress on an LED matrix display. I'm using 4 outputs to control 35 LED's, which was the point of the whole exercise.
     
    I've used 2 x 74HC595s, with the reset tied high and the Output Enabled tied low. I've tied the clocks together to reduce the number of outputs used, and used two pins for the data outputs to the shift registers.
     
    Mostly done with trial and error (I've since found the 74HC595 isn't suitable for driving multiple LED's - but it can cope with individual ones). The code is below, and not the greatest, but it works! I'm just using an 8x8 output to the shift registers, but I'm sure it could be optimised for 7x5.
     
    I'm going to add another shift register and make a little game of it later, but I'm happy with it for now.
     
    Any comments/criticism welcomed, but be gentle, it's my first MCU project. Actually, it's my first ever project.
     

    http://www.youtube.com/watch?v=RLsNdYr09qU
     

    #include unsigned char COL[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; unsigned char ROW[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; //Does this below need declaring seperately to when it is declared by the function below? int delayTime; void delay(int delayTime); //Serial function, adapted from wikipedia entry on bitbanging. void sendSerial(unsigned char dataGreen, unsigned char dataColumn); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Hold the WDT (WatchDog Timer) P1DIR = 0xFF; //Set Port 1 as outputs /* * p1.1 DS Serial data Row * p1.0 DS Serial data Column * p1.3 ST CP storage register clock input * P1.4 SH CP shift register clock */ while(1){ int x, y; unsigned char z=0x02; // for (x=1;x<8;x++){ for(y=1;y<6;y++){ sendSerial(z, COL[x]); z <<= 1; delay(10000); } z=0x02; } } } void delay(int delayTime){ int t1; for (t1=0;t1 t1=t1*1; } } //The following function is the code from the wikipedia entry on BitBanging, adapted for my specific application. void sendSerial(unsigned char dataGreen, unsigned char dataColumn) { int i; // send bits 7..0 for (i = 0; i < 8; i++) { // consider leftmost bit // set line low if bit is 1, High if bit is 0 if (dataGreen & 0x80){ P1OUT &= ~BIT1; } else{ P1OUT |= BIT1; } if (dataColumn & 0x80){ P1OUT |= BIT0; } else{ P1OUT &= ~BIT0; } delay(2); // pulse clock to indicate that bit value should be read P1OUT |= BIT4; delay(2); P1OUT ^= BIT4; // shift byte left so next bit will be leftmost dataGreen <<= 1; dataColumn <<= 1; } // Set storage register. P1OUT |= BIT3; delay(2); P1OUT &= ~BIT3; }
  22. Like
    EngIP reacted to gwdeveloper in Lost my dongle( USB RF access point )...   
    It's the same price as a new chrono but you get much better access to the hardware this way...
     
    http://focus.ti.com/docs/toolsw/folders ... 8-915.html
     
    It's what was used to create the door security hack with a chronos.
  23. Like
    EngIP reacted to bluehash in Lost my dongle( USB RF access point )...   
    Could not find a link for you on the TI site.
     
    Your best hope is call TI support and ask if they can ship you a replacement. You can also try the Buy/Trade/Sell part of the forums if anyone is not using their Chronos anymore.
×
×
  • Create New...