
Jake
-
Content Count
133 -
Joined
-
Last visited
-
Days Won
4
Reputation Activity
-
Jake reacted to L.R.A in How many channels of analog to digital conversion can the MSP430G2553 handle?
The MSP430G2553 does not have a 12 bit ADC, it's just 10bit.
If you check this pinout you can see how many ADC channels the MSP430G2553 has and it appears to have 8.
http://energia.nu/img/LaunchPadMSP430G2553-V1.5.jpg
Of course that-s 8 channels but just 1 ADC - you can only sample 1 at a time. Meaning 4 signals take 4x longer than just 1 - you would need a sample speed of 1 every 0.25ms to get the 4 signals every 1ms. That's 4Ksps
The max sample rate is about 200Ksps, at least it seems so. So your required sample rate should be easily attainable
I don't quite get what you are referring with the timers.
-
Jake reacted to greeeg in how would I create a delay in output going high?
Hi @@Jake,
I've answered your PM here, so that others can benefit if they have similar problems.
From what you described in the PM, you're still working on this problem. I have tidied up the code you sent me and added a state machine into the interrupt to handle the logic.
These are two states
Waiting for a button held continuously for over 2 seconds Waiting for 60 seconds with an output held high. This code has been tested on my Launchpad G2331. let me know if there are areas you don't understand.
#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; unsigned int hold_timer = 0; void init(void) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; // Enable LED outputs and Button pullup P1OUT = BUTTON; P1DIR = LEDR + LEDG; P1REN = BUTTON; // Set up 32768Hz crystal BCSCTL3 |= XCAP_3; // select 12pF caps // initialize Timer0_A TA0CCR0 = ( 32768 / TICKS_PER_SECOND ) - 1; // set up timer for 32Hz TA0CTL = TASSEL_1 + ID_0 + MC_1; // configure and start timer // enable interrupts TA0CCTL0 = CCIE; // enable timer CCR0 interrupts __enable_interrupt(); // set GIE in SR LPM3; // select low power mode 3 while(1); } /** * Timer interrupt called at 32Hz (TICKS_PER_SECOND) */ #pragma vector = TIMER0_A0_VECTOR __interrupt void myTimerISR(void) { switch( current_state ) { /* state waiting */ case state_waiting: if( ( P1IN & BUTTON ) == 0 ) { if( hold_timer >= TICKS_PER_SECOND * 2 ) { /* If button held for 2 seconds change state */ current_state = state_hold_high; hold_timer = 0; break; } else { /* If button pressed, but not for 2 seconds yet inc timer */ hold_timer++; } } else { /* Button not pressed, reset timer */ hold_timer = 0; } break; /* state hold high */ case state_hold_high: /* Set output high */ P1OUT |= LEDR; if( hold_timer >= TICKS_PER_SECOND * 60 ) { /* If timer has elapsed, set output LOW, switch state */ P1OUT &= ~LEDR; hold_timer = 0; current_state = state_waiting; break; } else { hold_timer++; } break; /* return to a idle state */ default: current_state = state_waiting; break; } } void main( void ) { init(); } -
Jake reacted to Fmilburn in how would I create a delay in output going high?
Here is some code that uses a timer to count to one second, then keeps track of the seconds to toggle an LED every 5 seconds. So maybe that answers one of your questions. To be honest, I'm not sure what you are trying to do though...
/* * Written for the FR6989 and does the following: * Uses timer to interrupt approximately every second * Toggles red LED approximately every 5 seconds */ #include <msp430.h> #define RED_LED BIT7 // P9.7 is the red LED on the FR6989 #define ACLK BIT8 // Specify ACLK as the source (0x0100) #define UP BIT4 // Tell Timer A to count up (0x0010) #define ENABLE_PINS 0xFFFE // Enable pins #define COUNT_SECOND 37000 // approximately one second for timer as set // Global variables long numSeconds = 0; // used to count how many seconds have passed // Function prototypes void Timer0_Init(void); void IO_Init(void); //************************************************************************************ // main //************************************************************************************ main() { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer Timer0_Init(); // Initialize timer IO_Init(); // Initialize the IO while(1) // Loop over and over { if (numSeconds == 5) // 5 seconds have passed { P9OUT ^= RED_LED; // Toggle red LED on P9.6 numSeconds = 0; // Reset number of seconds } } } //************************************************************************************ // Timer0_Init Initialize TimerA0 and start counting seconds //************************************************************************************ void Timer0_Init() { TA0CCR0 = COUNT_SECOND; // Timer A0 counts to this number (~1 second) TA0CTL |= ACLK; // Use ACLK TA0CTL |= UP; // Count up TA0CCTL0 = CCIE; // Enable the interrupt for Timer A0 _BIS_SR(GIE); // Global activation of interrupts (done once) } //************************************************************************************ // IO_Init Initialize the I/O //************************************************************************************ void IO_Init() { PM5CTL0 = ENABLE_PINS; // Enable I/O P9DIR = RED_LED; // Set red LED on P9.6 to output P9OUT &= ~RED_LED; // Turn the red LED off } //************************************************************************************ // Timer0 Interrupt Service Routine Count to one second and increment number of // seconds since numSeconds was reset //************************************************************************************ #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_ISR (void) { numSeconds++; // Increment number of seconds since reset } -
Jake reacted to greeeg in how would I create a delay in output going high?
@@Jake your code is looking good. Moving into interrupts is the right idea! However there are a few extra pitfalls.
// Timer A0 interrupt service routine #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer_A(void) { } // Port 1 interrupt service routine #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { TA0CCR0 += 500000; // Delay interupt must have P1.3 high for 2 sec P1OUT |= ledg; // Set P1.6 high TA0CCR0 += 500000; // Reset interrupt after 60 seconds P1IFG &= ~button; // P1.3 IFG cleared P1OUT &= ~ledg; } Firstly, the MSP430 is a 16bit MCU. Since TA0CCR0 is a 16 bit register it can only hold 65,536 (2^16) possible values. Adding 500,000 will actually only be adding 41,248 due to bits outside of 16 bits being ignored.
Secondly just adding to the CCR0 register does do alot in hardware, but the CPU will still move on to the next instruction. This is why you are seeing the LED flicker on very quickly. In order to get these interrupts to work you will have to use the timer interrupt.
-
Jake got a reaction from bluehash in Looky what just came out! BOOSTXL-DRV8305EVM
Almost 700 watts of servo motor goodness!
http://www.ti.com/tool/BOOSTXL-DRV8305EVM?sp_rid_pod4=MTUwNTU0MDAyNzMyS0&sp_mid_pod4=49615929&detailID=340881181&spMailingID=49615929&spUserID=MTUwNTU0MDAyNzMyS0&spJobID=763213197&spReportId=NzYzMjEzMTk3S0
I think I am going to have to order a couple of them.
-
Jake got a reaction from dubnet in Looky what just came out! BOOSTXL-DRV8305EVM
Almost 700 watts of servo motor goodness!
http://www.ti.com/tool/BOOSTXL-DRV8305EVM?sp_rid_pod4=MTUwNTU0MDAyNzMyS0&sp_mid_pod4=49615929&detailID=340881181&spMailingID=49615929&spUserID=MTUwNTU0MDAyNzMyS0&spJobID=763213197&spReportId=NzYzMjEzMTk3S0
I think I am going to have to order a couple of them.
-
Jake got a reaction from spirilis in Looky what just came out! BOOSTXL-DRV8305EVM
Almost 700 watts of servo motor goodness!
http://www.ti.com/tool/BOOSTXL-DRV8305EVM?sp_rid_pod4=MTUwNTU0MDAyNzMyS0&sp_mid_pod4=49615929&detailID=340881181&spMailingID=49615929&spUserID=MTUwNTU0MDAyNzMyS0&spJobID=763213197&spReportId=NzYzMjEzMTk3S0
I think I am going to have to order a couple of them.
-
Jake reacted to oPossum in What to use?? power operated gate control interface
// Timer A0 interrupt service routine
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
{
} // <<<---- missing closing brace <<<----
// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
P2OUT ^= (BYPASS & STATUS_LED); // MAKE BYPASS AND LED HIGH
P2IFG &= ~POSITION; // RESET INT UPON POSITION HIGH
}
-
Jake reacted to bluehash in BBG - Beaglebone Green/Grove
On Seeed's Blog.
They might be showing this at this year's Bay Area Maker Faire.
The BBG does not seem to have the micro HDMI port. The NXP TDA19988 HDMI framer chip seems to be missing. It may be at the back of the board. Instead there are two serial buses - one 232R and the other I2C, which connects to the Grove ecosystem. The 5v barrel plug has given way to a USB port that says "USB Host" on it.
-
Jake got a reaction from bluehash in Tida00320. Mini PLC ..... This is an interesting new setup
http://www.ti.com/tool/tida-00320?DCMP=TIDA-00320&HQS=gma-indu-gia-TIDA-00320-em-rd-en&sp_rid_pod4=MTE1NzI3NDc2NjIzS0&sp_mid_pod4=48657454&detailID=56107647&spMailingID=48657454&spUserID=MTE1NzI3NDc2NjIzS0&spJobID=681737554&spReportId=NjgxNzM3NTU0S0
I guess the link would help!!
-
Jake got a reaction from spirilis in Tida00320. Mini PLC ..... This is an interesting new setup
I saw this from the TI email today. If I can ever get some of the other projects off the bench I want to try one. I have been wanting to try out a BBB, this is giving me some more motivation to...
-
Jake got a reaction from spirilis in Finally getting to experiment with my C2K.....Motion control is the hopeful goal.
I am finally going to get my C2K with the F28069M out of the box.
I have the BLDC driver boosterpack also. My goal is to run a BLDC servo motor from it.
Have any of yall used yours for motor control yet?
This is eventually going to be for my mechanical cow project similar to this http://www.cowtrac.com/cowtrac_ultima.html
I currently use some crude RC car controls, and reliability is spotty. My goal is to eventually have a control that can work with my android phone or some other type of remote. This is also what I want to eventually build the motor controls for some CNC projects.
Thanks!
Jake
-
Jake got a reaction from tripwire in I want to buy an awesome 3D Printer
Depends on the elastomers. Some machine nicely, some will make you throw them across the shop. You have to learn the material and the tooling to cut that material. A few of the elastomers I have cut razor sharp polished HHS tooling had worked well, minimizing dwell time and making sure travel speeds are high enough that material is removed and heating minimized. I have done more on a manual mill than a CNC, with elastomers my Bridgeport only goes 2700 rpm and I wanted faster still. I need to get my VMC in one piece and going. -
Jake got a reaction from jpnorair in I want to buy an awesome 3D Printer
I had almost bought that Emco that was on Craig's list and do I Linux CNC retrofit on it. But I decided I would hold onto the money and get my VMC in one piece and running. It was like $1800 and I figured I could do the Linux CNC retrofit for about a grand using servo motors on three axis.
http://www.okuma.com/genos-m560-v
This is what I really want! Just gotta come up with $160k for it!
-
Jake got a reaction from jpnorair in I want to buy an awesome 3D Printer
I have a friend with an Emco concept 55, it's pretty slick for a little machine. On the desktop machines other than that. I don't know....You may be able to find some of those emco (not enco) used, there was one of the manual models on craigslist here that can be easily converted to CNC as they are the same machine as the CNC less the servos and controls. my Bridgeport is the smallest in the shop. My VMC has a 15hp spindle on it.
-
Jake got a reaction from jpnorair in I want to buy an awesome 3D Printer
Depends on the elastomers. Some machine nicely, some will make you throw them across the shop. You have to learn the material and the tooling to cut that material. A few of the elastomers I have cut razor sharp polished HHS tooling had worked well, minimizing dwell time and making sure travel speeds are high enough that material is removed and heating minimized. I have done more on a manual mill than a CNC, with elastomers my Bridgeport only goes 2700 rpm and I wanted faster still. I need to get my VMC in one piece and going. -
Jake reacted to NoPinky in MSP432P401R LaunchPad order it NOW!!!!
MSP432P401R LaunchPad is out in the store and there is a video:
https://store.ti.com/msp-exp432p401r.aspx
-
Jake reacted to bluehash in 43oh Welcomes Stellarisiti, BeagleFu and C2000 Members
Hello All,
Welcome to 43oh!
If you are unsure, what this is about, please read the "http://43oh.com/2015/03/one-community-to-discuss-them-all-stellarisiti-c2k-and-bfu-merging-with-43oh/'>One Community To Discuss Them All
-
-
Jake reacted to dubnet in Voltage regulator 12vdc to 3.3vdc
Having installed multiple amateur radio mobile rigs in cars, I will second @@enl 's advice about an LC filter prior to your regulator. Nothing seemed to squash alternator whine on the transmitted signal like an LC filter.:
-
Jake got a reaction from bluehash in Updates and going forward
I'm good with the large forum list ha check out accurateshooter practicalmachinist huge forum lists! I'm good with the 43oh name it's the first of the TI chips to me. Thanks for having this place I enjoy it!
-
Jake got a reaction from abecedarian in New C2000 LaunchPad
Mine is a different mechanical cow.... I do have know a group of guys that are developing a new mechanical bucking bull that is supposed to be a lot more realistic feeling than most of the current ones.
Im building one for training horses to work a cow. I show reined cow horses as my other hobby. Having live cattle are very expensive especially when you can not work them every day.
So I'm building one of these
http://www.cowtrac.com/
-
Jake got a reaction from abecedarian in New C2000 LaunchPad
I have the mechanical cow for one of them, and I got the other one for some experiments for CNC motion control. -
Jake got a reaction from abecedarian in New C2000 LaunchPad
I happen to be on the TI forum the day they were released. -
Jake got a reaction from spirilis in New C2000 LaunchPad
I have the mechanical cow for one of them, and I got the other one for some experiments for CNC motion control.