• Content count

  • Joined

  • Last visited

About bakey

  • Rank
    Noob Class

Recent Profile Visitors

79 profile views
  1. I tested it on another computer, and it worked. Then I reinstalled the CC3200 lib for my energia on my work computer, and it works... So something was wrong in my old SPI lib...
  2. In my project I use SPI, in the sample I'm not using it. Just the include is enough to make the String conversion fail.. I'm guessing it has something to do with MSB an LSB, but things like that go over my head..
  3. It's a cc3200. I just use blink example, and add the include and serial code. So I don't think it's a memory limitation...
  4. Hi, I have a project in which I submit data through a custom message protocol. So like message <321;1;5;10.2> is a thing. To do that I use things like String s = "<310;" + String(DeviceID) + String(";") + String(ToestelID)+ String(";") + String(currentUsrID)+ String(";1;") + String(CurrentPowerUsg) + String(";") + String(Temp1) + String(";") + String(Temp2) + String(";") + String(lichtSterkte) + String(">"); But the conversion of double to string fails. this code double ding = 10.15; Serial.print("double print"); Serial.println(ding); Serial.print("Als string"); Serial.println(String(ding)); String s = "<320;" + String(ding) + String(";"); Serial.println(s); gives me this result: Which is fine. However if I include SPI.h and use the same code I get this result I found this out after starting a new project using all the includes from my original project, and eliminating them 1 by 1. So the SPI include does something to my String conversion... I'm using Energie 1.6.10E18 How can I fix this?
  5. I did a google search, not a forum search. Will do next time. Tx
  6. Hi, I'm pretty new to CC3200 (and TI platform overall), but I can't get my head around a analogRead problem I'm having. The analogRead works for voltages between 0 and +-1.6V (0 equals 0 on read, and 1.6 equals 4095) I was expecting this to be 0=0 and 3.3=4095. I've tested the same slider potentiometer on a TM4C129, and it works as expected. Do I have to set some reference value to get the ADC working correctly on the CC3200?
  7. 8 hours of searching for a solution with no progress, Finnaly I give up and post on this forum for help And 2 hours later I'm in the shower and think "it's a timing problem!" So I added a delay after the first 0 and it works... Serial1.begin(115200,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO |UART_CONFIG_WLEN_8)); Serial1.write((uint8_t)0); delay(1); // now back to DMX speed: 250000baud Serial1.begin(250000,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO | UART_CONFIG_WLEN_8)); Weird how the 123GXL doesn't need the delay...
  8. I'm trying to make a WiFi DMX webserver/transmitter. I have following code working on my TM4C123GXL. /* */ // most launchpads have a red LED #define LED RED_LED #include "inc/hw_uart.h" #include <stdint.h> #include "driverlib\uart.h" //see pins_energia.h for more LED definitions #define DMX_MAX 128 // max. number of DMX data packages. const int buttonPin = PUSH2; int buttonState; // the current reading from the input pin int lastButtonState = LOW; // the previous reading from the input pin const int ledPin = GREEN_LED; uint8_t DMXBuffer[DMX_MAX]; // the setup routine runs once when you press reset: long lastDebounceTime = 0; // the last time the output pin was toggled long debounceDelay = 50; // the debounce time; increase if the output flickers void DMXstart() { // DMX is a 250000 baud serial data //Serial1.begin(250000, (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO |UART_CONFIG_WLEN_8)); // initialize the DMX buffer for (int n = 0; n < DMX_MAX; n++) DMXBuffer[n] = 20; } // DMXstart void DMXwrite(int channel, uint8_t value) { // press parameters to allowed range if (channel < 1) channel = 1; if (channel > DMX_MAX) channel = DMX_MAX; if (value < 0) value = 0; if (value > 255) value = 255; // store value for later sending DMXBuffer[channel-1] = value; } // DMXwrite void DMXflush() { // send the break by sending a slow 0 byte Serial1.begin(112500,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO |UART_CONFIG_WLEN_8)); Serial1.write((uint8_t)0); // now back to DMX speed: 250000baud Serial1.begin(250000,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO |UART_CONFIG_WLEN_8)); // write start code Serial1.write((uint8_t)0); // write all the values from the array Serial1.write(DMXBuffer, sizeof(DMXBuffer)); } // DMXflush int cn = 0; void setup() { //Serial1.begin(250000,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO | UART_CONFIG_WLEN_8)); // Serial1.write(5); pinMode(buttonPin, INPUT_PULLUP); pinMode(LED, OUTPUT); pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); digitalWrite(LED, LOW); DMXstart(); } // the loop routine runs over and over again forever: void loop() { int reading = digitalRead(buttonPin); if (reading != lastButtonState) { lastDebounceTime = millis(); } if ((millis() - lastDebounceTime) > debounceDelay) { buttonState = reading; } // set the LED using the state of the button: //digitalWrite(LED, buttonState); if (buttonState ==LOW) { digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) delay(10); // wait for a second7 cn+=1; DMXwrite(1,cn); DMXwrite(2,cn); DMXwrite(3,cn); DMXflush(); delay(10); // Serial1.write(99); // Serial1.write(4); // Serial1.write(3); // Serial1.write(2); // Serial1.println(1); // buttonState = HIGH; digitalWrite(ledPin, LOW); } // save the reading. Next time through the loop, // it'll be the lastButtonState: lastButtonState = reading; } I use similar code on a CC32000-LaunchXL but I can't get it to work. The DMX client is an attiny2313. the 2313 works perfectly when controlled from an ENTTEC opendmx controller. And it works when using the 123GXL. I'm able to communicate between my CC3200 and the 123GXL, so I see the DMX packet arrive when I hook both of en boards together But the problem is the DMX protocol relies on a framing error These lines // send the break by sending a slow 0 byte Serial1.begin(112500,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO |UART_CONFIG_WLEN_8)); Serial1.write((uint8_t)0); // now back to DMX speed: 250000baud Serial1.begin(250000,(UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_TWO | UART_CONFIG_WLEN_8)); generate a framing error on the DMX client. That way the client knows a new packet is incoming. It works on the 123GXL. But not on the CC3200. I've put code in the framing error part on the DMX client, and the framing error is never received.. So when I put a LEDflash in the RX interupt on the DMX client, I see it flash, so data is received. When I put the LEDflash in the framing error if-block, it doesn't flash. The framing error is received when I use the 123GXL to transmit. So why does the same code on CC3200 and 123GXL result in different effect on the client? Oh and 1 small thing, I've change the Serial.begin in hardwareSerial.cpp so I can use 2 stop bits. void HardwareSerial::begin(unsigned long baud,unsigned long mask) ---- MAP_UARTConfigSetExpClk(UART_BASE, 80000000, baudRate,mask);
  9. Got the lib working on my tm4c 1294 launchpad. Tx for the library.