Jump to content

Fmilburn

Members
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by Fmilburn

  1. Fmilburn

    Energia with TM4C123 battery monitoring ADC problem

    OK, many thanks. I think I am getting it. Let me try to turn this into some rules I can use... 1) if doing one way 5V --> 3V3 logic conversion from a sensor or module to the MCU then keeping the voltage divider resistances in the 100 ohm range is good. 2) if monitoring voltage and it is desireable to minimize current draw from the circuit being monitored then use higher resistance in the divider but use an Op Amp or maybe FET input Op Amp inbetween as a buffer. EDIT: logic conversion does not use ADC - so 1) above is not stated correctly but it does raise the question does any of this apply to digital? Also, are there rules on how much time to allow the ADC to charge? Is this a problem only if you are coming out of a low power mode? I will try putting together a circuit or two and experiment - tried power from a inexpensive DC wall supply and it did work ok although maybe I am getting lucky. I am trying to make it not work so I can fix it
  2. Fmilburn

    Energia with TM4C123 battery monitoring ADC problem

    @@altineller - Your lab power supply should work... If you get it to work with a battery then you might try again with the lab supply. @dubnet OK, I will confess to not understanding that part of the datasheet It states that the "analog source resistance", Rs is 500 ohm max. Just above that there is a line stating that the ADC equivalent input resistance is 2.5 kohms. And of course there is a footnote h that refers to the diagram below. The diagram also shows capacitance in the input. How is this interpreted and how is it used in a practical fashion? I have set up voltage dividers with resistors in the thousands of ohms range to get me where I wanted to be for analogRead - mostly with the MSP430F5529LP with no problem. I can see that there would be a problem if there was capacitance (RC filter) and the voltage was changing and you were trying to track it (not the case here?) Realize that I am not an electrical engineer - just trying to understand.
  3. Fmilburn

    Energia with TM4C123 battery monitoring ADC problem

    Hi @@altineller I tried to reproduce your problem on my TM4C123G LaunchPad. I hooked up the following with a 6V battery (reads 5.9 on my meter). Is this your circuit? If so, I was able to get the expected readings using this sketch: void setup() { Serial.begin(9600); Serial.println("Starting..."); } void loop() { float rawReading; rawReading = analogRead(28); Serial.print(" Raw Reading = "); Serial.print(rawReading); float Voltage; // NOTE: 3.3 is used for conversion since we are // using the default internal voltage reference Voltage = 3.3 * rawReading / 4095.0; Serial.print(" Voltage = "); Serial.println(Voltage); } I did not get different readings when I put my meter across as you reported. Do you have your circuit grounded to the LaunchPad? Also, did you convert in your sketch using 3.3V or 6V? Using 6V would give roughly the number you reported. Hope this helps.
  4. Fmilburn

    New edX course using MSP430

    @@OppaErich Thanks for posting! I've signed up and I'm going to try it out...
  5. Fmilburn

    Controller for fdc1004

    Hi @@colinives - I'm new to TI microcontrollers also but maybe my perspective is useful in that regard. One of the really nice things I've noticed about TI is the application notes and boards like the ones that @@bluehash linked to above. The 43oh community is also extremely helpful. Although you might not want to use that board it gives you a good idea that the microcontroller can do the job and a starting place for your design. Truth is, if an ATtiny85 can do it, I suspect any MSP430 could do it, and the low power modes and ability to run at low voltages are there. I'm experimenting with the MSP430FR5969 attached to a capacitor charged by a solar cell and they are certainly low power. If you are wanting to stick with a DIP package you could look at the EXP430G2 line. Good luck with your project.
  6. Fmilburn

    Hi from Seattle

    I have been recruited to help teach a class on robotics this summer that is using the MSP430F5529. I'm a mechanical engineer by background so I've been studying hard so I'll at least be even with the kids when it comes to the microcontroller. 43oh is a great community - my thanks to all those that are helping us beginners out.
  7. Fmilburn

    Hi from Seattle

    @@dubnet - I have already been bitten :-)
  8. Fmilburn

    Energia millis() and micros() issues

    I thought I would try the code from @@Nicu with some other LaunchPads. I don't have a C2000. Returning lots of zeros? Here is what I got on other LaunchPads: FR5969 - mostly 2's with a rare 3 F5529 - 2 about 2/3 of time, and 1 for 1/3 of time MSP432 - almost always 1 but the rare occasional 2048 or 2049 <<< this should probably be checked also CC3200 - always 1 Tiva TM4C123 - always 1 By the way, on an Arduino Uno this gives mostly 1s, with an occasional zero and occasional 2.
  9. @@johnrdorazio - I'm glad this worked for you. I don't think you need to use all 8 digital pins to display custom characters. You can do that using D4-D7 only. When you do, it just sends two 4 bit messages to the display controller in place of an 8 bit message. I don't think I've ever hooked up all eight.
  10. Fmilburn

    FR5969 and i2c issue

    I have an Adafruit I2C RTC that I will try with the FR5969. I thought I had used it successfully in the past but when I pulled it up again this evening I didn't get it going right off the bat. Will try again and let you know if I am successful. UPDATE ======= I couldn't get the RTC to work when I tried again today - I do a Wire.begin() and then it calls a library where it freezes. I then tried with a LCD that has an I2C backpack. I got it running on the F5529 and moved it to the FR5969. It doesn't freeze completely but gives garbage on the LCD that changes from time to time. I checked the wiring and it seems correct. So I am unsuccessful getting I2C to work on the FR5969 as well. I am using Energia E0015.
  11. There is an easy way to do this using Energia functions that was posted by spirilis elsewhere. Here is an example: /* Demonstrates a way to utilize LaunchPad low power modes with the sleep(), sleepSeconds(), suspend() and wakeup() functions in Energia. The LaunchPad will blink the red LED 3 times and demonstrate sleep() and sleepSeconds(). It then goes into suspend() but will wake up and start over again if the button is pushed. sleep() and sleepSeconds() use LPM3. suspend() uses LPM4. */ void setup() { pinMode(RED_LED, OUTPUT); // Make red LED an output pinMode(PUSH1, INPUT_PULLUP); // Make push button input attachInterrupt(PUSH1, interrupt, FALLING);// Attach ISR to PUSH1 } void loop() { // Flash the LED - use sleep and sleepSeconds to save power by going // into LPM3 for (int i = 0; i < 3; i++) { digitalWrite(RED_LED, HIGH); sleep(200); // use sleep for millis digitalWrite(RED_LED, LOW); sleepSeconds(1); // use sleepSeconds for seconds } // Suspend and go into LPM4 suspend(); } void interrupt() { wakeup(); // wake up if button is pushed }
  12. I should add that you won't need to do all this if you put a copy of this in your library.
  13. Hello @@johnrdorazio I was curious about this after reading your post. I hooked up my CC3200 and after some investigation got the LiquidCrystal library to work by doing the following: 1) go to the File tab and use Open... Then navigate to energia-0101E0015/hardware/msp430/libraries/LiquidCrystal/examples/HelloWorld. You may have a different Energia version so adjust accordingly. 2) go to Sketch tab and use Add File... to add LiquidCrystal.cpp and LiquidCrystal.h which are in the LiquidCrystal folder in step 1) above. 3) change the line #include <LiquidCrystal> to #include "LiquidCrystal" 4) specify your pins by number instead of port. For example I am using the following in the instantiation: LiquidCrystal lcd(5, 6, 7, 8, 9, 10). You must hook up the LCD pins to match of course. What is happening here is that libraries for some LauncPads are in different places. A cc3200 library for LiquidCrystal is not present but the MSP430 library seems to work if you change the pins. Note that using ports, e.g. using P4_1 instead of 10, in the instantiation does not seem to work. This seems to be the case for some of the other LaunchPads as well. Hope this helps...
  14. Fmilburn

    i2c LCD

    I recently bought a 20x4 LCD with I2C backpack and got it working. I've posted a working library (taken from DFRobot.com) and an example. While I've only used it with the 20x4 LCD it should also work with a 16x2. It has been tested on the MSP430F5529, MSP432P401R, and CC3200. These LCDs need 5V to work and you will need bi-directional logic level conversion. I've posted two circuits that work - one using two BS170 MOSFETs and another with a converter module I bought from Addicore. You can find it here on github. EDIT: I recently tried this library with a 16 x 2 LCD and it works with that also. You will need to change the variables that hold screen size where indicated in the example.
  15. There is code with very detailed documentation and many examples for these RFID modules here: https://github.com/miguelbalboa/rfid The examples are more complicated than the example here but if you want to see just about everything the module can do I recommend it. The examples include reading a card, writing to a card, dumping detailed information, changing the card user ID, etc. The examples and code run without modification except for pin connections with MSP430 LaunchPads. The pin connections I used are: Pin Connections ================================== RFID Module LaunchPad -------------- ---------------- Pin 1 (SDA) Pin 8 (CS) Pin 2 (SCK) Pin 7 (SCK) Pin 3 (MOSI) Pin 15 (MOSI) Pin 4 (MISO) Pin 14 (MISO) Pin 5 (IRQ) Not connected Pin 6 (GND) GND Pin 7 (RST) Pin 10 Pin 8 (3V3) 3V3 Change these lines in the example code if you use my pin mapping above and they should run: #define RST_PIN 10 #define SS_PIN 8
  16. Hello Larry, I find C a bit cryptic myself. "Enrf24 radio(P2_0, P2_1, P2_2);" passes the LaunchPad pins that are connected to CE, CSN, and IRQ on your transceiver. You could change these pins if needed. The second question regards a statement in the TX example that is checking to see if anything has been received. The contents, if any, are in the array inbuf defined by the statement "char inbuf[33];" which is higher up in the program. Hope this helps.
  17. Quick note on the problems I was having above - one of my boards was bad. Replacement is working fine on F5529 with no change to clock or the example in the library.
  18. Fmilburn

    Low Power Modes with an ISR

    Good stuff - I've been looking for a clean way to do this! However, the wakeup() and suspend() functions don't appear to be documented on the language reference page of Energia. I wouldn't have found them without seeing this post. Are they documented elsewhere?
  19. Thanks for the quick response... Channels and bitrate/datarate are the same. I tried moving one radio into the next room and the rate of capturing the first packet quickly is higher now. I've been working on it and here are a couple of new observations... * it sometimes will receive one or even two "on" transmissions and then the "off". Of course at times it receives the "off" first. Regardless, it doesn't seem to receive any more packets after the first "off" * If I reset the receiver, it will work again until it gets an "off" * I tried putting one in transmit mode on a quiet channel with only a 10 millis delay and then using the channel scanning on the other to see how strong it was and it barely registered. * I tried swapping the transceivers in transmission and reception, sitll no luck * I went back and did a new install of the library - it got worse. I made SPI.setClockDivider(8) and it seemed to get better again but kept stopping after receipt of the first "off" packet * Changed bit rate to 250000. It still stops after the first "off" packet. * Changed bit rate back to 1000000 and changed to different channel that seemed quieter. It still stops after the first "off" packet received. I'm out of ideas, only changing SPI clock divider and moving the radio away seemed to help. I don't understand why it would successfully receive one or two transmissions and then stop. Maybe one of the nRFs is bad, but I only have the two so can't swap one out right now. Unfortunately I will be away for a few days and unable to work on my project but appreciate any other thoughts, especially if there is anything different you do for the F5529LP - i.e. change the SPI.setClockDivider since the MCU is running at 25MHz.
  20. Hi, I'm having a problem getting the MSP-EXP430F5529LP to work with this library. Has anyone been successful using the nRF24 with the 430F5529? My hardware is: MSP-EXP430F5529LP cheap nRF24L01 transceivers I am using the library examples and the following pins: /* nrf24l01 MSP430F5529 Signal LaunchPad ----------- ----------- VCC 3V3 GND GND SCK P3.2 CE P2.7 CSN P1.2 IRQ P1.3 MISO P3.1 MOSI P3.0 */ Enrf24 radio(P2_7, P1_2, P1_3); // CE, CSN, IRQ pins MSP430F5529 The serial monitor makes it appear that things are working. For example, with the transmit example I get the following serial output repeatedly: Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption Sending packet: ON Enrf24 radio transceiver status: IDLE module powered up w/ oscillators running Sending packet: OFF Enrf24 radio transceiver status: IDLE module powered up w/ oscillators running Sending packet: ON For the receiver I get: Enrf24 radio transceiver status: DEEP SLEEP <1uA power consumption Enrf24 radio transceiver status: Receive Mode The problem is that the LED does not blink correctly and I don't get regularly serial messages about receiving a packet. Rarely, it will recieve one packet, normally right after initializing. The receiver and transmitter are located a few feet apart. The channel scanning sketch shows some activity. I've tried the following without success: * set clock divider at 6 and 8, e.g. SPI.setClockDivider(6); * set radio.begin(250000); * checked wiring Am I doing something wrong or would the library need modification to work with the 430F5529?
×