Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


jrychter last won the day on January 9 2014

jrychter had the most liked content!

About jrychter

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Warsaw, Poland
  • Github
  1. Greg, thanks for the answers! I suspected you populate the actual boards differently from the schematic. As for the push-pull, when I wrote "push-pull" I meant the microcontroller output (e.g. what is inside the micro, driving the pin). And the MOSFET pair you found is actually quite nice, I'll save this for future projects. My approach is different, because I'm designing a battery-powered device, where every mW counts (I generate 5V for WS2812 from a Li-Ion battery). This is why the low-valued resistor caught my eye immediately.
  2. Hey, some quick notes having taken a look at the schematic: The caps around MMA8453Q should probably be larger (a mistake in the value in the schematic?): C15 is normally 100nF, while C16 at least 1
  3. Well, the problem with the legged version is that the holes take up so much board space. My main motivation is lack of board space, so I'd much rather stay with the -NL version if possible. Thanks for your advice
  4. From people who have already used TagConnect
  5. USCI! That's even more impressive, then. I never managed to get the timings just right, and I couldn't get new data to the USCI in time
  6. You're running the LEDs off a G2553, that's quite impressive. I tried to drive WS2812 using the USCI, failed, and then tried the timer, also failed. I'm assuming you're driving them directly using cycle-counting? As for I2C restarts, USCI does support them, but the stock TI code (TI_USCI_I2C_master.c) does not seem to. I vaguely remember being annoyed about this in the past, but this is not the first time I was annoyed at the sad state of TI-supplied libraries. This is why I wrote my own USI I2C library, after all. Some I2C devices that are specified to use repeated start will also let you read in two phases, with a stop condition inbetween, remembering the register address. You might try if that works for you.
  7. That is a very good article, indeed. My results agree with theirs: what worked for my WS2812B strips was 1.3us total time, 400ns for 0H, 650ns for 1H.
  8. I'm not sure if it will help in your design, but I've found that you can save some board space by going with milled cutouts for screws instead of holes. Yes, you still need room for the screw top, but less than you'd need if you had the hole in the middle of the board. See the attached picture for an example (the bottom cutout is marginal, parts are placed slightly too close)
  9. [i really need to do a writeup of my experiences writing a reliable driver for the WS2812 strips] First, I'd strongly suggest using level-shifting to drive the WS2812 at 5V. It might depend on your particular chip/strip, but I couldn't reliably drive them from 3.3V logic. The datasheet (crappy as it is) states CMOS logic, 0.7*VCC, which is 3.5V. You *might* get away with 3.6V, but I wouldn't count on it. For prototyping I used a 74HCT04 with two gates wired in series, any HCT chip will do. For production devices I'll probably use a M74VHC1GT125DT1G. Second, if you are writing code to drive the WS2812, I'd suggest testing it carefully using various bit patterns. I got best results using alternating 0x55 and 0xaa patterns, with some bytes being continuously and slowly incremented/decremented, in the middle of the string. There were many times when I thought I had correct code, only to see flickering somewhere down the string. Third, I don't really know why, but the WS2812 really does need 5V. That is a big disappointment, because you need complex power management in battery-powered applications, but that's just the way it is.
  10. Well, I don't think I can enlighten you, but I can state my reasons for using USI. It is true that USI is a very primitive peripheral. However, it still gets you: * a shift register, * a "timer" that precisely times your output, * interrupts, * outputs that are capable of simultaneously driving the bus and reading it (read on for why this might be needed). Here are my reasons for using the USI: * No matter what you do, I2C needs two pins. No savings here. * If I wanted to bit-bang, I would also need a timer, and there is only one on the G2412. Seems like a waste to use up such a precious peripheral. * I would have to bit-bang every bit of the output/input (USI has a shift register, so it takes care of 8 bits for you in one go). * The code would likely be much larger, not smaller, and more complex, too (switching pin directions, interrupts, etc). I don't see how you can simplify the I2C state machine by much (I use 6 states + idle), and my code really doesn't do much outside of the state machine. * If I ever wanted arbitration loss detection, the code would become even more complex: for every bit written, you'd need to simultaneously detect that the line has been driven low by someone else. Overall, bit-banging seemed to me like going out of my way so as not to use the USI at all costs. And avoiding the USI makes no sense: what else would I use it for? For projects that need both SPI and I2C, I'd much rather bit-bang SPI. But, I would gladly compare notes with your library that bit-bangs I2C. Perhaps you did manage to simplify the I2C state machine. So, is the library available? EDIT: oops, I missed the link to your code! Sorry. Now, having looked at your code, the tradeoff seems to be that it is significantly larger, more complex, uses busy-waiting, and the I2C clock is strictly tied to your core frequency. For some that is a reasonable tradeoff to get I2C on any GPIO pins they want, for me it wasn't. I'd rather use the USI, since it's already there. BTW, another tradeoff is that your code is under GPLv3, while mine is under the MIT license.
  11. I agree the WS2812 is a fantastic IC, but the documentation is really crappy. This is something I can't understand about Chinese companies (it isn't the first time I see something like this): the company makes millions of chips, but can't spare a week to write a decent datasheet? For those that do not know, there are at least three versions of the datasheet in question. Each version has different timings. In none of the versions I have do the timings add up correctly. The
  12. This is such a great idea. I've been writing code to interface with the WS2812 chips (and finally managed to get a 100% working solution using DMA and a timer, although not on a MSP430), but I never thought of producing PCBs that are segments of a circle. Very clever! I am so going to rip this idea off! Oh, wait, I think it is called "being inspired by". Or, if you're Samsung "discovered independently while innovating" :-) Thanks for sharing!
  13. I thought about it. However, there are several reasons why I don't think this will happen soon: These days I mostly use the G24x2 chips, because they are tiny, cheap and low-power. For anything even slightly larger I am moving to Freescale Kinetis. I did a quick'n'rough price comparison (see http://jan.rychter.com/enblog/ti-msp430-vs-freescale-kinetis-a-price-comparison) and it turned out that you can get a 48MHz 32-bit ARM Cortex M0+ for less than the price of a G2553. This means that most of my projects will now use the Kinetis chips, unless I want a simple, small, cheap and very low-power solution (with all of these requirements simultaneously). USCI makes using I2C much easier. There is also code which is I think as close to a library as TI code gets, called "TI_USCI_I2C_master", which (if you manage to find it!) gets the job done. I don't like the interface, and I don't know if it can do repeated start, but when I needed to access a light sensor, it worked for me. Since the "TI_USCI_I2C_master" code solved my immediate problem, I don't have a pressing need to write something of my own :-)
  14. That was the whole reason for writing it
  15. I've written a tiny library that implements I2C master functionality on MSP430 devices that only have the USI module (for example, MSP430G2412 or MSP430G2452). It's small, simple, works well for me, and might help others in their projects. Blog post at http://jan.rychter.com/enblog/msp430-i2c-usi-library-released Github repo at https://github.com/jwr/msp430_usi_i2c Have fun!
  • Create New...