
anandjm
-
Content Count
2 -
Joined
-
Last visited
-
Days Won
1
Reputation Activity
-
anandjm got a reaction from bluehash in A Simple USB to TTL Convertor
I recently purchased a Cubietruck/Cubieboard3 (http://cubieboard.org/2013/10/30/cubieboard3-cubietruck-is-all-ready/) and since I want to customize the kernels, I needed a USB to TTL Serial converter at 115200bps. Being a weekend I was too lazy to go out to the electronics hardware market, and since I wanted it immediately I did not want to buy it online. So I felt I should be able to use one of my Stellaris Launchpad boards for this purpose. Here is the code for USB to TTL Serial conversion. A better option would be to code directly in "C" with the USB library in Tivaware/Stellarisware, but this code is so simple that I would not waste my time doing it right now. The code should work with any hardware supported by the Wiring framework.
-----Code starts here----------
//Red-Blue Combination is most visible for data status indication const int read_LED = RED_LED; //Red LED blinks on data read const int write_LED = BLUE_LED; //Blue LED blinks on data write int read_State=LOW, write_State=LOW; void setup() { pinMode(read_LED, OUTPUT); pinMode(write_LED, OUTPUT); Serial.begin(115200); Serial1.setPins(UART1_PORTB); //Comment if you need to use the alternate port PC4/PC5 Serial1.begin(115200); Serial.println("Simple USB TTL Converter - Stellaris/Tiva Launchpad"); } void loop() { if (Serial.available()){ digitalWrite(write_LED,HIGH); Serial1.write(Serial.read()); } if (Serial1.available()){ digitalWrite(read_LED,HIGH); Serial.write(Serial1.read()); } digitalWrite(write_LED,LOW); digitalWrite(read_LED,LOW); } ------Code Ends here -------
-
anandjm got a reaction from Automate in A Simple USB to TTL Convertor
I recently purchased a Cubietruck/Cubieboard3 (http://cubieboard.org/2013/10/30/cubieboard3-cubietruck-is-all-ready/) and since I want to customize the kernels, I needed a USB to TTL Serial converter at 115200bps. Being a weekend I was too lazy to go out to the electronics hardware market, and since I wanted it immediately I did not want to buy it online. So I felt I should be able to use one of my Stellaris Launchpad boards for this purpose. Here is the code for USB to TTL Serial conversion. A better option would be to code directly in "C" with the USB library in Tivaware/Stellarisware, but this code is so simple that I would not waste my time doing it right now. The code should work with any hardware supported by the Wiring framework.
-----Code starts here----------
//Red-Blue Combination is most visible for data status indication const int read_LED = RED_LED; //Red LED blinks on data read const int write_LED = BLUE_LED; //Blue LED blinks on data write int read_State=LOW, write_State=LOW; void setup() { pinMode(read_LED, OUTPUT); pinMode(write_LED, OUTPUT); Serial.begin(115200); Serial1.setPins(UART1_PORTB); //Comment if you need to use the alternate port PC4/PC5 Serial1.begin(115200); Serial.println("Simple USB TTL Converter - Stellaris/Tiva Launchpad"); } void loop() { if (Serial.available()){ digitalWrite(write_LED,HIGH); Serial1.write(Serial.read()); } if (Serial1.available()){ digitalWrite(read_LED,HIGH); Serial.write(Serial1.read()); } digitalWrite(write_LED,LOW); digitalWrite(read_LED,LOW); } ------Code Ends here -------
-
anandjm got a reaction from energia in A Simple USB to TTL Convertor
I recently purchased a Cubietruck/Cubieboard3 (http://cubieboard.org/2013/10/30/cubieboard3-cubietruck-is-all-ready/) and since I want to customize the kernels, I needed a USB to TTL Serial converter at 115200bps. Being a weekend I was too lazy to go out to the electronics hardware market, and since I wanted it immediately I did not want to buy it online. So I felt I should be able to use one of my Stellaris Launchpad boards for this purpose. Here is the code for USB to TTL Serial conversion. A better option would be to code directly in "C" with the USB library in Tivaware/Stellarisware, but this code is so simple that I would not waste my time doing it right now. The code should work with any hardware supported by the Wiring framework.
-----Code starts here----------
//Red-Blue Combination is most visible for data status indication const int read_LED = RED_LED; //Red LED blinks on data read const int write_LED = BLUE_LED; //Blue LED blinks on data write int read_State=LOW, write_State=LOW; void setup() { pinMode(read_LED, OUTPUT); pinMode(write_LED, OUTPUT); Serial.begin(115200); Serial1.setPins(UART1_PORTB); //Comment if you need to use the alternate port PC4/PC5 Serial1.begin(115200); Serial.println("Simple USB TTL Converter - Stellaris/Tiva Launchpad"); } void loop() { if (Serial.available()){ digitalWrite(write_LED,HIGH); Serial1.write(Serial.read()); } if (Serial1.available()){ digitalWrite(read_LED,HIGH); Serial.write(Serial1.read()); } digitalWrite(write_LED,LOW); digitalWrite(read_LED,LOW); } ------Code Ends here -------
-
anandjm got a reaction from energia in I2C on Stellaris Launchpad
Well I had similar problems with my ADXL345 module (with 5v to 3.3v regulator). Both with SPI and I2C. First I wrongly connected the 5v supply to the 3.3v rail. So I ended up replacing the IC on the module using solder paste and hot air gun. Then I was not sure if the solder was good or not. After wasting two days with both SPI and I2C, I verified it on my Raspberry Pi and it was detected without any problem. Next I tried it out on my MSP430 board with I2C. No issues there. I've discovered that "Wire.endTransmission()" always returns a zero both on the MSP430 and the Stellaris launchpads. Apparently this is also an issue with some arduino like boards (like the teensy).
With the Stellaris launchpad I had issues with using I2C(0). It would intermittently read data and garbage for multibyte reads (which is necessary for the ADXL345). Single byte reads did not exhibit this problem. I was able to get it working on I2C(3) and I2C(2) but with the following sequence
Wire.begin(3);
Wire.setModule(3);
Wire.begin();
If I omitted the first or the last line, the i2c port would only return zeros. I hope this helps. Also I found there was no need for pullups as my module already had them. But your experience would probably differ.
I think energia on the Stellaris has a lot of bugs and would not as of now recommend it for serious work. But it is people like us who have to contribute to making it work.