Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by altineller

  1. Hello, Is it possible to use the XDS110 debug probe with Energia? And if so, how? Best regards, -C.
  2. I have made a simple implementation of an ANN that runs on the Tiva-C and 5529 using c++. It basically is a spiking neural network where the input is summed, and if above threshold, that neuron fires all the axons with 1 * W. There is also a mechanism of decay of the firing rate each time the neuron runs, and a mechanism to modify the neurons firing time, (the more the sum is, the quicker it fires, with in a range.) So the output from each neuron is always one, but the frequency differs. So, it is a trivial spiking neural network but it works. I already connected 4 light sensors, 4 input neurons, 1 hidden layer of 4 neurons, 2 output neurons to motors, and obtained a robot that goes around the light like a fly. @spirilis are there other implementations for embedded platforms for neural networks, that runs on TI products? would anyone be interested in the ANN code, if i make it opensource will anyone help me to make it better? I would be very interested in modifying it so it runs on the c2000. basically it would benefit from a fpu. all it does is sum and multiply floating point numbers. ~Best
  3. Hello, What is the status of Wire.h when using energia with the tiva-c board? Since there is the BoardManager in E18, the file layout has changed. Which leads to some confusion. eagle@daredevil:~$ find . -type f -name "Wire.h" ./.energia15/packages/energia/hardware/msp432/3.8.0/cores/msp432/ti/runtime/wiring/Wire.h ./.energia15/packages/energia/hardware/msp430/1.0.2/libraries/Wire/Wire.h ./.energia15/packages/energia/hardware/tivac/1.0.2/libraries/Wire/Wire.h ./.energia15/packages/energia/hardware/msp432r/5.6.0/cores/msp432r/ti/runtime/wiring/Wire.h ./bin/energia-1.6.10E18/hardware/energia/msp430/libraries/Wire/Wire.h ./bin/energia-1.6.10E18/hardware/energia/msp430/cores/msp430/Wire.h So I think when using energia with tivac, it will use the .energia15/packages/energia/hardware/tivac/1.0.2/libraries/Wire/Wire.h file that is in the hidden .energia directory right? Then I went ahead and edited the Wire.cpp file in the tivac/1.0.2 dir. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <inttypes.h> #include "wiring_private.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "inc/hw_ints.h" #include "inc/hw_i2c.h" #include "driverlib/gpio.h" #include "driverlib/debug.h" #include "driverlib/interrupt.h" #include "driverlib/rom.h" #include "driverlib/rom_map.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" #include "driverlib/i2c.h" #include "Wire.h" Here is a list of include files from Wire.cpp. So here is my question: is this Wire.cpp implementation is for TM4C? is it using or based on the TivaWare Peripheal library? I intend to make some modifications for it, for example using 2 i2c ports at the same time. So I need to start at the correct place. Any ideas / help greatly reccomended. Best regards, CA
  4. Has anyone seen the : Mini-M4 for Tiva-C https://download.mikroe.com/documents/starter-boards/mini/tiva/mini-m4-tiva-manual-v100.pdf Would it be safe to assume that it could run energia? Best, C.
  5. Hello, After installing E18, and getting the TivaC board package with packages manager, when I try to upload a program into the Tiva-C board I get the following error: fork/exec /home/can/.energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/arm-none-eabi-g++: no such file or directory Error compiling for board LaunchPad (Tiva C) w/ tm4c123 (80MHz). If I go the the mentioned directory, I can see that the arm-none-eabi-g++ executable exists by: $ file arm-none-eabi-g++ arm-none-eabi-g++: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, stripped I have no /lib/ld-linux.so.2 on my system. It used to be we needed to install a package named ia32libs on ubuntu systems. But unfortunately on ubuntu 16.04 64, I could not find this package. And here is my uname -a Linux daredevil 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Any ideas / recomendations / help greatly appreciated, Best, C.
  6. Hello, Is there any way to figure out if a Tiva-C board is being powered with the usb connector, or from an external power supply connected to vbus? This is the problem I am facing: I am poweing Tiva-C board from the vbus connector, on a robot. At times we need to connect the usb cable for programming. Since VBUS is connected to external battery, it will "some times" (most of the time) - crash the computer. So I am using a pololu switching regulator, with a shutdown control pin. What I would like to do is, the device to figure out if usb power is being used, and shutdown the external power supply. I did search the web and found out that PD_7 is the vbus detect pin, and just digitalRead on that pin would lead to result, but I tested it, and found out it does not work. Any ideas/help/recommendation is greatly appreciated.
  7. yes i did. i tried all the spi dividers upto div128. tomorrow, i am going to hookup a logic analyzer to spi pins and try to debug and post the results. Sent from my iPhone using Tapatalk
  8. hello, i have the 5110 working with tivaC. i think i had to change the spi clock divider and spi mode. also i remember, different batches of screen from different sources required different settings. Sent from my iPhone using Tapatalk
  9. Hello, yes I set the CS as explained in my previous reply. I also checked the ds3232 sheet, and for CS it is active when it is low. I got this from the ds3234 datasheet, And on codewise: void DS3234_set_addr(const uint8_t pin, const uint8_t addr, const uint8_t val) { digitalWrite(pin, LOW); SPI.transfer(addr); SPI.transfer(val); digitalWrite(pin, HIGH); } the CS pin is pulled low, and then spi transfer is made in two operations always, then CS pin is pulled high. Is this correct? Best regards, C.
  10. Hello, Yes, I configured the CS pin as output. Relevant init code as follows: const int CS = PB_5; void DS3234_init(const uint8_t pin, const uint8_t ctrl_reg) { pinMode(pin, OUTPUT); SPI.setModule(2); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV16); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE3); DS3234_set_creg(pin, ctrl_reg); delay(100); } For some reason it will not read values the right way. I put a serial.print(char); in the for loop where it reads time, and figured out it will read only 0x00. The code works on the msp430g5529. Best regards, C.
  11. Hello, I am having trouble using a SPI DS3234 RTC with Energia and TivaC series launchpad. I am using the ds3234 library at https://github.com/rodan/ds3234 which is originally written for arduino. I modified few settings in the initialization, tried few things, but have not had any luck. The module will not talk spi at all, and I get 1900.00.00 00:00:00 for date all the time. Here is the relevant code from the init section: void DS3234_init(const uint8_t pin, const uint8_t ctrl_reg) { pinMode(pin, OUTPUT); SPI.setModule(2); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV32); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE3); DS3234_set_creg(pin, ctrl_reg); delay(10); } First off I am setting spi port 2, before spi.begin. I tried all clock_dividers. The ds3234 supports upto 4mhz spi speed, so considering 80mhz clock speed for tivac board, I am using a div32 divider. I also scanned all of the dividers. I tried spi_mode 1 and 3 also. I also checked with an oscilloscope, that I am indeed talking with SPI2 port. (I can see the clock and cs lines with little spikes, when the tiva-c sends commands). For some reason the SPI port in the TivaC is unable to talk with this RTC chip. I could not figure out why. I tested the same code on a MSP430F5529 with the RTC connected to SPI0 port, and it worked as expected. Here is the relevant part for that one: (I only commented out the setModule statement, and used the div8 divider) void DS3234_init(const uint8_t pin, const uint8_t ctrl_reg) { pinMode(pin, OUTPUT); //SPI.setModule(2); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV8); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE3); DS3234_set_creg(pin, ctrl_reg); delay(10); } I also found a forum post at http://forum.43oh.com/topic/9016-ds3234-rtc-peek-poke/ which complains about not being able to peek / poke the internal SRAM of the ds3234 - but unfortunately was not answer. I am speculating this too arises from similar SPI trouble. Any ideas/recomendations/help greatly appreciated, Best Regards, C.
  12. Hello All, I made a PID controller, using a TivaC board and VNH2SP motor driver and encoder motors, which are read by the hardware QEI. All works well, and I have been able to get more resolution and run it faster and with smoother output compared to my previous implementations on arduino. Also, because of the QEI, it is much less components and wiring on the circuit side. Right now I am using double for PID calculations. Would I benefit from using float ? I am inclined to give it a try, but I wanted to ask in this forum. How is double and float handled in TM4C123 platform. Best Regards,
  13. Hello, I am using the latest energia release 0101E0017 and suddenly analogWrite and PWMWrite does not work on my TivaC Board, with TM4C123 #define EN_A PF_0 #define EN_B PF_1 #define IN1 PE_0 #define IN2 PE_1 #define IN3 PE_3 #define IN4 PE_2 #include <wiring_analog.c> void setup() { pinMode(EN_A, OUTPUT); pinMode(EN_B, OUTPUT); pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); } void loop() { PWMWrite(EN_B, 256, 16, 1000); } I tried few different ports as well. When the PWMWrite or analogWrite statement is run, the pin will just go high. I have tested with a scope that PWM signal is not generated. Now the interesting thing - I fired the following code on the same setup, this time using Servo.h - connected to RED_LED and It works. #include <Servo.h> Servo myservo; void setup() { myservo.attach(PF_1); } void loop() { myservo.write(5); } What do I need to do in order to get PWM working with this TivaC board? Best regards, C.
  14. Hello @@chicken, I am trying to use your library for a PPM decoder. (PPM as in radio control standard) Basically I need to do a: attachInterupt(PIN, isr_routine, CHANGE); in the setup, then: timer.start(); isr_routine() { process_value = timer_val; timer.reset(); // process the value } So I basically need to be able to start a timer on demand, and read value of it, then reset it, but programmatically, not by reading a pin? Any ideas on how to modify this library to accomplish something similar? The arduino equivalent of this code is below: #define PPM_Pin 3 int ppm[16]; void setup() { Serial.begin(115200); pinMode(PPM_Pin, INPUT); attachInterrupt(PPM_Pin, read_ppm, CHANGE); TCCR1A = 0; //reset timer1 TCCR1B = 0; TCCR1B |= (1 << CS11); //set timer1 to increment every 0,5 us } void loop() { } void read_ppm() { static unsigned int pulse; static unsigned long counter; static byte channel; counter = TCNT1; TCNT1 = 0; if(counter < 1020){ //must be a pulse if less than 510us pulse = counter; } else if(counter > 3820){ //sync pulses over 1910us channel = 0; } else{ //servo values between 510us and 2420us will end up here ppm[channel] = (counter + pulse)/2; channel++; } } I have done many experiments, and mostly in CCS using the MSP430g2xx3_TA_21.c, where timer can be used in input capture mode, measuring time for both rising and falling edge, and it can be calculated from there. However, I need to read this data and then transmit it tru serial or i2c, which was beyond my abilities at the moment, so I decided to do it with energia for now. Any ideas/reccomendations/help greatly appreciated. Best regards, C.
  15. Thanks, well I have multiple motors with different encoders, so I will try soon. It would be really exciting to get that board working with high res QEI. Yes about sensors you mentioned `my sensors did not have the state both high` what does this mean? I have square wave sensor outputs, usually overlapping to a degree, and if on falling edge of A, B is high that is forward, and if the falling edge of A has B low, that is reverse. Would that be sufficient? Best regards, C.A.
  16. Hello Rhab, In the past I made a pid controller for pololu n20 motors with encoders. (tiny little motors) At the beginning I was using an optical encoder, which turned out to be problematic, (since they require external signal processing, and output not square but sine wave, and that sine wave can change in amplitude and offset depending on the position of the encoder disk to the sensor, they were problematic) Then I got the same encoders with hall effect sensors, which did indeed output pure square wave. I then used interrupts to read encoder outputs, and driving two motors with the tiva-c board did indeed work, but for encoders that worked > 300 pulse per revolution, I had problems (due to interrupt traffic) - then I stopped working on the project all together. Did you get your code to work using this QEI encoders? Can you assign any pin to read encoder input, and is it possible to drive two motors from one tiva-c board? I have read the thread carefully but I was not able to make a conclusion. Best regards, C.
  17. Hello All, I am working on a circuit on phase comparison. I managed to build an edge sensitive phase detection circuit, like in the 4046 PLL using only nand gates. The phase detector outputs phase differences, and depending on sign of phase (that is which pulse comes first, CLK or SYNC) it will output a phase difference signal, negated if phase is negative. The logic analyzer output is shown below: The first capture at the top is when CLK comes first. As you can see the signal labeled PHASE at below correctly outputs a pulse for phase difference in falling edges of the incoming CLK and SYNC. In the second capture, SYNC comes first. PHASE now is outputting a signal that is negated from what was before. (active low) I need a logic output circuit that will take those PHASE output, or (outputs, if we hook two circuits, and hook up the CLK and SYNC in reverse order) and convert it to 2 isolated electrical outputs, if like in capture 1, one pin should send the signal, and if like capture 2, the other pin should send the signal. Any ideas or recomendations greatly appreciated, Best Regards, C.
  18. Hello, I too want to use the QEI for a project, and I was wondering which launchpad you are using: The title says "EK-TM4C123GXL" which is the Tiva-C series connected launchpad? Is this correct? Best regards, C.A.
  19. Hello, I am currently working on syncronizing two RTC's, where I am using a Tiva-C series TM4C123 Launchpad. I basically have two ISR's like: void rtc_isr() { time_micros = micros(); rtc_flag = true; } void sync_isr() { sync_micros = micros(); sync_flag = true; } void loop() { if(rtc_flag) { mcu_offset = time_micros - prev_time_micros; prev_time_micros = time_micros; DS3231_get(&timestamp); print_time(); rtc_flag = false; } if(sync_flag) { sync_offset = sync_micros - time_micros; long derivative = prev_sync_offset - sync_offset; if(derivative>0) { aging--; } else if(derivative<0) { aging++; } if(aging>126) { aging = 126; } if(aging<-126) { aging = -126; } prev_sync_offset = sync_offset; print_sync(); sync_flag = false; } } That measures time in micros coming from local rtc and the remote rtc. By comparing the time_micros and sync_micros, I change the aging parameter in one of the RTC's (ds3231) which adds 0.1ppm per significant bit to the temperature stabilized crystal. So the algorithm to fine tune the ppm's are noway complete, and I know this is not the proper way. But it syncs. The problem is that when clocks are beating exactly at the same time, with <2microseconds, strange things happen. Basically one ISR will get executed first, or later, or delayed to the next cycle. Also, tru debugging I have observed sometimes, but when the clocks are exactly the same, there will be a 1000microseconds delay. I dont know how, but probably the energia interrupt handler is doing it. I need to find the reason of this delay. After fiddling a bit, (I was using seperate ports for each interrupt), I put the interrupts on the same port. (PC4 and PC5) - If the both are triggered at the same time, PC4 will execute first, and then PC5 I have the following question: How can I write my own interrupt handlers in energia, without using energia's interrupt handler. I just need to execute var a = micros() on the falling edge of an interrupt. How can i reach from one ISR if the other one has been triggered? What are some general principles for dealing with interrupts firing simultaneously, with respect to time measurement. (i.e. if we need to record time at that instance) With my current setup, I can syncronize the RTC's within 2-3 microseconds. Here is a picture of my current setup: Any ideas / recomendations / help greatly appreciated. Best regards, C.A.
  20. Hello, I know this is an old post but how is two timers being used? and what is the advanage of using wdt timer for this, instead of timerA. Best regards, C
  21. Hello, pinMode(P5_5, INPUT) will return a compiler error due to P5_5 not being defined. I understand the naming scheme has changed, I tried P55, P_55 and 55 with no luck. How do we refer to pins for msp432 for making a simple digitalRead? Best regards, C.
  22. Hello, Upon more debugging and coding, I found out that if you access i2c from a function driven by a clock, it crashes the sketch. For the above code if I move the measure_parameters inside the loop, and comment out the clockMeasure, it will run. Best regards, C.A.
  23. Hello, I got my msp432 LP and started porting some of my previous code to the newer Energia MT, using the clock library. I want to measure number of variables from my sensors, and display them on the Sharp LCD board. Namely: float sensors[15]; Clock clockDisplay; Clock clockMeasure void setup() { ... clockDisplay.begin(update_display, 1000, 1000); clockDisplay.start(); clockMeasure.begin(measure_parameters, 1000, 100); clockMeasure.start(); ... } void update_display() { screen.clearBuffer(); screen.text(10, 10, floatToString(buffer, sensors[1], 2, 5, false)); screen.flush(); } void measure_parameters() { sensors[0] = ina219_A.getShuntVoltage_mV(); sensors[1] = ina219_A.getBusVoltage_mV(); sensors[2] = ina219_A.getCurrent_mA(); ... } So I have two clocks, one measuring and storing sensor values in a float array, the other (should be) displaying the values from the float array on to the LCD screen. I have verified that both the sensor reading and the display to be in working order indepedently, but it appears that the float[] is not accessible to both of the methods, i.e. it is not shared memory. What are the possible ways to fix this? What approaches should I take when I am dealing with this kind of system? Previously I used millis() inside the loop, to count, and trigger certain functions when the time is appropriate. It seems to me that Energia MT with MSP432 is really really nice, and I am planing to build all my new code on this. @@Rei Vilo We need more solid examples. Any help/ideas/recomendations are greatly appreciated. Best regards, C.A.
  24. I will make a speed test for this with a signal generator, and scope. For many reasons, writing to energia ports are sometimes slow. I just could not fix my bricked 5529 and waiting for a new one. Best, C.A.
  25. Hello, I am uploading a working test of a very simple program that works with https://github.com/energia/Energia/tree/issue_696build of energia. I had to download this from github as a zip file, then also download emt-master.zip, and unzip it into the emt directory. Then I changed dir to build and issued: ant dist There were few problems, one being it did not find energia.h, so I had to change it to Energia.h Then I also had to copy Clock.h and Clock.cpp and Sharp library files, as well as rtosGlobals.h and then by looking at multiblick with clock example, I wrote the following code, just displaying a number each 100ms. #include "SPI.h" #include "LCD_SharpBoosterPack_SPI.h" #include "rtosGlobals.h" #include "Clock.h" LCD_SharpBoosterPack_SPI screen; uint16_t count = 0; Clock clockDisplay; void updateDisplay() { count++; // rtosscreen.clearBuffer(); screen.text(10, 10, String(count, 10)); screen.flush(); } void setup() { Serial.begin(9600); screen.begin(); screen.clearBuffer(); screen.setFont(1); screen.setOrientation(0); clockDisplay.begin(updateDisplay, 1000, 100); // 1000 ms = 1 s clockDisplay.start(); } void loop() { } So I created a clock with an update function that will increment a number each time it is triggered. In the original implementation with delay, since the display takes 50ms to update, for 100ms delay, after running 60 * 10 times, it would display a number like 450 instead of 600. The code above will yield the correct numbers. (will count to 600 in 60 seconds) - For longer tests, I found that it is a little slower than iphone clock. Best Regards, C.A. LCD_SharpBoosterPack_SPI_main.tar.gz
  • Create New...