Jump to content
43oh

icserny

Members
  • Content Count

    29
  • Joined

  • Last visited

Reputation Activity

  1. Like
    icserny reacted to energia in Cannot start Energia-0101E0015   
    That's an odd one. Could you post a list of libraries (or attach them in a zip file) so that I can look into this?
  2. Like
    icserny got a reaction from bluehash in Cannot start Energia-0101E0015   
    Finally I could find the exact symptom:
    Energia 15 could not start if the Energia/libraries folder (located in my user Documents directory) contains anything from my previous developments. It starts however, when that folder is empty.
     
    Similar problems were reported in the case of the Arduino IDE 1.0.x and 1.6.x as well. See in this forum: http://forum.arduino.cc/index.php?topic=167553.0
     
    Thank you for your attention!
  3. Like
    icserny got a reaction from bluehash in PF0_output_tm4c123gxl   
    The PF0 pin shoud be unlocked before setting its mode
    The code fragment is from an example program from the J. Valvano's EDX course "Embedded Systems - Shape The World"
    See lines at step 2).
      SYSCTL_RCGC2_R |= 0x00000020;     // 1) activate clock for Port F   delay = SYSCTL_RCGC2_R;           // allow time for clock to start   GPIO_PORTF_LOCK_R = 0x4C4F434B;   // 2) unlock GPIO Port F   GPIO_PORTF_CR_R = 0x1F;           // allow changes to PF4-0   // only PF0 needs to be unlocked, other bits can't be locked   GPIO_PORTF_AMSEL_R = 0x00;        // 3) disable analog on PF   GPIO_PORTF_PCTL_R = 0x00000000;   // 4) PCTL GPIO on PF4-0   GPIO_PORTF_DIR_R = 0x0E;          // 5) PF4,PF0 in, PF3-1 out   GPIO_PORTF_AFSEL_R = 0x00;        // 6) disable alt funct on PF7-0   GPIO_PORTF_PUR_R = 0x11;          // enable pull-up on PF0 and PF4   GPIO_PORTF_DEN_R = 0x1F;          // 7) enable digital I/O on PF4-0
  4. Like
    icserny got a reaction from TivaFan2341426460014 in TM4C129 Internal Tempsensor   
    The latest official version of Energia (energia-0101E0012) does not define TEMPSENSOR for the TM4C1294 MCU. The suggested solution discussed at https://github.com/energia/Energia/pull/364# does not work for me. The function call to analogRead(TEMPSENSOR) is hanging the program. I have found a quick and simply solution for the problem, so anyone can use it until a better solution will be found.
     
    1. Add this line to file pins_energia.h in folder Energia/hardware/lm4f/variants/launchpad_129
       #define TEMPSENSOR PB_1 //Will be translated to ADC_CTL_TS 2. In the same file modify the following line (in the definition of array digital_pin_to_analog_in[], near to end of file):
    NOT_ON_ADC, // 95 - PB_1 unrouted simply replace it by
    ADC_CTL_TS, // 95 - PB_1 unrouted These modifications define the TEMPSENSOR symbol and will select the internal temperature sensor when readAnalog(TEMPSENSOR) is called.
     
    Here is a simple example sketch:
    uint32_t val; float temp;  void setup() {   Serial.begin(9600); } void loop() {   delay(1000);   val = analogRead(TEMPSENSOR);   Serial.print("adc:");         //raw ADC data   Serial.print(val);   temp = 147.5 - 75*3.3*val/4096;    //temperature in Celsius   Serial.print("  temp:");         Serial.println(temp,1); } Good luck!
     
    Istvan Cserny
  5. Like
    icserny got a reaction from CorB in TM4C129 Internal Tempsensor   
    The latest official version of Energia (energia-0101E0012) does not define TEMPSENSOR for the TM4C1294 MCU. The suggested solution discussed at https://github.com/energia/Energia/pull/364# does not work for me. The function call to analogRead(TEMPSENSOR) is hanging the program. I have found a quick and simply solution for the problem, so anyone can use it until a better solution will be found.
     
    1. Add this line to file pins_energia.h in folder Energia/hardware/lm4f/variants/launchpad_129
       #define TEMPSENSOR PB_1 //Will be translated to ADC_CTL_TS 2. In the same file modify the following line (in the definition of array digital_pin_to_analog_in[], near to end of file):
    NOT_ON_ADC, // 95 - PB_1 unrouted simply replace it by
    ADC_CTL_TS, // 95 - PB_1 unrouted These modifications define the TEMPSENSOR symbol and will select the internal temperature sensor when readAnalog(TEMPSENSOR) is called.
     
    Here is a simple example sketch:
    uint32_t val; float temp;  void setup() {   Serial.begin(9600); } void loop() {   delay(1000);   val = analogRead(TEMPSENSOR);   Serial.print("adc:");         //raw ADC data   Serial.print(val);   temp = 147.5 - 75*3.3*val/4096;    //temperature in Celsius   Serial.print("  temp:");         Serial.println(temp,1); } Good luck!
     
    Istvan Cserny
  6. Like
    icserny reacted to Rei Vilo in Change millis() / micros() to use Systick on Tiva based boards   
    It's a pity none of the LaunchPads leverages the battery power input for the RTC. It is always hard-wired to the main power supply. Using a coin-cell battery would be great!
  7. Like
    icserny reacted to L.R.A in Change millis() / micros() to use Systick on Tiva based boards   
    I'm sorry, i've been trying to create a pull-request but i just can't do it. it always went to arduino istead of energia so i'll just post here...
    i guess i'm not geting into github at least today
    is it in issues i should make this kind of sugestions?
     
    I want to sugest a change in the milis()/micros() fuctions   I'm realy don't exacly know how to read code in direct access coding but i belive millis() uses micros() to count wich uses TIMER5 right?   Well i think this is a big waste of a timer wich can be used for PWM, pulse measuring or sometigh else since Tiva has a dedicated timer for that, the system tick.   i use this to simulate millis() void SysTickbegin(){ SysTickPeriodSet(F_CPU/1000);// for miliseconds, F_CPU/1000000 for microseconds SysTickIntRegister(SycTickInt); SysTickIntEnable();   } void SycTickInt(){ milis++; //micros++ if period set to F_CPU/1000000 }   it's also possible to use the Tiva RTC for this since it's possible to get the 1/32768 ticks but it would have a error less than 0.3 micro seconds each microsecond. This would be make possible even to use the milis() as a RTC counter and would probably be a better option.
  8. Like
    icserny got a reaction from L.R.A in TM4C129 Internal Tempsensor   
    The latest official version of Energia (energia-0101E0012) does not define TEMPSENSOR for the TM4C1294 MCU. The suggested solution discussed at https://github.com/energia/Energia/pull/364# does not work for me. The function call to analogRead(TEMPSENSOR) is hanging the program. I have found a quick and simply solution for the problem, so anyone can use it until a better solution will be found.
     
    1. Add this line to file pins_energia.h in folder Energia/hardware/lm4f/variants/launchpad_129
       #define TEMPSENSOR PB_1 //Will be translated to ADC_CTL_TS 2. In the same file modify the following line (in the definition of array digital_pin_to_analog_in[], near to end of file):
    NOT_ON_ADC, // 95 - PB_1 unrouted simply replace it by
    ADC_CTL_TS, // 95 - PB_1 unrouted These modifications define the TEMPSENSOR symbol and will select the internal temperature sensor when readAnalog(TEMPSENSOR) is called.
     
    Here is a simple example sketch:
    uint32_t val; float temp;  void setup() {   Serial.begin(9600); } void loop() {   delay(1000);   val = analogRead(TEMPSENSOR);   Serial.print("adc:");         //raw ADC data   Serial.print(val);   temp = 147.5 - 75*3.3*val/4096;    //temperature in Celsius   Serial.print("  temp:");         Serial.println(temp,1); } Good luck!
     
    Istvan Cserny
  9. Like
    icserny got a reaction from Rei Vilo in TM4C129 Internal Tempsensor   
    The latest official version of Energia (energia-0101E0012) does not define TEMPSENSOR for the TM4C1294 MCU. The suggested solution discussed at https://github.com/energia/Energia/pull/364# does not work for me. The function call to analogRead(TEMPSENSOR) is hanging the program. I have found a quick and simply solution for the problem, so anyone can use it until a better solution will be found.
     
    1. Add this line to file pins_energia.h in folder Energia/hardware/lm4f/variants/launchpad_129
       #define TEMPSENSOR PB_1 //Will be translated to ADC_CTL_TS 2. In the same file modify the following line (in the definition of array digital_pin_to_analog_in[], near to end of file):
    NOT_ON_ADC, // 95 - PB_1 unrouted simply replace it by
    ADC_CTL_TS, // 95 - PB_1 unrouted These modifications define the TEMPSENSOR symbol and will select the internal temperature sensor when readAnalog(TEMPSENSOR) is called.
     
    Here is a simple example sketch:
    uint32_t val; float temp;  void setup() {   Serial.begin(9600); } void loop() {   delay(1000);   val = analogRead(TEMPSENSOR);   Serial.print("adc:");         //raw ADC data   Serial.print(val);   temp = 147.5 - 75*3.3*val/4096;    //temperature in Celsius   Serial.print("  temp:");         Serial.println(temp,1); } Good luck!
     
    Istvan Cserny
  10. Like
    icserny got a reaction from abecedarian in TM4C129 Internal Tempsensor   
    The latest official version of Energia (energia-0101E0012) does not define TEMPSENSOR for the TM4C1294 MCU. The suggested solution discussed at https://github.com/energia/Energia/pull/364# does not work for me. The function call to analogRead(TEMPSENSOR) is hanging the program. I have found a quick and simply solution for the problem, so anyone can use it until a better solution will be found.
     
    1. Add this line to file pins_energia.h in folder Energia/hardware/lm4f/variants/launchpad_129
       #define TEMPSENSOR PB_1 //Will be translated to ADC_CTL_TS 2. In the same file modify the following line (in the definition of array digital_pin_to_analog_in[], near to end of file):
    NOT_ON_ADC, // 95 - PB_1 unrouted simply replace it by
    ADC_CTL_TS, // 95 - PB_1 unrouted These modifications define the TEMPSENSOR symbol and will select the internal temperature sensor when readAnalog(TEMPSENSOR) is called.
     
    Here is a simple example sketch:
    uint32_t val; float temp;  void setup() {   Serial.begin(9600); } void loop() {   delay(1000);   val = analogRead(TEMPSENSOR);   Serial.print("adc:");         //raw ADC data   Serial.print(val);   temp = 147.5 - 75*3.3*val/4096;    //temperature in Celsius   Serial.print("  temp:");         Serial.println(temp,1); } Good luck!
     
    Istvan Cserny
  11. Like
    icserny got a reaction from chicken in [Energia Library] Bosch BMP085 Template Library   
    Hi @@chicken
     
    Thank you very much for your BMP085 library. It works nicely also with the Software I2C Master Library for MSP430G2553 written by Rei Vilo. I tested with MSP430G2 Launchpad and a BMP180 breakout module (bought from Ebay). In the attached screenshot the final value of the pressure was corrected for altitude (that's why the dumped value of p and the pressure are different).
     
    Istvan Cserny
     

  12. Like
    icserny reacted to Rei Vilo in [Energia Library] Software I2C Master for MSP430G2553   
    Release 104
    Distribution-104.zip
  13. Like
    icserny got a reaction from Rei Vilo in [Energia Library] Software I2C Master for MSP430G2553   
  14. Like
    icserny reacted to Lyon in Stellaris launchpad LM4F120 - Using UART7   
    Hi,
    Starting with LM4F/Tiva, TI changed the registers to provide clock gating control to all peripherals, particularly to UART. This new register is named "Run Mode Clock Gating Control" RCGCUART and is placed at 0x400FE000+0x618. Inside this registers are eight bits, R7..R0, each controlling one UART, R7 being for UART7, 1=enabled, 0=disabled. (LM4F120 manual, page 379).
    You can easily make a macro for all UARTs to be used (Valvano's is a bit outdated, but for learning is OK; TI kept for legacy projects also those three old registers).
    L
  15. Like
    icserny got a reaction from JVimes in Development kit terminology (newbie question)   
    You can by an MSP-TS430PN80USB - MSP43055xx USB 80-Pin Target board which is suitable for that. See at: https://estore.ti.com/MSP-TS430PN80USB-MSP43055xx-USB-80-Pin-Target-board-P1631.aspx
     
  16. Like
    icserny got a reaction from developer_bt in SOLVED! DHT22 Temp & RH% One-Wire Sensor on Energia   
    This value of 12 may not be sufficiently large. The best solution is to gather some statistics (see my previous comment in #27).
  17. Like
    icserny got a reaction from zborgerd in Renesas Arduino-compatible board   
    I have got recently a promotional GR-Sakura board from Renesas EU. You can apply for one here (if you live in Europe): http://www2.renesas.eu/support_all/registrations/rx_foc_board/index.html
     
    The most importan think that this board "can be programmed via USB mass storage mode. GR-SAKURA becomes a USB memory drive on your PC when it is plugged. To run your software, just drag and drop the sketch.bin created by Web Compiler." The basic concept behind this is that you don't need to install anything on your computer (you can use even your Android tablet or mobile).
     
    The board has an Arduino form factor, but it has on board Ethernet and can have USB host function as well. 
     
    The short description of the board is here: http://sakuraboard.net/gr-sakura_en.html
     
    Th CPU is a high performance 32-bit RX63N 100-pin R5F563NBDDFP
    Operating frequency: 96 MHz (single precision FPU, on-chip multiplication/division)
    Flash ROM: 1M Bytes, RAM?128K bytes, Data flash?32K bytes The main board features are:
    USB device function (mini-B?or USB host (A) (these are alternatives, so cannot be used at the same time) Download by USB mass storage EtherNet (RJ45) MicroSD jacket (can share data with PC) Arduino compatible sockets Many extra I/O connections Header for the E1 programmer/debugger User forum and community support at: http://renesasrulz.com/?loc=EU (I think it is the same as http://renesasrulz.com/?loc=US)
    But the most interesting information can be found in a separate forum at http://japan.renesasrulz.com/?loc=JP
    These are so much separated that you shoud register yourself separately (so you will have double identity... :-) ) and the links cannot be used directly from one to the other.
     
    I think the Web compiler principle is a good idea - in theory, but is very slooooow for editing and file handling. Another drawback that uploading and downloading does not work as expected. I quickly had to find a way for offline compiling. I installed the free KPIT GNU toolset since the Web Compiler is using that tools too.
     
    However, a small modification was necessery in the makefile created by the Web Compiler: I had to add the compiler options: -mgcc-abi -m32bit-doubles
    An example project (a project template) was published here: http://renesasrulz.com/app_kits_and_demo_boards/gadget_renesas_user_forum/m/mediagallery/510.aspx , but is is a bit outdated by now.
     
    In this (offline) way the project development is much more convenient for me and I am satisfied with the command line compilation.
     
    Of course, the HEW IDE can be also used: a "no toolchain" (i.e. IDE without the Renesas compiler) vesion of HEW is also avaliable at http://www.kpitgnutools.com/
    which can be combined with the KPIT GNU toolchain. However, I see no any advantage of this solution (i.e. usage of HEW) unless you buy an E1 debugger. If you want to generate a .bin file by HEW, here is the recipe: http://renesasrulz.com/app_kits_and_demo_boards/gadget_renesas_user_forum/w/wiki/260.hew-for-gr-sakura.aspx  (HEW produces .x ELF file, which should be converted to .bin format for the USB flash drive download method.
     
    If you are interested in my DHT22 project, please see it at http://renesasrulz.com/app_kits_and_demo_boards/gadget_renesas_user_forum/f/128/t/3871.aspx
    This is an adaptation of the Adafruit's DHT library, where the biggest problem was to find the correct timing parameter. The Sakura board is much faster, than Arduino so the "discrimination level" should be 20 and not 6 as in the Arduino library. (I already wrote about this problem in the Energia forum .
     
    If you are curious (so was I) about the Ethernet capability of the Sakura card then have a look to this project (in Japanese, of course...):
    There is a very simle example (just say Hello in the web browser window) which seems to work. You should add the SPI and Ethernet libraries as well.
    Link: junkroom2cyberrobotics.blogspot.hu/.../arduinogr-sakura-ethernet1.html
    This is a very simple "web server" example (just say Hello in the web browser window). You should add the SPI and Ethernet libraries to your project as well.
     
    Summarising the thing: the GR-Sakura board is an excellent tool for hobbists. The lack of detailed software documentation and the low number of example projects can be a serious problem for the beginners. I hope that this promotional campaign can gather the critical mass of users which helps to overcome this problem.
     
    Another major problem that - at present - the libararies are published in precompiled format only. This is a serious drawback and avoids the community development. I think this situation should be changed as soon as possible. Without open source libraries such a development platform cannot be taken seriously (for example I would not let my students to waste their valuable time with such a closed source platform which hides those details from them which they sould have to learn), and cannot compete with other platforms like Arduino, or similar projects.
  18. Like
    icserny got a reaction from spirilis in Renesas Arduino-compatible board   
    I have got recently a promotional GR-Sakura board from Renesas EU. You can apply for one here (if you live in Europe): http://www2.renesas.eu/support_all/registrations/rx_foc_board/index.html
     
    The most importan think that this board "can be programmed via USB mass storage mode. GR-SAKURA becomes a USB memory drive on your PC when it is plugged. To run your software, just drag and drop the sketch.bin created by Web Compiler." The basic concept behind this is that you don't need to install anything on your computer (you can use even your Android tablet or mobile).
     
    The board has an Arduino form factor, but it has on board Ethernet and can have USB host function as well. 
     
    The short description of the board is here: http://sakuraboard.net/gr-sakura_en.html
     
    Th CPU is a high performance 32-bit RX63N 100-pin R5F563NBDDFP
    Operating frequency: 96 MHz (single precision FPU, on-chip multiplication/division)
    Flash ROM: 1M Bytes, RAM?128K bytes, Data flash?32K bytes The main board features are:
    USB device function (mini-B?or USB host (A) (these are alternatives, so cannot be used at the same time) Download by USB mass storage EtherNet (RJ45) MicroSD jacket (can share data with PC) Arduino compatible sockets Many extra I/O connections Header for the E1 programmer/debugger User forum and community support at: http://renesasrulz.com/?loc=EU (I think it is the same as http://renesasrulz.com/?loc=US)
    But the most interesting information can be found in a separate forum at http://japan.renesasrulz.com/?loc=JP
    These are so much separated that you shoud register yourself separately (so you will have double identity... :-) ) and the links cannot be used directly from one to the other.
     
    I think the Web compiler principle is a good idea - in theory, but is very slooooow for editing and file handling. Another drawback that uploading and downloading does not work as expected. I quickly had to find a way for offline compiling. I installed the free KPIT GNU toolset since the Web Compiler is using that tools too.
     
    However, a small modification was necessery in the makefile created by the Web Compiler: I had to add the compiler options: -mgcc-abi -m32bit-doubles
    An example project (a project template) was published here: http://renesasrulz.com/app_kits_and_demo_boards/gadget_renesas_user_forum/m/mediagallery/510.aspx , but is is a bit outdated by now.
     
    In this (offline) way the project development is much more convenient for me and I am satisfied with the command line compilation.
     
    Of course, the HEW IDE can be also used: a "no toolchain" (i.e. IDE without the Renesas compiler) vesion of HEW is also avaliable at http://www.kpitgnutools.com/
    which can be combined with the KPIT GNU toolchain. However, I see no any advantage of this solution (i.e. usage of HEW) unless you buy an E1 debugger. If you want to generate a .bin file by HEW, here is the recipe: http://renesasrulz.com/app_kits_and_demo_boards/gadget_renesas_user_forum/w/wiki/260.hew-for-gr-sakura.aspx  (HEW produces .x ELF file, which should be converted to .bin format for the USB flash drive download method.
     
    If you are interested in my DHT22 project, please see it at http://renesasrulz.com/app_kits_and_demo_boards/gadget_renesas_user_forum/f/128/t/3871.aspx
    This is an adaptation of the Adafruit's DHT library, where the biggest problem was to find the correct timing parameter. The Sakura board is much faster, than Arduino so the "discrimination level" should be 20 and not 6 as in the Arduino library. (I already wrote about this problem in the Energia forum .
     
    If you are curious (so was I) about the Ethernet capability of the Sakura card then have a look to this project (in Japanese, of course...):
    There is a very simle example (just say Hello in the web browser window) which seems to work. You should add the SPI and Ethernet libraries as well.
    Link: junkroom2cyberrobotics.blogspot.hu/.../arduinogr-sakura-ethernet1.html
    This is a very simple "web server" example (just say Hello in the web browser window). You should add the SPI and Ethernet libraries to your project as well.
     
    Summarising the thing: the GR-Sakura board is an excellent tool for hobbists. The lack of detailed software documentation and the low number of example projects can be a serious problem for the beginners. I hope that this promotional campaign can gather the critical mass of users which helps to overcome this problem.
     
    Another major problem that - at present - the libararies are published in precompiled format only. This is a serious drawback and avoids the community development. I think this situation should be changed as soon as possible. Without open source libraries such a development platform cannot be taken seriously (for example I would not let my students to waste their valuable time with such a closed source platform which hides those details from them which they sould have to learn), and cannot compete with other platforms like Arduino, or similar projects.
  19. Like
    icserny got a reaction from energia in SOLVED! DHT22 Temp & RH% One-Wire Sensor on Energia   
    Here is a late addendum to the original problem:
     
    As it was pointed out by Robert (in message #15), the discrimination of '1'-s from '0'-s is based on a simple comparison:
    if (counter > 6) The constant value of 6 is the "discrimination level". This value is good for the AVR chips, but is too small for other cards like MSP430 Launchpad, ChipKit UNO32, or GR-Sakura. The latest version of the Adafruit's DHT library therefore allows us to use an optional parameter to specify the preferred value of the "discrimination level".
     
    But how can you determine the optimal value? Especially, if you don't have an oscilloscope at home...
    Here comes the idea: let's print the observed counter values, then we can see some statistical distribution of these values.
    I added some debug features (which compile conditionally when the DEBUG symbol is defined.
     
    1. Declare an array bytes having 40 elements.
        uint8_t res[40]; 2. Store the counter values for each of the 40 bits (just before the above mentioned comparison)
    #ifdef DEBUG             res[j] = counter; #endif 3. At the end of DHT::read(void) function, print out the results:
    #ifdef DEBUG     for(i=0; i<j; i++) {         Serial.print(res[i],DEC);         Serial.print(" ");         if(i%8 == 7) {             Serial.println();         }     }   Serial.println(j, DEC);   Serial.print(data[0], HEX); Serial.print(", ");   Serial.print(data[1], HEX); Serial.print(", ");   Serial.print(data[2], HEX); Serial.print(", ");   Serial.print(data[3], HEX); Serial.print(", ");   Serial.print(data[4], HEX); Serial.print(" =? ");   Serial.println(data[0] + data[1] + data[2] + data[3], HEX); #endif The result of a typical run on an MSP430G2553 can be seen here:
    66 7 7 6 6 7 7 21
    6 21 6 7 7 21 21 7
    6 6 7 7 6 6 7 21
    7 6 6 7 21 7 21 6
    6 21 6 22 6 7 21 7
    40
    1, 46, 1, A, 52 =? 52
    Humidity: 32.6 %    Temperature: 26.6 *C
    7 7 7 6 6 7 7 21
    6 22 6 7 7 21 21 6
    6 6 7 7 6 6 7 21
    7 6 7 7 21 7 21 21
    7 21 7 21 7 6 22 20
    40
    1, 46, 1, B, 53 =? 53
    Humidity: 32.6 %    Temperature: 26.7 *C
    7 7 7 6 6 7 7 21
    6 22 6 7 7 21 21 6
    6 7 7 7 6 7 7 21
    6 6 7 7 21 7 21 21
    7 21 6 21 6 6 21 21
    40
    1, 46, 1, B, 53 =? 53
    Humidity: 32.6 %    Temperature: 26.7 *C
     
    You see, that the results can be divided in two groups: low values are 6 or 7 which means '0' and higher values of 20-21-22, which means '1'. In this case 15 is a good value for the discrimination level.
     
    So this is how the poor man's tool can substitute oscilloscope.  :thumbup: 
     
    Best regards,
    Istvan Cserny
     
×
×
  • Create New...