Jump to content
bluehash

What are you working on today/this week?

Recommended Posts

I'm starting to build up a driver for a fast steering mirror... Basically just a 2 channel DAC that outputs -10 -> 10 V except with the hardware to load and playback pre-defined sequences (stored on an SD card). It also has a TFT display to let it work as a stand alone unit.

Share this post


Link to post
Share on other sites

Hi everyone,

 

So i've been working on controling ws2812 LED strips with a Tiva. Right now i have it working with 32 paralel outputs, each with 14 LEDs in series. I still need to implement the way to work with more than 14 each output, it's just a matter of writing it, i alredy know how. The way i have it uses 3x times more RAM than it could but god dam! The DMA scather-gather is so badly documented that it's taking forever to optimize my code. (compared to any other peripheral fuction)

 

The idea it's to make a 2m*1m RGB matrix with 120*64 Leds. First i'm going to start with a 60*32 matrix. Since i'm using alot of RAM i'm probably gona keep it a maximum of 8000 LEDs per Tiva, altough, if you had 512 LEDs per output like the tensy you could get 512*32=16384LEDs.

 

The DMA has been giving quite a fight but it's actualy been fun, learned so much from this (remember when i was scared to use the DMA for a TLC5940 @@RobG?)

Share this post


Link to post
Share on other sites

@L.R.A  Is your code available anyplace?  I have been looking fiddling with some code to handle LEDs - 

reading FadeCandy and FastLED libraries, etc.  Would be curious to see some examples using the Tiva DMA.

(The documentation is a bit terse, and doesn't seem to cover some things at all - like timing.)

 

Actually I am working on RGBmatrixpanel driver (32x32 panels of LEDs, no controllers so the Tiva handles the refresh).

Have been doing it using Timers and GPIO (which works fine), but saw where somebody else did similar for the Teensy using DMA (SmartMatrix), so thought I would investigate the DMA controller a little bit.

Share this post


Link to post
Share on other sites

The DMA control for the addressable strips that use timing like the ws2812 is great. Just to control 14 leds per output and with a usage of 3x the number of bits, it's actualy not that hard. This method is much better. Why? because i will only need to lose 8uS tops every 428uS, so you have a lot of free time to use the processor for other thigs, like receive new data or maybe even use a small LCD if you optimize the code

 

I actualy didn't made it available anywhere. Still perfecting it. I wanted to implement scather-gather but that's much more complicated. I could wrap-up sometigh to control 14 Leds per output, with 8 outputs. 

Wich timing are you talking about? The ws2812 and ws2812b timing is pretty clear. I'm going to write some explanation on how to use the DMA method. Cya in 15-30min

 

Here you go @igor:

http://forum.43oh.com/topic/5809-ws2812-matrix/

Share this post


Link to post
Share on other sites

Hi,  new to MSP430,  been reading MSP430 Microcontroller Basics by John Davies,  up to Chapter 4.  Nice book to go along with the user guides.

 

Dusted off my EZ430 Chronos watch.  Looks like it it time for a project.

 

Joe

Share this post


Link to post
Share on other sites

Gaining familiarity with the SimpleLink API for CC3100/CC3200.

 

Quick sketch to evaluate the sl_Fs* API, in preparation for producing code that can create SSL/HTTPS sockets (using the Filesystem
API to upload certificate files) and maybe handle the security subsystem for 802.1x EAP WiFi (which, according to the API docs, is supported or already there)-

#include <WiFiUdp.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <sl_strings.h>

const char ssid[] = "GUEST";

void setup()
{
  uint32_t msave;
  
  Serial.begin(115200);
  
  delay(2000);
  Serial.println("WiFi:");

  WiFi.begin((char *)ssid);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print('.');
    delay(150);
  }
  Serial.println();
  
  /*
  Serial.println("Connected- waiting for IP");
  msave = millis();
  while (WiFi.localIP() == INADDR_NONE) {
    Serial.print('.');
    delay(150);
    if (millis()-msave > 5000) {
      Serial.println("Timeout waiting for IP; disconnecting & reconnecting.");
      WiFi.disconnect();
      WiFi.begin((char*)ssid);
      msave = millis();
    }
  }
  Serial.print(" done; IP=");
  IPAddress my_ip = WiFi.localIP();
  Serial.println(my_ip);
  */
  
  fstest();
  while(1) delay(1000);
}

void loop()
{

}

