Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by PTB

  1. PTB

    Mini-M4 TivaC

    Interesting. I too would be interested to know if it is energia friendly.
  2. PTB

    Noise in ADC

    Hmmmm then I'm out. That's all I got. Does kinda sound like a bad batch.
  3. PTB

    Noise in ADC

    Are the good ones and the bad ones using the same power supply? I was getting "wobbly" adc readings due to a cheap power supply. Problem went away when I used a more quality power supply. In my case an iPhone charger. Cheers PTB
  4. PTB

    GPS logger for a local Beagle club

    Every time I look at this project I can't help but think what an amazing job you have done on every aspect of this. Especially the hardware. Outstanding !! Cheers PTB
  5. I think TI have a typo in their documentation. One doc says 12000 and another says 1200. I'm betting on 1200
  6. PTB

    3 MSP430FR5969 not working

    Bad USB cable?
  7. PTB

    How to store data in TM4C

    You could also use some kind of external storage. If the data isn't too much you could store in an external eeprom chip. I2c or spi. Alternatively you could use an sd card.
  8. I got a lot of help for stellaris in this thread here. Very similar to Tiva Might be of use http://forum.43oh.com/topic/7153-stellaris-fast-analog-reads/?p=65472
  9. PTB

    Sensor design

    Hi, This might be an idea. http://ams.com/eng/Products/Magnetic-Position-Sensors/Angle-Position-On-Axis/AS5048A I have bought some of these with a view to a future project. Haven't started yet due to no free time. They sell a reasonably priced adaptor kit and an expensive demo kit. There's a library here. https://github.com/ZoetropeLabs/AS5048A-Arduino Might be of use ...... Might not. Cheers PTB
  10. PTB

    Have feedback for TI? Please share here.

    Hi, Just wondering if there is any errr... Feedback from Ti on our feedback. Cheers Ptb
  11. PTB

    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
  12. PTB

    Have feedback for TI? Please share here.

    Just my 2c for what its worth. 1) Yeah... me too on the international postage. Its a bit of a show stopper for me. I've gone to order a few things and then its "oh yeah that's right... forgot about that" and cancel the order. It was crazy cheap before. Maybe somewhere in the middle ground would be sustainable from both customer and providers point of view. 2) The info may be out there and I haven't been able to find it but it would be great to have some real basic info for moving a project from a Launchpad to a standalone bare bones circuit without an actual launchpad. I can do it with an Arduino, but not with any of the TI chips. I have looked at the Launchpad schematics, but am more interested in the minimum it needs to run. I'm a bit of a numpty when it comes to this stuff. Forgive me. Maybe provide template kicad/eagle schematics with the minimum requirements and the hobbyist can add their extra circuitry to that and make their own boards. 3) I like the cloud tools page. Some nice things in there in an uncluttered easy to find location. https://dev.ti.com/ 4) Really like energia. Its got some issues, but full credit to the guys undertaking the mammoth task of progressing it on many fronts. I promise I'll learn CCS one day.... honest. And as always.... thanks to Blue# for the site. Cheers PTB
  13. PTB

    Where is Energia Library in Mac

    I think it is under LM4F
  14. PTB

    43oh wins TI Community Highlight Award

    Nice ! Well deserved man. This site is the reason I got into TI Microcontrollers. You've created a great environment that has attracted some really knowledgeable and helpful folks. (And thanks again to all those guys by the way). Congratulations on the award. PTB
  15. PTB

    Best LaunchPad Projects?

  16. And here are some example flash curve images, both single flash and multiple flash. The curves with multiple flash are currently only possible by using two of the circuit boards and two launchpads. One for measuring and one for firing off required sequence.
  17. Camera Flash Timer and Measurement Tool This project is an amalgamation of many other ideas and projects by other brilliant folks plus my own twist on things. Hopefully I have given credit to all those whose work I have expanded upon and incorporated. Apart from libraries, I have written the majority of the code from scratch implementing what I have learnt from this and other forums. Still quite a few bugs and it is probably 80 - 90% complete. I did get some perspex laser cut for it, but I didnt have the right software for it and borked the file conversion and received cute little minature versions. Will have another shot at that in the near future. Particular mention goes to the following folks for their posts and/or help. Maurice Ribble, Creator of the Camera Axe and Original Multiflash. @@RobG , Colour LCD with Touch https://www.tindie.com/products/RobG/color-lcd-boosterpack-touch/ I would be lost without this boosterpack and assistance. @@jkabat , http://forum.stellarisiti.com/topic/684-stellaris-fast-analog-reads/ John's Assistance with the Fast Analog reads required was awesome. Thanks! @@Rei Vilo, For help on many matters. @@calinp, For the porting of PetitFatfs. @@bluehash, For the SD card boosterpack. I have pretty much directly copied this circuit into my board. Thanks guys Main Components. RobG's Touchscreen Booster Pack. Stellaris Launchpad SD Card Socket I2C EEPROM Flash Sensor OptoIsoloators for Flashes Indicator LEDs Phototransistor Useage Takes the original flash signal and triggers up to 8 additonal flashes. The flashes can be either fired instantly or via delayed timings of which there are multiple modes. - Instant - Constant - Varies - Factor Increasing - Factor Decreasing - Synchronize It can also measure T0.1 and T0.5 camera flash durations via another menu. For ages I couldn't figure out what the spike was prior to many of the flash measurements. I am thinking it is a prepulse to the main flash which helps ionize the flash prior to main burst. If that's what it is, I am pretty stoked I can see it. Just need to modify my calcs routine to ignore it. http://en.wikipedia.org/wiki/Flashtube The purpose of measuring the flash lags and durations is an attempt to align flashes with different characteristics so that they are as closely synced as possible which removes ghosting of images. Jkabats help with fast analog routine has been key to achieving the 1Msps sampling rate. As each flash is profiled, the full curve data is stored in an I2C EEPROM along with summary details. This is then extracted by the Synchronize routine to set the delays for each flash. I have 7 different modes for aligning the flashes timewise. The results don’t differ too much depending on choice of method. 1. Peak (default) 2. T0.1 Midpoint 3. T0.1 Centroid of area under curve 4. T0.5 Midpoint 5. T0.5 Centroid of area under curve 6. Full Curve Midpoint 7. Full Curve Centroid of area under curve The faster flashes are held back, and they all cross the finish line at the same time. The whole flash array inherits the lag of the slowest flash. All the data from the I2C chip can be written to an SD Card for further analysis on a PC. Here is the data ported to excel. Code The code is still underway but most things are working. This is version 0.26 PTB_Flash_Measurement_Tool.zip (The main file is PTB_Iridium.INO . Will need to create folder structure to suit) Schematic This is the current schematic but will be updated in the near future to fix some problems. Multiflash 3.sch.pdf Stellaris Launchpad Mods Remove Resistors R2, R9, R10, R11, R12. Bugs and Issues Slowly working through things. 1. Flash Port 3 isn't firing for some reason. I think it used to. I wonder if it is related to issue #2 below. 2. I ran into strife with my indicator leds. They are Dual Colour red/blue and then I got a better understanding of forward voltage. The blue is very close to the operating voltage of 3.3v. I have done arduino thing before this and it was all 5v, so it caught me. (again) I am waiting on some lower resistance arrays, but I think this may create other problems to do with how much current the Stellaris can sink. http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/45816.aspx Sooooo... I plan to redo the schematic in the near future implementing a darlington array to drive the optos and indicator leds. Gotta think that through. It will be my third board revision. Can't keep doing that forever. 3. I seem to be only able to get it to run with Energia 0009 at the moment. Later versions don't seem to work with touch screen. Deffo my Software issue. 4. I2C EEPROM Speeds are very slow. There is a lot of data I am writing in there, but I think some better coding on my part will help a lot. Luckily that only really affects 2 operations. The rest is zippy enough. 5. Haven't written code for reading back from SD card into I2C EEPROM Chip. 6. I seem to have some kind of problem with I2C addressing. I think its an Energia Wire library thing which may have been fixed in later versions. I had a 24lc512 but I wanted more space so I dropped in a 24lc1025 which I then found is like 2 different addresses. Couldn't write to one bank without writing to the other, so it defeated the purpose. I want more space to save longer curves from more powerful flashes. It is currently good enough to deal with common flashes at full power. 7. I too have the problem of scanning the I2C bus and getting an address found at every address. The I2C Eeprom works as required though. More as I think of them..... Cheers PTB
  18. PTB

    Stellaris Launchpad and timers

    Hi L.R.A Here's a link to the project thread I am working on. http://forum.43oh.com/topic/7346-stellaris-launchpad-camera-flash-timer-and-measurement-tool/?p=65887 I just added an update to help paint a better picture of what I am doing. Basically it is a flash timer and flash measurement tool. Currently I can get it to fire a user defined sequence or I can get it to measure a photographic flash pulse. But I cant get it to do both at the same time. I am hoping timers will help me with that. My plan was have the main program handle the Analogread to array while the timers are popping off those ports as listed in post above. The reason I want to run both those events at the same time is I wish to fire off a timed sequence of flashes and measure the resultant combined flash pulse of that sequence. The goal is to confirm the timed delay settings are correct and have aligned the flash pulses. Aligning the pulses will remove ghosting from the photographic images. This generally applies to mixing different types of flashes. I could buy several flashes of the same type and set them exactly the same. But where would the fun be in that Thanks PTB
  19. Hi Guys, Another learning experience for me. I'm toying with the idea of implementing timers into my project which uses the STELLARIS launchpad LM4F. I've never used timers before so the questions are going to be pretty dumb. I think due to the choices of pins I have used, I may not be able to do it. I have 8 ports set to trigger in a sequence. The ports I am using are as per below and I suspect I may not be able to use timers due to using ports PA4 and PE1. I got the info from page 665-666 in http://www.datasheets.pl/integrated_circuits/L/LM/LM4F120H5QR.pdf Flash # Port Pin Name General-Purpose Timers Signals (64LQFP) ========================================================== 1 PF4 T2CCP0 16/32-Bit Timer 2 Capture/Compare/PWM 0. 2 PA4 ? NIL ? 3 PD0 WT2CCP0 32/64-BitWide Timer 2 Capture/Compare/PWM 0. 4 PD2 WT3CCP0 32/64-BitWide Timer 3 Capture/Compare/PWM 0. 5 PE1 ? NIL ? 6 PD6 WT5CCP0 32/64-BitWide Timer 5 Capture/Compare/PWM 0. 7 PC6 WT1CCP0 32/64-BitWide Timer 1 Capture/Compare/PWM 0. 8 PC4 WT0CCP0 32/64-BitWide Timer 0 Capture/Compare/PWM 0. Am I right in assuming I wont be able to use a timer on PA4 or PE1 ? And secondly, if I can get timers to trigger those 8 ports would they be able to trigger independently of other running code and not screw with this Fast Analog Read routine at the same time. http://forum.43oh.com/topic/7153-stellaris-fast-analog-reads/?p=65472 Would just like to know if it is possible and if so I'll see if I can get it happening. Thanks PTB
  20. Thought I would post an update on this project to help paint a picture with my other questions in other threads. Hardware ======== I have gone to a new board layout which utilises the following new features. a) ULN2003 Darlington arrays to drive the leds. The old arrangement didnt have enough grunt to drive the leds off the mcu. Separated the bi-colour LEDS into separate discreet leds. Blue for Focus and Red For Shutter. c) Returned to 3.5mm Audio jacks instead of RJ45 jacks. Easier to get off the shelf cables. d) Added an extra booster pack set of pins in parallel. e) Moved design from Eagle to KiCAD Schematic Iridium Schematic.pdf e) I added a digital pot in an endeavour to make the light sensor auto-ranging for light levels. I failed on many fronts here. Firstly I screwed up big time on the chip socket. I somehow got a 18pin part in the board layout from a 16 pin part in the schematic. I only found out when I went to plug in the chip and the socket was too big. Nice work on my part. I am looking into making a small adaptor board to use the 16 pin chip in the 18 pin socket. Secondly, my thoughts of desensitising the phototransistor via programmable resistance appears futile anyway because the problem is actualy the phototransistor saturating. Adding resistance as per the circuit isnt going to help on that front. Did a bit of research on professional lightmeters and it would appear they cope with the problem by putting different strength filters on their light sensors and then you read off a different scale depending on which filter is in there. f) And lastly but certainly not leastly. @@Fred made me some awesome laser cut panels for the new design. These are sensational. I added some infill to the laser engraving and it looks better than the photo appears. Software ======== Lots of minor tweaks and improvements. Code updated to Energia 15. One of the really annoying things was misbehaviour of Some of the GPIO's It appears wire.begin(); screws up GPIO PD0 and PD1 I can turn pins PD0 and PD1 on and off at will until wire.begin(); is executed. After that PD0 is stuck Low and PD1 is stuck high. Fixed with info from this thread..... http://forum.43oh.com/topic/7421-new-energia-release-0101e0012-03202014/?p=60448 Thanks to @reaper and @@spirilis for that thread. And thanks again to @L.R.A for getting fast analog read back for me in Energia 15. Current Version 0.40 Here Iridium_v0.40.zip This code is very much a work in progress with lessons constantly being learnt. Still Working On ========== Investigating using timers instead of loops to trigger sequences. Cheers PTB
  21. +1 to what cubeberg said. I had a noisy wall wart that would make my analog readings look like an earthquake seismograph. Might be that. Might be something else.
  22. Hi Rob, I have a few of the early LCD Booster Packs. Love 'em. Have never used the sd card slot on the booster pack as I have one elsewhere in my project. If I was redoing it from scratch I would forego my sd card socket for yours. I think it should definitely stay. Its such a nice to have. Two booster packs in one Great for data logging. I'd be happy to pay a little extra to save extra hassle implementing elsewhere. Be nice to not have to worry about soldering it. Cheers PTB
  23. Hi folks, I would like to do some pretty fast analog reads with the stellaris board. Preferably just from one pin. I loaded a snippet of code using 100 sequential reads .... Sample[0]=analogRead(PE_3); Sample[1]=analogRead(PE_3); Sample[2]=analogRead(PE_3); Sample[3]=analogRead(PE_3); Sample[4]=analogRead(PE_3); Sample[5]=analogRead(PE_3); Sample[6]=analogRead(PE_3); .... etc. And measured the time in microseconds at the beginning and end => and got 1434 microseconds to reel in 100 samples Assuming my maths is right, that's ~69,400 samples per second or one sample every 14.4 microseconds. I would love to get this down to pretty close to 1 sample every microsecond or as close as possible to it. I am doing the code in energia as this is what I am most comfortable with. I had a play with Code Composer but I have decided that is for smarter folks than me. Have found some very interesting links for the arduino for speeding up analog reads http://forum.arduino.cc/index.php/topic,6549.0.html Plus some other links using external ADC chips (doesn't suit me as I don't have enough spare pins, Though I could change a few things to get them if it was my only option) http://bobdavis321.blogspot.com.au/2013/06/arduino-powered-3-million-samples-per.html Soooo..... Are there any tricks (Energia style) you folks know of where I could squeeze a bit higher sampling rate? Its all very early days at the moment and I am just trying to sort out my plan of attack. Any advice or suggestions greatly appreciated. Thanks PTB (The perpetual Noob)
  24. L.R.A. You are the man ! Its working. Number of Samples : 255 Sample Starttime : 3143376 Sample Endtime : 3143888 Sample Array Set Duration time in microseconds : 512 ======================= Now this is only 0.5 MSPS instead of 1 BUT.... the old code would sometimes do that anyway. Sometimes it was 1MSPS sometimes it was 0.5MSPS. At least now its consistent. 1MSPS would be obviously nicer, but this is still pretty great. I will splice this back into my main code and see how she goes. I'll do further project based posts in another thread. I've made some priceless mistakes..... I'm not ashamed to share Thanks heaps !!!! Really Appreciate it. Cheers PTB P.S. BTW I tried with and without this line SysCtlDelay(3); It didn't seem to mind either way. Working Code under Energia 15 // // LM4F_ADC // A Stellarisiti Collaborative effort // JKabat, Rei Vilo, reaper7,L.R.A. PTB. // // Include application, user and local libraries // Define variables and constants /// /// @file Fast_Analog_Read.ino /// @brief Main sketch /// /// @details Fast Analog Read Investigations for Stellaris LM4F /// // // Stellaris Pin Assignments // ========================= //PE_3 //Sensor Analog Read //PA_5 //Trigger Analog Signal Pulse //PF_4 //Push Button to Start // // Libraries // ========= #include "Energia.h" #include "SPI.h" #include "inc/lm4f120h5qr.h" #include "inc/hw_adc.h" #include "inc/hw_gpio.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "driverlib/adc.h" #include "driverlib/gpio.h" #include "driverlib/sysctl.h" #include "driverlib/rom.h" // // Constants from adc.c // ==================== #define ADC_SEQ (ADC_O_SSMUX0) #define ADC_SEQ_STEP (ADC_O_SSMUX1 - ADC_O_SSMUX0) #define ADC_SSFIFO (ADC_O_SSFIFO0 - ADC_O_SSMUX0) #define ADC_SSFSTAT (ADC_O_SSFSTAT0 - ADC_O_SSMUX0) #define SEQUENCER 0 // // Global Constants // ================ const byte SampleQty = 255; // number of samples const uint16_t buttonPin = PUSH1; // the number of the pushbutton pin const uint16_t ledPin = GREEN_LED; // the number of the LED pin const uint16_t TriggerPin = PA_5; // Analog Signal Trigger connected to digital pin PA_5 // // Global Variables // ================ uint16_t SampleTest; uint16_t buttonState = 0; // variable for reading the pushbutton status uint16_t Sample[SampleQty]; // Array variable to store the value coming from the sensor //unsigned long SampleStartTime; uint32_t SampleStartTime; //unsigned long SampleEndTime; uint32_t SampleEndTime; //unsigned long SampleDuration; uint32_t SampleDuration; //unsigned long faBase; uint32_t faBase; // // Prototypes // ========== uint16_t fast_analogInit(uint8_t pin); uint16_t fast_analogRead(void); ///************************************************************************** /// /// Setup code /// ///************************************************************************** void setup() { Serial.begin(9600) ; //Debugging initialize the serial communication: pinMode(ledPin, OUTPUT); // initialize the LED pin as an output: pinMode(buttonPin, INPUT_PULLUP); // initialize the pushbutton pin as an input: pinMode(TriggerPin, OUTPUT); // initialize the Trigger pin as an output: Serial.println("Stellaris Fast Analog Read"); Serial.println("=========================="); Serial.println(""); Serial.println("Press SW1 to commence test"); }//end setup ///************************************************************************** /// /// Loop code /// ///************************************************************************** void loop() { buttonState = digitalRead(buttonPin); // read the state of the pushbutton value: if (buttonState == LOW) { digitalWrite(ledPin, HIGH); // turn LED on: Serial.println("Initialising Stellaris Fast Analog Read"); fast_analogInit(PE_3); Serial.println("Stellaris Fast Analog Read Initialised"); SampleStartTime = micros(); digitalWrite(TriggerPin, HIGH); // Start the Analog Signal for (uint16_t i=0;i<SampleQty;i++) { Sample[i] = fast_analogRead(); } SampleEndTime = micros(); //Dump results to serial monitor for (uint16_t i=0;i<SampleQty;i++) { Serial.println(Sample[i]); } Serial.print("Number of Samples : "); Serial.println(SampleQty); Serial.print("Sample Starttime : "); Serial.println(SampleStartTime); Serial.print("Sample Endtime : "); Serial.println(SampleEndTime); SampleDuration = SampleEndTime - SampleStartTime; Serial.print("Sample Array Set Duration time in microseconds : "); Serial.println(SampleDuration); }// end if delay(1000); digitalWrite(ledPin, LOW); // turn LED off: }//end loop ///************************************************************************** /// /// Fast Analog Read Routine /// ///************************************************************************** uint16_t fast_analogRead(void) { // #define DEBUG #ifdef DEBUG Serial.println("1"); #endif uint32_t value[8]; #ifdef DEBUG Serial.println("2"); #endif //unsigned long *pulBuffer = &value[0]; uint32_t *pulBuffer = &value[0]; #ifdef DEBUG Serial.println("3"); #endif //unsigned long ulCount; uint32_t ulCount; #ifdef DEBUG Serial.println("4"); #endif //unsigned long ulBase = faBase; uint32_t ulBase = faBase; #ifdef DEBUG Serial.println("5"); #endif HWREG(ADC0_BASE + ADC_O_ISC) = 1 << SEQUENCER; //<==== Hangs on this line here #ifdef DEBUG Serial.println("6"); #endif HWREG(ADC0_BASE + ADC_O_PSSI) |= ((SEQUENCER & 0xffff0000) | (1 << (SEQUENCER & 0xf))); #ifdef DEBUG Serial.println("7"); #endif while (!(HWREG(ADC0_BASE + ADC_O_RIS) & (0x10000 | (1 << SEQUENCER)))) {} #ifdef DEBUG Serial.println("8"); #endif HWREG(ADC0_BASE + ADC_O_ISC) = 1 << SEQUENCER; #ifdef DEBUG Serial.println("9"); #endif ulBase = ADC0_BASE + (ADC_SEQ + (ADC_SEQ_STEP * SEQUENCER)); #ifdef DEBUG Serial.println("10"); #endif ulCount = 0; #ifdef DEBUG Serial.println("11"); #endif while(!(HWREG(ulBase + ADC_SSFSTAT) & ADC_SSFSTAT0_EMPTY) && (ulCount < 8)) { #ifdef DEBUG Serial.println("12"); #endif value[ulCount] = HWREG(ulBase + ADC_SSFIFO); #ifdef DEBUG Serial.println("13"); #endif ulCount++; } return value[0]; } ///************************************************************************** /// /// Fast Analog Init Routine /// ///************************************************************************** uint16_t fast_analogInit(uint8_t pin) { uint8_t port = digitalPinToPort(pin); uint16_t value[1]; uint32_t channel = digitalPinToADCIn(pin); if (pin == NOT_ON_ADC) { //invalid ADC pin return(0); } faBase = (uint32_t)portBASERegister(port); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); // SysCtlDelay(3);// <= New addition ROM_GPIOPinTypeADC((uint32_t)portBASERegister(port), digitalPinToBitMask(pin)); ROM_ADCSequenceConfigure(ADC0_BASE, SEQUENCER, ADC_TRIGGER_PROCESSOR, 0); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 0, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 1, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 2, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 3, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 4, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 5, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 6, channel | ADC_CTL_IE); ROM_ADCSequenceStepConfigure(ADC0_BASE, SEQUENCER, 7, channel | ADC_CTL_IE | ADC_CTL_END); ROM_ADCSequenceEnable(ADC0_BASE, SEQUENCER); //ROM_SysCtlADCSpeedSet(SYSCTL_ADCSPEED_1MSPS);//<= Identified By L.R.A. as problem line //HWREG(SYSCTL_RCGC0) &= ~SYSCTL_RCGC0_ADC0SPD_M; // change if you want ADC1 //HWREG(SYSCTL_RCGC0) |= SYSCTL_RCGC0_ADC0SPD_1M; // change for the desired speed with the macros and the ADC module HWREG(ADC0_BASE+0xFC0) &= ~0xF; HWREG(ADC0_BASE+0xFC0) |= 0x7; return(1); }
  25. L.R.A. I appreciate your help. I'll keep having a play. Its all kinda bizarro as it ran under energia 9 and 10. Cheers PTB