
Jake
Members-
Content Count
133 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Jake
-
I am using CCS6 I am going to back to LAB 8 the UART lab to see if there is something mad with my launchpad or the terminal itself. What I dont get is the fact that I cant see any signals coming from the sensor at all. I figured I would see some data with the logic analyzer connected to it.
-
Howdy everyone, Finally getting back to the microcontrollers. I have been trying to get the MSP and ADXL to work together. https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/490264 I have been using this code and the ADXL from Adafruit they already has the pull up resistors on the board. From Adafruit example they are only using SDA and SCL and the 3v power. The red LED is only supposed to be on if the sensor is in certain positions. But it's on all the time. And I can not get anything to come up on the terminal screen even though it says connected. Ha
-
Sprillis, It is TASSEL_2 Do I need a line to setup and start the BCS? Also on the DCOCTL I thought that was enough to tell it to go there, but I have not been able to get it to work, if you run it with the debugger, works perfectly. As soon as you are completely off of it back to no function. Desired pin goes high on start, but no response at all. I dunno I am stumped. // initialize Timer0_A TA0CCR0 = ( 10000 / TICKS_PER_SECOND ) - 1; // set up timer for 12.5Hz TA0CTL = TASSEL_2 + ID_3 + MC_1; // configure and start timer SFR_8BIT(BCSCTL2); SFR_8BIT(
-
Howdy Everybody, I am trying to figure out how to change this code from running on the crystal to running on the DCO. I already built the board this is going on and dumbed up and did not make any provisions for the crystal. I have not located the document that had the timer modes laid out to where I could understand the addressing of each of the timers. Thanks for the help! #include <msp430.h> #define LEDR BIT0 #define LEDG BIT6 #define BUTTON BIT3 const int TICKS_PER_SECOND = 32; enum {state_waiting, state_hold_high}; unsigned int current_state = state_waiting; unsig
-
I'll be working on it next week! Do y'all have any good sources on the i2c displays? Sent from my XT1254 using Tapatalk
-
thanks for the link! I could use an Arduino also, I am going to try with the MSP first, that is a good idea with using two of them. The displays take up a bunch of pins, that was one reason I was thinking about using the UART and going back to the PC to save some pins. I am going to get rolling on it next week.
-
I am going to try to pull this off! I have 5 weeks to get it done. This is for the elementary school that my kids go to, there all getting involved in getting the cars, track, and timing system all done. I was initially thinking a MSP430G2553 The controller would be able to Drop starting gate and start timing with a pushbutton ( I really want to do a drag race light tree, but I may be getting too ambitious) Record the time of each lane and write to display Lane lights to light up winner lane. I know I could build the lane win lights easily with components, but I am
-
Thanks! I will see if I can get the code written this week and get going on it. On the timers I thought the one timer would be dedicated to that process.
-
I have another project where I have 4 analog signals that I need to convert to 4 digital signals. The update period on the hardware is about 1ms. I was thinking about using the 12bit A-D, since there is a A and B timer I thought I would be able to run two continuous signal sets through it. I would have to run two chips to get the job done. I am not crunched for space so if I have to run individual ones it is not the end of the world. This is for the torque meters from my analog servo drives to the LinuxCNC interface for my CNC mill control retrofit. Thanks guys!
-
On the interrupts I have been told the same thing to keep them short, but instead of constantly polling I figured the interrupt would be better. Also this timing function is the most important function in the scheme of things, I want it to drop what ever else it was doing and go to this function. Everything else is able to wait while this evolution is taking place. Now I'll see if I can get my other pieces of the puzzle done!! Sent from my XT1254 using Tapatalk
-
I CANT HIT THE THANKS BUTTON ENOUGH!!!!!! Thanks again Greg! It works great and makes sense, this has been a steep learning curve!
-
I have been looking for some code snippets of the timer A up count mode Setting TA0CCR0 = 512 for 1 sec with the crystal hooked up and /8 Input low to start timer start timer in mode 6 toggle/set count ++ to get two seconds toggle output when condition reached output to start timer again in mode 7 reset/set (or use another timer if I have to) count CCRO 60 times for 60 seconds reset output Or I think I might be able to use output mode 2 toggle/reset, count 2 periods output high count 60 periods reset output I can not seem to find t
-
I have finally had a bit more time to attempt this. I did find the real time clock documents, which someone else was using to capture a thermostat reading at specific intervals. I am not getting any errors in the code, but it will not build. I am not sure where I have gone wrong. Do yall see anything that I could do to get this rolling ? #include "RTC.h" #include "msp430g2553.h" void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= 0x01; // Set P1.0 to output direction CCR0 = 32768 - 1; TACTL = TASSEL_1 + MC_1; // ACLK, upmode CCTL0 |= CCIE; // en
-
Awesome THANKS!! I will see if I can get it to work with that. What I am trying to do is if there is an continuous input for at least 2 seconds for it to make an output high, after the output goes high reset the output to low after 60 seconds. I am trying to use one remote button to do multiple tasks, a short push will allow one action to happen, a long (2 sec) push will allow a different action to occur. If (BUTTON HIGH) //check for input pin high START TIMER COUNT 2 SECONDS //start and run timer as long as input is high MAK
-
I am still trying to get through this no luck so far void delay_for_1_second() { // Add some code here to delay for 1 second <-----I am not sure what I need to add here } void check_input() { if (P1IN & BIT3) \\input high \\see if it stays there for 2 seconds for( int i = 0 ; i < 2 ; i++) { delay_for_1_second(); if(!(P1IN & BIT3)) // if pin low, do not turn output on return; } P1OUT |= BIT6; \\ make output high for( int i = 0 ; i < 60 ; i++) { delay_for_1_second(); }
-
ok so I need to setup this timer arraignment in the timer AO ISR right? I found the TI timers in depth PDF it seems like I need to have the timer in compare mode to cause an event after a certain period of time. So those time instructions need to be in the timer ISR ? Ill keep working the googlefu to get this figured out. or is there supposed to be a line in the timer ISR to run the timer, Then in the port ISR you have instructions to wait for x time, then set the pin high, then wait set time again and reset? Thanks again for the help!
-
#include "msp430g2553.h" #define system_tick #define button BIT3 //P1.3 #define ledr BIT0 //P1.0 #define ledg BIT6 //P1.6 void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT TA0CCTL0 = CCIE; // CCR0 interrupt enabled TA0CTL = TASSEL_2 + MC_1 + ID_3; // SMCLK/8, upmode TA0CCR0 = 50000; // Hz P1OUT &= 0x00; // Shut down everything P1DIR &= 0x00; P1DIR |= BIT0 + BIT6; // P1.0 and P1.6 pins output the rest are input P1REN |= BIT3; // Enable internal pull-up/down resist
-
I'm using CCS also... Sent from my XT1254 using Tapatalk
-
I'll try that. I have close to that in my code at the moment but the input still goes high instantly, as soon as the button is pressed. Sent from my XT1254 using Tapatalk
-
I am trying to put a piece of my program in with a time delay. If I get input high for like a full second then the output will go high. I tried with a long switch debounce, but the output still went high right after the input was there. { if (P1IN & BIT3) \\input high then (delay 2 seconds) \\see if it stays there for 2 seconds P1OUT |= BIT6; \\ make output high then (delay 60 second) \\output high for 60 seconds P1OUT &= ~BIT6 \\reset P1OUT to low } Thanks everybody!
-
#include "msp430g2553.h" void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT CCTL0 = CCIE; // CCR0 interrupt enabled TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK/8, upmode CCR0 = 10000; // 12.5 Hz P1OUT &= 0x00; // Shut down everything P1DIR &= 0x00; P1DIR |= BIT0 + BIT6; // P1.0 and P1.6 pins output the rest are input P1REN |= BIT3; // Enable internal pull-up/down resistors P1OUT |= BIT3; //Select pull-up mode for P1.3 P1IE |= BIT3; // P1.3 interrupt enabled P1IES |= BIT3; // P1.3 Hi/lo edge P1IFG &= ~BIT3; // P1.3 IFG cleared _BIS_SR(CPUOFF + GIE); // Enter LPM0 w/ interrupt whi
-
Ok I'll try that tonight, it loads but the state of the output pin never changes. Just stays low. Sent from my XT1254 using Tapatalk
-
I have been trying to figure this one out. I want to run an interrupt upon a trigger from an input, in the interrupt it will cause a pin to go high. I want to make this function as the interrupt will be reset by another input or by a set time. This is the code that I have found and attempted to change to work with the MSP430G2553, but I can not get it to work. What do I need to do to get this to work ? Thanks!!!! #include "msp430g2553.h" void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT TA0CCTL0=CCIE; // CCR0 interrupt enabled T
-
It will be nice as the other driver can only handle 240 watts. I have a project I'm working on with it. Writing the code is still kicking my butt though!