void fstest()
{
  int32_t i, fh;

  Serial.print("sl_FsOpen(\"/cert/ca.pem\", FS_MODE_OPEN_CREATE)");
  i = sl_FsOpen((uint8_t*)"/cert/ca.pem", FS_MODE_OPEN_CREATE(1024,_FS_FILE_PUBLIC_READ), NULL, &fh);
  Serial.print(" = ");
  Serial.print(get_slerror(i, SL_FS));
  Serial.print(" ("); Serial.print(i, DEC); Serial.println(')');
  
  Serial.print("sl_FsClose()");
  i = sl_FsClose(fh, NULL, NULL, 0);
  Serial.print(" = ");
  Serial.print(get_slerror(i, SL_FS));
  Serial.print(" ("); Serial.print(i, DEC); Serial.println(')');
  
  Serial.print("sl_FsDel(\"/cert/ca.pem\")");
  i = sl_FsDel((uint8_t*)"/cert/ca.pem", 0);
  Serial.print(" = ");
  Serial.print(get_slerror(i, SL_FS));
  Serial.print(" ("); Serial.print(i, DEC); Serial.println(')');

  
  Serial.print("sl_FsOpen(\"/cert/ca.pem\", FS_MODE_OPEN_READ)");
  i = sl_FsOpen((uint8_t*)"/cert/ca.pem", FS_MODE_OPEN_READ, NULL, &fh);
  Serial.print(" = ");
  Serial.print(get_slerror(i, SL_FS));
  Serial.print(" ("); Serial.print(i, DEC); Serial.println(')');
  if (i == SL_FS_OK) {
    Serial.print("sl_FsClose()");
    i = sl_FsClose(fh, NULL, NULL, 0);
    Serial.print(" = ");
    Serial.print(get_slerror(i, SL_FS));
    Serial.print(" ("); Serial.print(i, DEC); Serial.println(')');
  }
}

Output:

WiFi:
...
sl_FsOpen("/cert/ca.pem", FS_MODE_OPEN_CREATE) = SL_FS_OK (0)
sl_FsClose() = SL_FS_OK (0)
sl_FsDel("/cert/ca.pem") = SL_FS_OK (0)
sl_FsOpen("/cert/ca.pem", FS_MODE_OPEN_READ) = SL_FS_ERR_FILE_NOT_EXISTS (-11)

I wrote some code (sl_strings.cpp / sl_strings.h) to allow me to resolve the weird SimpleLink API error codes into their respective textual mnemonics.

Interesting observation, without WiFi.begin() the sl_Fs* API doesn't work.  I'm assuming there's some sort of SimpleLink API initialization that WiFi.begin() performs.

 

edit: yeah, WiFi.init() starts the uDMA subsystem and sl_Start() to initialize the API.  Luckily I think WiFi.init() can be run from other libraries, so my new "SLFS" library can initialize it with .begin() if needed.

Share this post


Link to post
Share on other sites

Built an Energia library around the sl_Fs* API... called "SLFS".  Going to test the I/O subsystem thoroughly before releasing to the masses, probably for integration into Energia's core if @@energia is cool with it.  This is sort've a "first step" towards getting full SSL support rolling (allows the user to upload SSL certs onto the serial flash).

 

Example sketch I made creates a file, closes it, deletes it, then tries to re-open:

SLFS demo - CreateCloseDeleteOpen
File "/cert/test.pem" created; closing...
Deleting file "/cert/test.pem" - success
Now that the file was deleted, we are going to try re-opening it,
 and this should fail-
Opening file "/cert/test.pem" - failed - SL_FS_ERR_FILE_NOT_EXISTS

Share this post


Link to post
Share on other sites

Word for the wise- Before deploying a sensor board outside, seal it up!  My Wolverine LP + AS3935 Lightning sensor + fueltank bpak project I left at the TI booth at MakerFaire hoping to get some data from Saturday night, but humidity + condensation seemed to kill it... and I couldn't seem to recover it on Sunday, had LFXT1 faulting (fixed that) and then one of the pushbuttons repeatedly triggering.

 

Hit the board with hot air tonight and it seems to be working fine now.  Going to use silicone grease or hot glue or something to seal the ICs and pushbutton leads next time I try to use this thing outside overnight.

Share this post


Link to post
Share on other sites

My Wolverine LP + AS3935 Lightning sensor + fueltank bpak project I left at the TI booth at MakerFaire hoping to get some data from Saturday night, but humidity + condensation seemed to kill it.

If little a bit of condensation killed it, WTF is some lightning going to do to it?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...