Jump to content

OzGrant

Members
  • Content Count

    239
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    OzGrant got a reaction from Diodoman in I2C scanner for 2553 & 5529   
    Still getting nowhere with the I2C scan address finder. So had a look at my working  I2C RTC (uses a PCF 8563) sketch.
    After editing the 
        Wire.endTransmissio()
    to
        i =   Wire.endTransmissio() 
    found that it always returns a zero regardless of the I2C address in Wire.beginTransmission(I2C address).
     
    After editing Wire.cpp in energia-0101E0012\hardware\Msp430\cores\Msp430 found it made no difference, in fact could renamed the file to WireXX.cpp and could still compile the sketch OK??. Also searched the hard drive for other Wire.cpp's and only found the arduino one in the arduino area.
     
    Also found that when I try to add the Wire library by using the Energia drop down menu (sketch\Inport Library) I can select Wire but instead of  the #include <Wire.h> put in the sketch, I get a blank line inserted?
     
    I no longer need the scan sketch to work as I have found all the address via datasheets, but would like to understand why the sketch works OK with an arduino lib but fails with a core energia lib
    Grant
     
     
  2. Like
    OzGrant reacted to Rickta59 in Determining Board Selection   
    In the latest version this has probably changed:
     
    https://github.com/energia/tivac-core/blob/master/boards.txt#L35
     
    EK_TM4C1294XL
     
    -rick
  3. Like
    OzGrant reacted to Fmilburn in Determining Board Selection   
    See https://github.com/fmilburn3/if_Processor/blob/master/if_Processor.ino
  4. Like
    OzGrant reacted to LiviuM in Determining Board Selection   
    Hi,
     
    you can use the for sure the uC name:
    #if defined(__TM4C1294NCPDT__) /*tivac LM4C1294 writes 4 locations at once;*/ In older Arduino IDE's I've used the board name as well, but not sure how the newer IDEs work:
    #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) Regards,
    Liviu
     
    LE Because of the "command line defines" (-D compiling option), I think in the last Energia (1.6.10E18) you can use "ENERGIA_board-name", with the "board-name" found in the boards.txt file. For my TivaC TM41294XL, the boards.txt shows:
    EK-TM4C1294XL.build.board=EK-TM4C1294XL and the compile option is
    -DENERGIA_EK-TM4C1294XL
  5. Like
    OzGrant got a reaction from agaelema in I2C scanner for 2553 & 5529   
    Fixed. For some reason Energia requires a Wire.write() before Wire.endTransmission() command. to get a valid returned value.
    Have fun.
    Grant
     
    -----------------------------------------------------------------------
    // I2C scanner for M430G2553 // Added  Wire.write(1);  for sketch to work. // Grant Forest May 2014 #include <Wire.h> uint8_t error, address; void setup () {     Serial.begin(9600);     Serial.println("G'Day MyI2C_ScannerV1");     Wire.begin(); } void loop () {   Serial.print(" Scanning...");   for(address = 1; address < 127; address++ )   {     Wire.beginTransmission(address);     Wire.write(1);  ///////////////////////////////////// sketch works ok when this line added     error = Wire.endTransmission();     if (error==0) {       Serial.print("Found Address 0x");       if (address<15) Serial.print('0');       Serial.print(address,HEX);       Serial.print(", ");       }   }          Serial.println();          delay(2000); } --------------------------------------------
  6. Like
    OzGrant reacted to greeeg in Tiva Reset   
    Hey @@OzGrant I have not used the tivaC platform. I wasn't sure on TI's implementation of CPU registers.
     
    I've fired up Energia (looks like the you're using that)
     
    Both of these look like they'll work
    Either:
    // After running this instruction the system should reset (*((volatile uint32_t *)NVIC_APINT)) |= NVIC_APINT_SYSRESETREQ; // Never reached Or:
    // include at top of file #include <inc/tm4c123gh6pm.h> // After running this instruction the system should reset NVIC_APINT_R |= NVIC_APINT_SYSRESETREQ; // Never reached Both should compile to the same binary instructions.
    NVIC_APINT_R is defined as (*((volatile uint32_t *)0xE000ED0C)) in tm4c123gh6pm.h
  7. Like
    OzGrant reacted to greeeg in SD card 8GB format problem   
    The problem is in the FAT implementation. 4Gb is the limit of 32 bit memory addresses. It's been alittle while since I played with FAT stuff. But I'm pretty sure that's what you're hitting here.
  8. Like
    OzGrant reacted to PTB in SD card 8GB format problem   
    I think there is some kind of limit. I found anything over 4gb got pretty funky. I tried a few different cards and they all misbehaved. I know the cards are good as they all work fine in my dslr camera.
     
    I'm not using sd.lib but rather petitfs.
     
    Same problem though.
     
    I found some 4gb cards on sale and bought a handful.
     
    Cheers
     
    Ptb
  9. Like
    OzGrant reacted to Rei Vilo in How to use External editor   
    If you're a Windows user, give Visual Micro a try. It's a plug-in for Visual Studio.
     
    In case you're a Mac user, there's a similar solution with embedXcode, a plug-in for Xcode.
  10. Like
    OzGrant got a reaction from phaseform in [Energia Library] OneWire DS18B20 (430 & Stellaris)   
    Tks Pivden,
    Yes your correct, no idea how the microsec's snuck through, they seem to do that at 2AM.
    Have updated the zip file.
    Tks again
    GFDS18B20V2.zip
  11. Like
    OzGrant reacted to Rei Vilo in IoT with LaunchPad CC3200: Exploring the Existing Services   
    I've started a new series Exploring IoT, the Internet of Things on my Embedded Computing website.
    The idea is to explore the different services available for IoT. 

    What are their features? How easy to implement and use them? 

    I'll try and keep the same project along all the offers, a weather station, and run it for one day. The weather station measures temperature, humidity, pressure and light, and reports data every 30 minutes. 
    Already tested:
    Blynk IoT OTG IoT with Exosite IoT with Sparkfun Data and analog.io To be continued...
         
  12. Like
    OzGrant reacted to bubba198 in Launch4j An error occurred while starting the application???   
    that is defenitely a Windows 7 64bit thing, same exact setup works fine under 32bit. I guess it has to do with the path. Under 64bit one must copy the libraries under \hardware\msp430 folder to work but under 32bit it works fine if the libraries are located in their normal location in the sketch directory 
  13. Like
    OzGrant reacted to gerbs in Launch4j An error occurred while starting the application???   
    yeah!! success!!
     
    simple find  the preferences.txt file in >>>>
     
    c:\Users\MyComputerName\AppData\Roaming\Energia\preferences.txt
     
    I renamed the Energia folder in this directory as OLDEnergia
     
    Then I relaunched Energia V16 from a shortcut I made to the desktop.  No need to run as Admin.
     
    Once Energia 16 runs it makes a new preferneces.txt file in a new Energia Folder in the c:users\MyComputerName\AppData\Roaming directory
     
    That's all
  14. Like
    OzGrant reacted to abecedarian in 5529 sets an output before setup()   
    "CODE" tags- the button in the advanced editor ("More Reply Options") with "<>" on it, or manually type in [ CODE] and [ /CODE], without any space after the opening brace.
    const char Sketch[]="AjonFlash20 "; const String BTADDR1="+ADDR:2013:9:11"; // this is BT #3 //From bildr article: http://bildr.org/201...ncoder-arduino/ #define intest 0 // no test //#define intest 1 // in test #define test 0 // no test //#define test 1 // Serial.print state and choice #include "MspFlash.h" #include "IRremote.h" #include "LiquidCrystal.h" #include "rgb_lcd.h" #include <Wire.h> #include <FRAMX.h> //#include <SoftwareSerial.h> //#define BT_TX 39 //#define BT_RX 40 //#define BT_KEY 38 //boolean GFuseold=true; #define bannerLength 72 #define MAXIR 22 // number of buttons on IR controller #define MAXTEXT 6 //number of inputs requiring Text #define MAXDEFINES 9 // now includes balance(Left/Right)Offset and mmStatus. Defines used in FRAM stating at 0x10 #define USESMALL true // true for SMALL vero card //#define USESMALL false for LARGE vero card #define greenLED 12 //6apr2015 P2_7 //was P7_4 //=17 // was 9 moved to allow link #define blueLED P2_6 //=13 // was 8 #define output1 P1_4 //apr15 WAS #define output1 P3_5 #define output2 P1_5 //apr15 WAS #define output2 P3_6 #define output3 P4_0 #define output4 P8_2 #define output5 P7_0 #define output6 P2_4 //apr15 WAS #define output6 P3_7 #define power P2_5 //apr15 WAS #define power P3_2 //P6_6 // was P3_7 #define mute P8_1 //apr2015 was P6_6 #define fetPin P1_3 #define linkOut P7_4 #define linkIn P1_4 #define pinMM P2_6 #define LEDRATE 400 #define w 0 //white #define r 1 //red #define g 2 //green #define b 3 //blue #define p 4 //pale blue #define y 5 //yellow #define v 6 //violet #if USESMALL // SMALL vero #define encoderPin1 19 //was 2; #define encoderPin2 18 //was 3; //6apr2015 #define encoderSwitchPin 8 //6apr2015 WAS P2_3 //12 //push button switch #define RECV_PIN P1_6 //was 6 #else //BIG vero #endif boolean mytest=true; boolean doingBalance=false; boolean mmStatus=true; boolean muteState=true; String sData; //SoftwareSerial BTSerial(BT_RX,BT_TX); //Bluetooth RX | TX //Initialize the FRAM and use the default FRAM address that's provided FRAMX fram(FRAMX::FRAMX_I2C_DEFAULT_ADDRESS); unsigned char bytes_read; //Initialize to known data so we can tell if transactions are actually having the desired effect static unsigned char read_buffer[10] ={0xDE,0xAD,0xBE,0xEF,0xDE,0xAD,0xBE,0xEF,0xAA,0xAA}; static unsigned char write_buffer[10]={0xDE,0xAD,0xBE,0xEF,0xDE,0xAD,0xBE,0xEF,0xAA,0xAA}; unsigned char start_address = 0; unsigned char bytes_to_transfer = 1; // do not exceed the length of your read and write buffer unsigned long readcodes[16]; unsigned long FetMute; uint32_t framIr[MAXIR]; //IR codes from FRAM0 0x20 uint8_t framChr[MAXIR]; //IR Chr code from FRAM 0x20 String framText[6]; // Text from FRAM 0xB0 uint8_t framDefines[MAXDEFINES]; //Defines from Fram 0x10 int16_t countLast=0; int16_t countNow=0; uint8_t aBalance=0, bBalance=0; uint8_t balanceRightOffset=0; uint8_t balanceLeftOffset=0; uint16_t balanceDefault=0x3F; String sVersion; String EEwrite; String sTemp; char cTemp; int8_t iTemp; int8_t jTemp; char cArray[]={" "}; uint8_t i; uint8_t j; char cmdNum; int inByte = 0; // incoming serial byte #define sMenu0 "Grant 0422179043" // was const char sMenu0[]={"Grant 0422179043"}; #define blankLine " " char sInputSelect0[]={"Input Select "}; char sInputSelect1[]={"123456 "}; char work; unsigned int state = 0; char inputIs = 0; volatile int lastEncoded = 3; volatile long encoderValue = 0; long lastValue; unsigned int encoderSteps = 16; //used for altering LCD back light long startTime = 0; long lastencoderValue = 0; long l; unsigned int encoderPWM; unsigned int encoderVolume; boolean ledState = true; boolean redState = 1; // Led Off boolean greenState = 1; // Led Off boolean blueState = 1; // Led Off boolean pollEncoder =false; int lastMSB = 0; int lastLSB = 0; long previousMillis = 0; long currentMillis; boolean doPrint=false; int8_t choice=-1; boolean LedState=false; //int RECV_PIN = 6; //11; unsigned long myvalue; IRrecv irrecv(RECV_PIN); decode_results results; boolean IRcommand =false; byte IRgot; boolean doText =false; //construct words unsigned int mycount=0; rgb_lcd lcd; unsigned int mode =0; boolean haveData=false; boolean haveData4=false; int EEinputs=6; //=5; int EEsteps=2; //=3; int EEstepsTest=1; //EEsteps=EEstepsTest; //6apr2015 WAS uint16_t EElight=80; uint8_t EEvolume[6] ; //={10,20,30,40,50}; unsigned long EEscale[9] ; uint8_t EElastInput=0; uint8_t EEpwm=0xFF; byte square[8] = { // make some custom characters: 0b00000, 0b00000, 0b11111, 0b11111, 0b11111, 0b11111, 0b00000, 0b00000 }; byte filler[8] = { // make some custom characters: 0b00000, 0b00000, 0b00000, 0b10101, 0b10101, 0b00000, 0b00000, 0b00000 }; char lastDecode; boolean doOnce; boolean powerUp = true; boolean allowIRcommands; unsigned int redPWM = 255; unsigned int greenPWM= 255; unsigned int bluePWM = 255; boolean doOnceMute=false; boolean lcdSleep=false; unsigned long lcdPreviousMillis; unsigned long lcdTimeout; boolean doLCDsleepTest = true; uint8_t EEtimeout; int LCDred; int LCDgreen; int LCDblue; //6apr2015 boolean sleepingNew = false; int ii; int EEstepsTemp; int EEstepsOrg; char irDirect = ' '; boolean copyToIrFram = false; boolean copyToTextFram = false; boolean copyToDefinesFram= false; boolean dimIt = false; boolean doTimeOutTest; // if false never turn off LCD boolean linkTest = false; ///////////////////////////////////////////////////////////////////
  15. Like
    OzGrant reacted to roadrunner84 in Swapping pins for OneWire   
    Yeah. For option 1 you need to replace all calls like ds.foo() by ds->foo(). For option 2, I forgot to add "void " in front of SetPin(...
  16. Like
    OzGrant reacted to roadrunner84 in Swapping pins for OneWire   
    Maybe a stupid suggestion, but, did you put in the curly brace open?
    //Original code #include "TM4C_DS18B20.h" DS18B20 ds(PIN_OW); //New Code #include "TM4C_DS18B20.h" setup() { // <--- THAT brace should be there!! DS18B20 ds(PIN_OW); ... } Also, if you declare it in the setup() scope, it is NOT available in the loop() scope!
    You could declare it in the global scope and create it in the setup() scope, maybe.
    #include "TM4C_DS18B20.h" DS18B20 *ds; setup() { static DS18B20 _ds(PIN_OW); // create a static instance, so it's available after setup() is finished ds = &_ds; // point ds to the address of _ds, so it's available to loop() ... } Another option is to crudely make an override routine to set another pin AFTER construction.
    //In DS18D20.h, inside the class under public, add this line SetPin( uint8_t pin) { _OWPIN = pin; } //At least, if you're using the library I found //Use this in your code #include "TM4C_DS18B20.h" DS18B20 ds(0); setup() { ds.SetPin(PIN_OW); ... }
  17. Like
    OzGrant reacted to Eddie in Launch4j An error occurred while starting the application???   
    Hi to all, 
     
     
    I have the same problem on Windows 7 64 bit, E13 work weel, but when I download E14, and E15 when I started it only de error message apear (Launch4j An error occurred while starting the application). 
     
    I try to delete libraries from  "My Documents/Energia/libraries" and the aplication started, I tried to copy the lbraries one by one and I found when in library folder exist exaple file ( *.ino) the aplications does not start.
     
    In consecquence the solution is to delete/move all *.ino file from "My Documents/Energia/libraries" subdirectories. So worked for me.
     
    I hope I helped.
  18. Like
    OzGrant got a reaction from pine in I2C scanner for 2553 & 5529   
    Fixed. For some reason Energia requires a Wire.write() before Wire.endTransmission() command. to get a valid returned value.
    Have fun.
    Grant
     
    -----------------------------------------------------------------------
    // I2C scanner for M430G2553 // Added  Wire.write(1);  for sketch to work. // Grant Forest May 2014 #include <Wire.h> uint8_t error, address; void setup () {     Serial.begin(9600);     Serial.println("G'Day MyI2C_ScannerV1");     Wire.begin(); } void loop () {   Serial.print(" Scanning...");   for(address = 1; address < 127; address++ )   {     Wire.beginTransmission(address);     Wire.write(1);  ///////////////////////////////////// sketch works ok when this line added     error = Wire.endTransmission();     if (error==0) {       Serial.print("Found Address 0x");       if (address<15) Serial.print('0');       Serial.print(address,HEX);       Serial.print(", ");       }   }          Serial.println();          delay(2000); } --------------------------------------------
  19. Like
    OzGrant got a reaction from larsie in [Energia Library] OneWire DS18B20 (430 & Stellaris)   
    Opps, zip file now attached
    GFDS18B20.zip
  20. Like
    OzGrant got a reaction from Rei Vilo in SOLVED! DHT22 Temp & RH% One-Wire Sensor on Energia   
    DHT22 now works on the Tiva and can now get on with where I was 3 days ago with the F5529, but now have the freedom of rom space.
     
    I must commend Rei VILO on his smart use of #define DEBUG, this made lib fault-finding a breeze. Be nice if all libs have this sort of feature, so that later lib iterations (to cater for new devices)  can be checked.
     
    One bug I had (not sure if you can call a hardware bug a bug- never mind) was R9 & R10. They are zero link resistors that connect pins 14 & 23 together, as well as linking pins 15 & 24 together. Was getting all sorts of strange results until I unsoldered them.
    Grant
  21. Like
    OzGrant reacted to !Qwert in msp430 peripherals to tm4C123G peripherials   
    Okay, I found out that using pinMode, digitalWrite and digitalRead works and I can understand how my capacitive sensor is implemented. I got my sensor to get the number of cycles I am expecting since it is allowing the sensor to be discharged and charged at a rate where I can get better readings.
    Since the board is running at 80MHz, one cycle is 0.0125us so if I am not touching the pin, the value will be around 40 cycles with 4M ohm pulling it high. Then if I touch the sensor, the number jumps to ~200.
     
    I am still figuring out why the port manipulation does not work but the pinMode, digitalWrite and digitalRead works.
     
    Here is how I defined my readCapacitancePin() without port manipulation:
    uint32_t readCapacitivePin(int pinMeasure){ //First Discharge the pin before starting pinMode(pinMeasure,OUTPUT); digitalWrite(pinMeasure,LOW); delay(1); //Charging the pin to HIGH without internal pull up //have an external resistor to pull up the pin to +5V pinMode(pinMeasure,INPUT); int cycles = 2000; //The tiva board clk is at 80MHz, tested which large value would be enough for the pin to charge and discharge the sensor //External pull-up is around 4M Ohm to +5V for(int i = 0; i < cycles; i++){ if(digitalRead(pinMeasure) == HIGH){ cycles = i; break; } } //Discharge the pin for more readings in the future pinMode(pinMeasure,OUTPUT); digitalWrite(pinMeasure,LOW); pinMode(pinMeasure,INPUT); return cycles; } Is it when pin is defined to portDATARegister(digitalPinToPort(pinToMeasure)) that it cannot tell if this is referring as an input or output so that is why every time I touch the sensor the number of cycles always the fixed value I put in readCapacitancePin()?
  22. Like
    OzGrant reacted to KittyHawk in [ Energia library ] MSP430 internal temp sensor   
    Library for MSP430 internal temperature sensor usage. This sensor is not very precise but can be used if necessary.

    You can access source code and see example file here:
    https://github.com/JFF-Bohdan/msp430intertempsensor

    Notice, that you can use float values for temperature or int16 (also with decimal part of temperature value). When using int16 temperature will be returned in this way:
    23.5 C will be returned as 235 (0xEB) integer value; 54.3 C will be returned as 543 (0x21F) integer value When using float values (on my MSP430G2553) memory usage will be like this:
    binary sketch size: 7 625 bytes (of a 16 384 byte maximum)

    When using int16 memory usage will be:
    binary sketch size: 3 359 bytes (of a 16 384 byte maximum)
  23. Like
    OzGrant reacted to abecedarian in How to use Serial1 with Tiva   
    @@OzGrant
    Perhaps this is relevant: https://github.com/energia/Energia/issues/278
    "Serial1 on LaunchPad Stellaris: UART(1) is active on PC_4 / PC_5 but not on PB_0 / PB_1"
     
    Energia, I believe, treats LM4F/Stellaris and TM4C123/Tiva as the same.
  24. Like
    OzGrant got a reaction from spirilis in Tips on reducing SRAM footprint with Energia/MSP430   
    The IR codes take up a bit, but by the time you add SD, Bluetooth, WIFI, OneWire, RTC, RF controlled power outlets, and the Rules interpreter, it all adds up. I needed more space for the FRAM to complete the project. I have ported over to the Tiva, and the same code now uses  53K, but with a max(I hope) of  262K will not run out of rom now.
    The Tiva does take away five pins, that were available on the F5529, and will have to do another pcb artwork edit, but the Tiva board size is slightly smaller, allowing an easier fit of the USB cable.
     
    Not too sure if this thread is best to state a few observations, but here goes with my
  25. Like
    OzGrant reacted to Thorvard in [Energia Library] Petit FatFS SD Card Library   
    Hi, i just wanted to report that the library won't compile with Energia release 0101E0011 and the F5529 Launchpad because "DIR" is already defined in \energia-0101E0011\hardware\tools\msp430\msp430\include\msp430f5529.h line 3900: 
    /* USBCTL Control Bits */ #define DIR (0x0001) /* USB - Data Response Bit */ renaming all "DIR" references in the Petit-FATFS library and examples to "_DIR" works as a workaround.
     
    regards, Nick
×
×
  • Create New...