OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [xilinx_diligent_s3board/] [software/] [ta_uart/] [hardware.h] - Blame information for rev 211

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 olivier.gi
#ifndef HARDWARE_H
2
#define HARDWARE_H
3
 
4 143 olivier.gi
#include <msp430.h>
5
#include <legacymsp430.h>
6 2 olivier.gi
#include <iomacros.h>
7
 
8
 
9
//PINS
10
//PORT1
11
#define TX              BIT1
12
 
13
//PORT2
14
#define RX              BIT2
15
#define LED             BIT1
16
 
17
//Port Output Register 'P1OUT, P2OUT':
18
#define P1OUT_INIT      TX              //Init Output data of port1
19
#define P2OUT_INIT      0               //Init Output data of port2
20
#define P3OUT_INIT      0               //Init Output data of port3
21
 
22
//Port Direction Register 'P1DIR, P2DIR':
23
#define P1DIR_INIT      TX              //Init of Port1 Data-Direction Reg (Out=1 / Inp=0)
24
#define P2DIR_INIT      ~RX             //Init of Port2 Data-Direction Reg (Out=1 / Inp=0)
25
#define P3DIR_INIT      0xff            //Init of Port3 Data-Direction Reg (Out=1 / Inp=0)
26
 
27
//Selection of Port or Module -Function on the Pins 'P1SEL, P2SEL'
28
#define P1SEL_INIT      0               //P1-Modules:
29
#define P2SEL_INIT      RX              //P2-Modules:
30
#define P3SEL_INIT      0               //P3-Modules:
31
 
32
//Interrupt capabilities of P1 and P2
33
#define P1IE_INIT       0               //Interrupt Enable (0=dis 1=enabled)
34
#define P2IE_INIT       0               //Interrupt Enable (0=dis 1=enabled)
35
#define P1IES_INIT      0               //Interrupt Edge Select (0=pos 1=neg)
36
#define P2IES_INIT      0               //Interrupt Edge Select (0=pos 1=neg)
37
 
38
#define IE_INIT         0
39
#define WDTCTL_INIT     WDTPW|WDTHOLD
40
 
41
#define BCSCTL1_FLL     XT2OFF|DIVA1|RSEL2|RSEL0
42
#define BCSCTL2_FLL     0
43
#define TACTL_FLL       TASSEL_2|TACLR
44
#define CCTL2_FLL       CM0|CCIS0|CAP
45
 
46
#define TACTL_AFTER_FLL TASSEL_2|TACLR|ID_0
47
 
48
//#define BAUD            40              //9600 @3MHz div 8
49
//#define BAUD            20              //19200 @3MHz div 8
50
//#define BAUD            20              //9600 @1.5MHz div 8
51
//#define BAUD            140              //9600 @1.5MHz div 8
52
 
53
//#define BAUD           2083              //9600 @20.0MHz div 1
54
//#define BAUD           1042              //19200 @20.0MHz div 1
55
//#define BAUD            521              //38400 @20.0MHz div 1
56
//#define BAUD            347              //57600 @20.0MHz div 1
57
#define BAUD            174              //115200 @20.0MHz div 1
58
//#define BAUD             87              //230400 @20.0MHz div 1
59
 
60
//Selection of 'Digitally Controlled Oszillator' (desired frquency in HZ, 1..3 MHz)
61
#define DCO_FREQ        1536000         //3072000/2 makes 9600 a bit more precise
62
 
63
//Automatic, do not edit
64
#define DCO_FSET        (DCO_FREQ/8192) //DCO_FSET = DCO_FREQ / (32768/4)
65
#define DCOCTL_MAX      0xff            // Used from FLL to check when Rsel must be changed
66
#define DCOCTL_MIN      0               // Used from FLL to check when Rsel must be changed
67
 
68
 
69
#endif //HARDWARE_H

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.