Skip to main content

Thread: msp430 :if a button is pressed on ED create a link to the AP and blink his leds


hello, have project using ti ez320 rf2500 kit msp4302274uc..,from start want new microcontrollers , c willing learn.
want project smoke detector gives ttl signal end device(1l detecting smoke),i want put signal port port2 bit0. , transmit access point,where want set port2 bit0. output can give signal can trigger buzzer.
until moment want make similar work:
want use isr @ end device, when push button(which gives 1l signal,somehow similar somke detector signal(when somke detected))and transmitted access point use outputs 2 leds,and leds must blink due received signal.
have ti code ,named <txrx_simple>, code :

#include "mrfi.h"
int main(void)
{
bsp_init();// disables watchdog, initializes mclk @ 8mhz, sets led ports outputs , button port input.

p1ren |= 0x04;// enables internal resistor of thebutton

p1ie |= 0x04;// enables interrupts


mrfi_init(); // initializes 6 wires between msp430 , cc2500,powers-up cc2500 , configures cc2500 47 registers , turns on interrupts cc2500;

mrfi_wakeup();// wakes radio, i.e. turns on 26mhz crystal attach without entering rx or tx mode;

mrfi_rxon() ;// switches radio rx mode; line on, can receive packets,in case interrupt function mrfi_rxcompleteisr called.

bcsctl3 |= lfxt1s_2; //switches on aclk sourcing vlo
tacctl0=ccie; //enables interrupts timer_a.
taccr0=1000; //sets value timer_a count
tactl=mc_1+tassel_1; //tells timer_a count (mc_1) each time aclk ticks (tassel_1).

__bis_sr_register(gie+lpm4_bits);// enables interrupts globally , enters lpm4
}

void mrfi_rxcompleteisr()
{
p1out ^= 0x02;// toggle both leds
}


#pragma vector=port1_vector // declare function should called when interrupt of type port1_vector happens
__interrupt void port_1 (void)
{
p1ifg &= ~0x04; //resets interrupt flag
mrfipacket_t packet;
packet.frame[0]=8+20;
mrfi_transmit(&packet, mrfi_tx_type_forced);
p1out ^= 0x01;// toggle red led p1.0
}


, if put on both target boards have next situation: start both boards both leds off,if press button on end device ,nothing happens,not blinking leds on either of boards..and if press button on access point both leds on ap , ed on,but not blinking(it may have smth frequency?)

in advance information give me.
have nice day.

first, use code tags mark code. , text isn't more readable if in bold.

make blinking led, have turn on , off. when control led program, blinking, means have stop somehow, let blink again. blinking fast see if wasn't blinking. that's why if turn led on , off, happen within microsecond (depends on crystal frequency) , won't see anything.

have turn on, stop few miliseconds turn off , on.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk msp430 :if a button is pressed on ED create a link to the AP and blink his leds


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support