Jump to content

jelledebock

Members
  • Content Count

    16
  • Joined

  • Last visited


Reputation Activity

  1. Like
    jelledebock reacted to Fred in Launchpad as USB to Serial programmer   
    The G2 launchpad used to be so cheap I've seen it recommended for just this sort of thing. Whether you go for the G2 or the F5529 launchpad all you will need to do is remove the jumpers between the FET side of the board and the target microcontroller. You might as well remove the DIP chip on the G2 but you shouldn't need to.
  2. Like
    jelledebock reacted to jazz in Launchpad as USB to Serial programmer   
    Old MSP430G2 LP has 9600 bps limitation related to USB / UART bridge on board, not to MSP430 (that can go over 1 Mbps). There is no 9600 bps limitation in new MSP430x5xx LP's.
  3. Like
    jelledebock reacted to RobG in [Energia Library] WS2811Driver LED Controller Class   
    Which LEDs do you have? WS2812 or WS2811? Timing differences might be an issues here.
    You can also try non-energia code, here or here.
  4. Like
    jelledebock reacted to Rickta59 in [Energia Library] WS2811Driver LED Controller Class   
    Assuming the blink_strip example works, let's look at why your code is giving the results you are getting.
     
    If you read a little about how the ws2811 works on oPossums's original posting you can see each pixel takes 3 bytes (8bits of Green, 8 bits of R, 8 bits of Blue). In your code you are only providing data for one pixels worth of data. Because you made that a const uint8_t it will end up in flash memory ( this is important later as we will see ). However when you call the ledStrip.write(led0,15) you are telling the write function to expect 15 bytes of led data. This will never work correctly, as you need to provide 3 bytes for each pixel. You have only created 3 bytes of valid data but you are telling the function that there is 15 bytes there.
     
    This is the actual implementation of write(const uint8_t *, uint16_t len):
     

    void WS2811Driver::write(const uint8_t *data, uint16_t len) { disableWatchDog(); write_ws2811_hs(data, len, _pin_mask); enableWatchDog(); } The code just disables the watchdog interrupt as cycle counting is used in this code to achieve timing, then it calls the low level asm code. passing the address of data, the number of bytes at that address and the pin_mask so it can toggle the correct output pin.
     
    Let's go back to what you are seeing in the video. I see it toggling 2 leds on and off. One seems to have a color (although I can't tell what it is, and the other pixel is off and then the rest of the pixels are white. I said earlier that the fact that your leds bytes are in flash is important to understanding why you are seeing white. When you load a new program on your msp430g2553, the first thing the mspdebug does is erase memory. For the msp430 erased memory has a value of 0xFF hex. So lets look at some disassembled code of when you actually call the WS2811:write call:
     
    0000c088<loop>:
    c088: 3d 40 0f 00 mov #15, r13 ;#0x000f <<< this is the length #15
    c08c: 3e 40 de c2 mov #-15650,r14 ;#0xc2de <<< note this address of the data array
    c090: 3f 40 00 02 mov #512, r15 ;#0x0200 <<< this is the pin mask
    c094: b0 12 dc c0 call #0xc0dc <<< this is the address of the ::write function
    c098: 3e 40 f4 01 mov #500, r14 ;#0x01f4
    c09c: 0f 43 clr r15
    c09e: b0 12 12 c2 call #0xc212
    c0a2: 3d 40 0f 00 mov #15, r13 ;#0x000f
    c0a6: 3e 40 e1 c2 mov #-15647,r14 ;#0xc2e1 <<< note this address
    c0aa: 3f 40 00 02 mov #512, r15 ;#0x0200
    c0ae: b0 12 dc c0 call #0xc0dc
    c0b2: 3e 40 f4 01 mov #500, r14 ;#0x01f4
    c0b6: 0f 43 clr r15
    c0b8: b0 12 12 c2 call #0xc212
    c0bc: 30 41 ret
    [code=auto:0]
     
    When you pass 15 to the low-level write and the address of data array at 0xc2de, the low level function performs a buffer read outside of its bounds, it should really stop after 3 bytes because that is all there is for valid data. However, you told it there are 15 bytes of data starting at address 0xc2de. It reads your 3 valid bytes and then gets the value of 0xFF for each byte past the end of the array. Because the flash memory has been erased it contains 0xff,0xff,0xff for each pixel data you did't define.
     
    So the solution is to define more valid pixel data and provide the proper number of bytes to the write call.
     
    -rick
     
  5. Like
    jelledebock reacted to Lgbeno in Pololu led strip for MSP430   
    By the way around Halloween time I saw on Twitter that someone did this with a pumpkin:
     
    http://www.paulschow.com/2014/10/rgb-internet-pumpkin.html?m=1
  6. Like
    jelledebock reacted to Lgbeno in Pololu led strip for MSP430   
    That's a field of study which will reward you well throughout your career! I would say with determination, you will get it up and running with any approach. You'll find that part selection is pretty critical to success.
     
    I'm an EE with about 7 years experience and became a hobbyist about 4yrs ago . I still remember my first hobbyist project. I thought that I could build my own quad copter from scratch. From the BLDC drives to the wireless controller. I got done with my first hardware design and then hit the wall from a programming perspective. It was just too complex for a first project. Like 100x too complex... Yours isn't that complex but still with the components that you are thinking, it will be a healthy challenge.
     
    For those just getting into the hobby, I try to help identify a clear and easy path to complete the project because that's what really gets you hooked on it long term. Starting with a platform that makes a project a 1 month job instead of a 6 month job is a big deal IMO. I'm still mastering this myself but it allows you to complete more projects with less time.
     
    As I see it you have
    1) Get rgb led strip talking to uC
    2) Get wifi up and running
    3) Define wifi protocol to interface to code in step 1
    4) Write web interface to talk to code in step 3
    5) Improve system reliability, wifi robustness at all steps
    6) maybe setup some mini-server to host the web app
     
    With the Lauchpad + esp8266 you will definitely feel each one of these steps, steps 2 and 3 will likely be the most difficult.
     
    With cc3200 steps 2 and 3 become easier with Energia and the pre written libraries.
     
    With Electric Imp steps 2-6 are practically done for you and integrated into a single environment. Step 1 is straight forward too with the example code.
     
    In any case 43oh is a great community with really smart people who always help out. It's also the most project oriented community forum I know as well.
  7. Like
    jelledebock reacted to enl in Photodiode as proximity sensor   
    Excellent. that will do the job. Better linearity will come with constant potential across the photodiode. You can do this in your configuration using a PNP transistor, with the photodiode to ground, Or by putting the current-to-voltage conversion resistor on the collector of the NPN transistor and grounding the emmitter. Not worth it if what you have is doing the job.
  8. Like
    jelledebock reacted to enl in Photodiode as proximity sensor   
    Vr is the reverse potential applied during the test. To classify the photodiode, a constant reverse voltage is applied, the light is varied, and the photocurrent is measured.
     
    I will suggest that you do NOT use 5V. Use your microcontroller supply This will protect the microcontroller from overvoltage on the input.
     
    I think that your problem is more likely the resistor you are using to convert current to potential, and the low output of photodiodes. The max classified current is less than 100 microamps. With your resistor, this will give 1V. This is at approximately 1mW/cm^2. This is a pretty high intensity. At high noon on a bright day in the desert, the intensity of solar flux is of the order 1000W/m^2, which is 100mW/cm^2. I would guess that you are working at intensity much, much less than that. Typical bright interior lighting is about 1/100th of that, and reflected light from even a bright IR LED will be much lower yet. At 100microamps, you would see 1V across your resistor. You are likely several factors of ten less. Photodiodes are generally used when high linearity and sensitivity are needed, such as in precision measurement, or high speed is required, such as high speed optical communication. Other devices are usually used for low precision/low speed  tasks like proximity.
     
    Typically, with a photodiode, you need to amplify the output. Several techniques are common, including using the photocurrent to drive the base of a transistor, using an op-amp circuit designed for photodiode amplification (not complicated, but needs to be right to get good performance), or using an op-amp circuit that keeps the photodiode operating in photovoltage mode.
     
     
    For your application, I would use a phototransistor, which can be described as a transistor where the base-emmitter junction acts as a photodiode. Cheap, high output, easy.
     
    Or, go to an amplified sensor like the OPT101 or similar (there are a lot of options. This is just what came to mind first)
     
    Edit: fixed intensity value and spelling
×
×
  • Create New...