Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by basil4j

  1. Oops, typo haha thanks. I did this to the port registers. P1SELC |= I2C_SDA | I2C_SCK; //Configure I2C pins P1SELC sets P1SEL0 and P1SEL1 simultaneously. I assume USCI is tertiary function, the pin list on the datasheet says there are up to 5 functions on some of the pins, so who knows how i'd use something beyond tertiary :/
  2. Revised code. This should take care to avoid resending the data byte over and over...How does this look? case 0x16: // Vector 22: RXIFG0 Ready to take data from buffer accel[UCB0STATW >> 8] = UCB0RXBUF; //UCB0STATW byte counter starts at bit 8 break; case 0x18: // Vector 24: TXIFG0 TXIFG0 is set when TXBUF is empty or when Start condition is generated /* The UCTXIFG0 bit is set when the START condition is generated and the first data to be transmitted can be written into UCBxTXBUF. The UCTXSTT flag is cleared as soon as the complete address is sent.*/ if (UCB0CTLW0
  3. Thanks! Not something someone new to MSP would know too well haha Thats the main bit I am confused about. The Family giude says None of these registers say the module needs to be in reset mode to access, so I just left them out of it to keep things simple in my code (i.e. only things which must be done in reset are done in reset). The timing diagram says it starts when both UCTXSTT and UCTR = 1, it then generates a start and sends the slave address so I figured as long as I set the slave address before these 2 registers it would be ok. EDIT: I think you're righ
  4. Hi All, Using the MSP430FR5739 UCSI_B in i2c mode. Just checking ive got this right, as I've never used it before. I neod to do the following, Ive left out the ack's S= start E= stop [Address+write][Register][Address+read][Read 6 bytes][E] Setup at beginning of program: UCB0CTL1 = UCSWRST; // put eUSCI_B in reset state UCB0CTLW0 = UCMODE_3 | UCMST | UCSSEL__SMCLK; //I2C master mode UCB0BRW = 0x0008; //clock scaler UCB0CTL1 &= !UCSWRST; // eUSCI_B in operational state UCB0IE |= UCTXIE; // Enable interrupts Program calls the following to get things going: UCB0
  5. Ahh I see, thanks for the clarification!
  6. Ahh I think I got it. The flags in TBxCCRn are cleared, but not nlthe flag in TBxIV, right? Sent from my GT-I9300 using Tapatalk
  7. Thanks Katie, my confusion is more around the statment in the manual 'if the TBxCCR1 and TBxCCR2 CFIG flags are set when the interrupt servicr routine accesses the TBxIV register, TBxCCR1 CCIFG is reset automatically. ' This says to me the interrupt routine itself resets the flag once it's decided to use the vector, thus will clear before my switch case even sees it? Sent from my GT-I9300 using Tapatalk
  8. Thats true lol Sticking with MSP Sent from my GT-I9300 using Tapatalk
  9. Hi, I found a few QFN32 CM3 devices which would be nice from NXP, downloaded LPCXpresso, installed it and got lost Technically, the MCU's would be more suitable for this application just to ease the workload on the math, but I am finding everything extremely complicated when it comes to learning the programming side of things of ARM devices (regardless of brand). Seeing as we are on the subject, might as well run my thoughts past you just to double check the amount of math I need to do really isnt much Main clock at 20MHz (DCO), with SMCLK doing the timing of the sensor readin
  10. Hi All, Im having a bit of trouble with these interrupts on TimerB2 on the MSP430FR5739. I am using 3 compare registers, TB2CCR0 = 250, TB2CCR1 = 150 & TB2CCR2 = 50 CCR0 Interrupts are easy enough, but im confused when it comes to the rest. The Family guide says: The TBIFG flag and TBxCCRn CCIFG flags (excluding TBxCCR0 CCIFG) are prioritized and combined to source a single interrupt vector. The interrupt vector register TBxIV is used to determine which flag requested an interrupt. [snip] Any access, read or write, of the TBxIV register automatically resets the highest
  11. Thanks, will see if it will work, otherwise ill stick with the LDO.
  12. Hi Spirilis, What I meant by 'operate with just a few capacitors' was I don't need an external EEPROM (like the Prop) or a crystal (with the obvious tradeoffs), just a few decoudpling capacitors and it will run quite nicely...well at least I assume so from what ive read! Hardware FP is nice, but at 40mA I might as well go back to the propeller. Is there a way I can estimate the time required for certain calculations in CCS? Regarding the power supply. The power supply ive planned is a 3.3v, 250mA LDO supplied by a 9V battery or 3.7V LiPo usually. The highest minimum voltage
  13. I have planned on using the FR5739 which looks nice. I also considered a few cortex parts (ST parts mainly) but got lost when trying to find nice learning resources. Ultimately I turned to the MSP as they can operate with just a few capacitors and be happy and I love the integration. If the borg army also runs on minimal components I will reconsider them due to their strength in the math department, but as I say, I got lost searching Sent from my GT-I9300 using Tapatalk
  14. Thanks for the pointers! Will read up on them after I figured out these clocks!
  15. Hi All, I have never used an MCU with interrupts before (previous experience using the Propeller which does not have interrupts), and am trying to nut out the main routines in my upcoming project. Hoping I can get some insight from people here! My program needs to sample 3 sensors, 1 every 2.5ms, 1 every 10ms, 1 every 25ms, perform some logic and write 256 bytes to SPI Flash memory every 25ms. I plan to use interrupts for each of these tasks, and synchronise the start times so the time periods line up at the end of 1 second (i.e. in 1 second I will have recorded 400 samples, 100 sampl
  16. Hi Graham, If altitude had a linear relationship to the barometer output, then no I wouldn't. Unfortunately I need to know actual altitude for a few flight events so it needs to be calculated in real time. Edit. I should note that the main altitude measurements will be done by the barometer, the inertial calculations will be secondary but I will be combining the results in certain cases. Sent from my GT-I9300 using Tapatalk
  17. Sorry Enl, forgot to answer your questions! The majority of the math will be determining accurate vertical altitude and velocity from one axis of a 3 axis accelerometer, adjusted for tilt using data from a 3 axis gyro. I will also be calculating barometric altitude using data from a pressure sensor. (This project is a rocket altimeter) which I believe uses log... With this in mind id like to be as precise as possible. The adc readings are only for battery voltage and a few minor checks on various parts of the circuit so do not need to be as accurate. At some point I hope to imp
  18. Oh didnt see Enl's reply thanks! That's encouraging think it's time to learn a new MCU! Sent from my GT-I9300 using Tapatalk
  19. Hi! Thanks for the info that will come in useful for another project I'm thinking of For this application, even using no power saving tricks the MSP will be low enough I'm more concerned about whether or can so all the required tasks in the time allowed. Sent from my GT-I9300 using Tapatalk
  20. (Specifically MSP430FR5739) Hii All, Newb question here. I have a project i'm working on which I have currently designed around the Parallax Propeller with which i'm familiar. For this application it is very overkill and uses a ton of power (~30mA at the freq im running it at), but i'm familiar with it and its very fast/flexible to develop for. This project is battery operated and at a point in its use will be powered by a supercap for some seconds. Obviously if I can reduce consumption in any area I should! The prop is ~60% of the consumption so reducing this to just a few %
  21. Thanks all Sent from my GT-I9300 using Tapatalk
  22. Hi All, New the MSP430 so please excuse potential ignorance I am working on a project using the MSP430FR5739 which will be used to fire some pyro igniters (high powered rocketry). Port J would be easiest to use with regards to PCB layout, but as this is also the JTAG port i'm just checking what state they are initialised in, and if I should be careful of anything when using them to prevent accidental misfire? I will be using SBW to debug/program. Thanks in advance! Regards, Alec
  23. Hi All, Another semi related question Each MSP will also need to output a constant 32kHz square wave for some sensors and also keep a few timers running to sync the communication windows for the bus output (I'm implementing a round robin type comms bus between devices) and various other things. These other timers only need 0.05ms accuracy or so, I've yet to sort out the details of these, may be stricter requirements, may be looser. The device I'm looking at has 1 timer which I'm thinking would be best used for the constant 32kHZ output. Is it easy enough to code in software a coup
  24. Hi I'm trying to keep the pin count and cost down, and an looking at 16-24 pin devices. Are there any with 32x32 math in these small sizes? I may have missed them!
  25. Thanks for the super quick reply! That's what I thought, I am completly un familiar with this MCU so wasn't sure on how many cycles instructions take etc Ill be using 8kb or 16kb devices if pos, so it looks as though ill be stuck with the CCS compiler. I assume the libraries are the same?
  • Create New...