Jump to content

m0nk37

Members
  • Content Count

    22
  • Joined

  • Last visited

  1. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    @@Fmilburn Alright thank you and everyone else very much for all of your help. Ill try the capacitor and then further clock calibration if need be, im sure the code you've posted works. It has to be one of those other things. Ill post a follow up once its working .
  2. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    @@Fmilburn Thank you! I tested your code, and the output on P1.2 in my scope. It looks pretty much identical as yours. There is a problem though, the lights arent functioning with these setting. I realize your example is only setup for 1 LED, and the first LED in the strip just kind of strobes. Im going to attempt to modify the code and account for the 72bit structure these LEDs want, i think that may be why its not turning on/off. You used UCA0 in your example, whats the difference between it and UCB0? If i take your configuration settings and apply it to my code as UCB0 on P1.7, it *seems* to work, but eventually messes up. Could it be because my device isnt calibrated properly? or would it be because of the capacitor you mentioned. In any event, this is great thank you for your help once again.
  3. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    @@chicken I narrowed it down to 1.666MHz (12MHz / MOD 7.2), sending 2 bits LONG and 1 bit SHORT, this time i am seeing the proper colors, however it is not as tight as the 5MHz ive posted. I assume this is what you were referring to using a library, how would one fix the timing outside of SPI? Could i use a timer and force it not to send unless its at the correct time frame perhaps?
  4. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    New code posted in this reply. Line 47 in void relay(), is where the bits are specified. And inside void main() is where the DCO is configured. I am configuring the DCO by taking the 16MHz clock and setting the DCO speed divider to obtain 5MHz for the seemingly working copy, and 1.6MHz for the copy which doesnt seem to work. I dont know how to fully set the DCO by taking the rsel/mod. I have attached it. I do not have any capacitor between VCC and GND, the only thing going to the LEDs from the board (MSP430) is the Data/Logic Line In. The LEDs have an external 5V power supply. I think you should fix it I also attached an old school Oscilloscope reading of the "working" copy, i dont think it will help much but i think its cool anyways If you need me to explain the code I can, i think its fairly straight forward. main_working_95.c main_625_ns.c
  5. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    I tried these configuration settings but unfortunately it didnt work. It was outside the ranges for it to work right i guess. I did 16Mhz / 10 to get 1.6MHz for 625ns. With LONG having 2 bits on, and SHORT having 1. The LEDs just turned on (white) even though i was sending it colors, so it was to far outside the range.
  6. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    Thank you for the suggestion! I will try those settings and see what happens. This is currently what ive got so far (not in the code i supplied, did this afternoon). It seems to work about 90-95% of the time, there is always one random pixel that wants to act up. It was exciting because it ran for a few minutes without messing up. 16MHz / MOD 3.2 = 5MHz DCO, which is 200ns per cycle TM1809 requires LONG = 1050ns to 1350ns per byte SHORT = 450ns to 750ns per byte RESET = 24us (microseconds), 1 us = 1000ns (based on cycle per MHz) My Script is currently (8/8/8 bit RGB for 3 LEDs) LONG = 1000ns, 5 bits on in the byte. (5 * 200ns) SHORT = 400ns, 2 bits on in the byte. (2 * 200ns) RESET = 48 cycles
  7. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    @@chicken thanks for that, i will give it a read. I also had another question if someone can help, i wanted to make sure i understand this part correctly. On page 4 here: https://www.deskontrol.net/descargas/datasheets/TM1809.pdf, it shows the wave form timings. It shows High speed mode, and Low speed mode. How are these modes determined? Second, how should the timings supplied in the datasheet be applied to the code? Are the timing values per bit sent, or byte? The data sheet shows a 72bit data structure and is confusing me. Example: T0H 0?high-level time , min=450 , typ=600, max=750 ns T1H 1?high-level time , min=1050, typ=1200, max=1350 ns How does this correlate to the 72bit data structure, and just in general, to the bits i should be sending? The timing is per byte.
  8. m0nk37

    MSP430G2553 and 3-wire SPI RGB LED timing help

    Hi @@LiviuM Thanks, yes i have seen that post actually. Fmilburn gave me some help previously and now im stuck again.
  9. Hello, Im working with TM1809 RGB LEDs on an MSP430G2553 over SPI (3-wire) data transfer. Im running into issues with timing and im not sure if its due to voltage or something else, and could really use some help. https://www.deskontrol.net/descargas/datasheets/TM1809.pdf on page 2 says that these lights require 4.5-5.5V, and i know the MSP430 is at 3.3V, is this the reason? My code below achieves the ability to set the RGB LEDs with about 95% success rate, i run into issues attempting to animate the colors or if i send it the same color over and over it will send bad data 5% of the time and fail. If its not the voltage, can someone take a look at my code and let me know if they have any ideas? Thanks for your time! main.c
  10. Thank you. So if i used CCS for example, would i gain the ability to change the clock speed and achieve what i need? Granted i know that the methods and total process will need to be revised, but do you think it would be possible? I also have an MSP432 laying around at 28 MHz so if it is, then perhaps i can do something with that with modified timing of the clock or even something with the MSP430 ive been trying.
  11. Thank you the calculations make sense now. Looking at the datasheet for UCS1903: Name Description Typ. value Allowable error T0H code 0, high level time 0.5
  12. Just a follow up question trying to make sure i understand everything, what is the formula you are using to obtain the 250 ns calculation? "DIV4 on the G2553 gives 250 ns" and "16 MHz/4 gives 250 ns for each on bit in byte" for example? So obviously the divider of 16 MHz as 4 is 4 MHz. Then how to get the 250 ns for each on bit in byte? Thanks for all the help so far!
  13. No i have not tried that yet, I dont have very much experience with hardware so i was hoping it might be a little more simple than that as i felt it might be out of my experience level? Anyways that sounds like a plan now, ill try and make sense of it and put the data sheet to use. Thanks @@Rickta59 and @@Fmilburn. Hopfully i can get it working! Ill post my results once i get any here
  14. Yes that is what i am referring to, I am trying to make the ucs1903 RGB-LED strip i have work with the MSP430G2. The timing is different yes, but it is similar. Edit: I have read that it is similar, do you have any advice to move forward with using this LED strip with the MSP430G2? I was hoping i could modify an existing library to get started with playing around with it. Would it be better to approach this differently?
×