and crossover, baud rate generator, regulator and baud rate register. The following is a diagram of the baud rate generator: divide factor N is determined by the frequency of the clock (BRCLK) sent to the divider counter and the desired baud rate to determine the: n=brclk/baud rate divisor factor as defined below: n=ubr+ (m7+m6+m5+m4+m3+ M2+M1+M0)/8 Interrupt: The Usart module has received and sent two separate interrupt sources. Use two separate interrupt vectors, one for receiving interrupt t
Code One:1 /**********************************2 program function: Use the key to control the LED lights off3 ***********************************/4#include 5 6 voidint_clk ();7 voidMain ()8 {9Wdtctl = Wdtpw +Wdthold;Ten int_clk (); OneP1dir =0Xf0; AP1out =0Xff; -P6dir =0XFF; -P6out =0x00; the while(1) - { - Switch(P1in 0X0F) - { + Case 0x0e:P 6OUT =0XC0; Break; - Case 0x0d:P 6OUT =0X30; Break; + Case 0x0b:P 6OUT =0X0C; Break; A Case 0x07:P 6OUT =0X03; Break; at
reference.3. The system clock is the commander of a program running. Timing and interruption are also the core and central axis of the entire program. 430 has a maximum of three oscillator, dCO internal oscillator; lfxt1 external low frequency oscillator, common 32768Hz, without external load capacitor; can also be connected to high frequency 450 kHz-8 m, need to be connected to the load capacitor; xt2 is connected to high-frequency 450 kHz-8 m, and an external capacitor is added. (In experienc
Code1 /***********************************2 program function: Control LED status with key3 Disadvantage: The button can not change the status of the LED after pressing, you may use the Reset button on the board ^~^4 *************************************/5#include 6 7 intK,i=0;8 voidint_clk ();9 voidLedintn);Ten voidMain () One { AWdtctl = Wdtpw +Wdthold; - int_clk (); -P1dir =0Xf0; theP1out =0XFF; -P6dir =0XFF; -P6out =0XFF; - + while(1) - { +P1out =0X0F; A if(p1in! =0X0F) at { -
; SCI downstream data is transmitted from the master processor to the Neuron chip.
2.2 consumer StackSoftware Implementation
Use the provided Neuron C template for case modification. It mainly modifies the statements related to the MSP430F149 processor in ldvsci. h and ldvsci. c.
In ldvsci. h, modify it:
# Define ENABLE_RX_TX () (ME1 | = UTXE0 + URXE0)
# Define enable_tx_isr () (ie1 | = 0x80)
# Define enable_tx_complete_isr () (ifg1 | = 0x80) // usart
, and stop bit can be controlled by the internal registers of the single chip microcomputer. Both Single Chip Microcomputer have two usart modules and two sets of independent register groups; when the following register hits, X indicates 0 or 1, 0 indicates the register corresponding to the 0 module, and 1 indicates the register corresponding to the 1 module. Among them, the control bits related to the serial port Mode settings are located in the uxctl register, the receiving-related control bit
First notice a few questions:1,SPI Communication, the timing (phase, polarity) of both sides must be the same (see SPI four timing settings)2, the host sets the clock, the slave does not need to set the clock.3, clock on the pin, when there is data transmission, only the clock, no data transmission, there is no clockTest the following program on the msp430f149 successful experiment, for two board communicationHost:(SPI. C#include #define Uspi3on P3sel |= 0X0E#define Uspi4on P3sel |= 0X0FChar txf
#include /* For UART0 serial port configuration, and Operation function Description *//* First, UART0 initialization */ voidUart0_idev_init (void) {P3sel |= BIT4 + BIT5;//1. Select P3.4 and P3.5 to do UART0 communication portME1 |= UTXE0 + URXE0;//2. Enable USART0 to be sent and acceptedUCTL0 |= CHAR;//3. Select 8-bit charactersUTCTL0 |= SSEL0;//4. Select Clock Source, Aclk:ssel0 //Smclk:ssel1UBR00 =0x03;//5. Baud Rate 32767hz:9600UBR10 =0x00;//UMCTL0 =0x4A;//M
//: Playground-noun:a Place where people can playImport UIKit//protocol---in the--swift standard library////1. Example comparison: Determine whether two instance values are the sameLet A =4, B =4a= = B//(comparison of type int)//custom struct type, compare for equalitystructGames {var wincount:int var losecount:int}let G1= Games (Wincount:2, Losecount:1) Let G2= Games (Wincount:2, Losecount:1)//G1 = = G2//custom types Determine whether equality is required to comply with the protocol equatableex
when the ENC is low, and you will be reset during por)Each conversion memory has a corresponding conversion memory control register. Therefore, when csstartadd is used to convert the memory address bit, adc12mctlx is also determined. The Register has the following meanings:Bit7 bit6 ~ 4 bit3 ~ 0EOS sref inchEOS-sequence end control bit0: The sequence has not ended.1: The last conversion in the sequenceSref-reference voltage source selection bit0: vr + = avcc, VR-= AVSS1: vr + = vref +, VR-= AVS
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.