├── AVR Studio 4 Software Project
└── L297-L298-Stepper-Driver
│ ├── L297-L298-Stepper-Driver.aps
│ ├── L297-L298-Stepper-Driver.c
│ ├── TinyWireM.cpp
│ ├── TinyWireM.h
│ ├── USI_TWI_Master.cpp
│ ├── USI_TWI_Master.h
│ ├── default
│ ├── L297-L298-Stepper-Driver.eep
│ ├── L297-L298-Stepper-Driver.elf
│ ├── L297-L298-Stepper-Driver.hex
│ ├── L297-L298-Stepper-Driver.lss
│ ├── L297-L298-Stepper-Driver.map
│ ├── L297-L298-Stepper-Driver.o
│ ├── Makefile
│ ├── USI_TWI_Master.o
│ ├── dep
│ │ ├── L297-L298-Stepper-Driver.o.d
│ │ ├── USI_TWI_Master.o.d
│ │ ├── serial.o.d
│ │ └── usi_i2c_master.o.d
│ ├── serial.o
│ └── usi_i2c_master.o
│ ├── l297-l298-stepper-driver.aws
│ ├── serial.c
│ ├── serial.h
│ ├── usi_i2c_master.c
│ └── usi_i2c_master.h
├── EAGLE Board Files
├── StepperDriver Rev0.1.b#1
├── StepperDriver Rev0.1.b#2
├── StepperDriver Rev0.1.b#3
├── StepperDriver Rev0.1.b#4
├── StepperDriver Rev0.1.b#5
├── StepperDriver Rev0.1.b#6
├── StepperDriver Rev0.1.b#7
├── StepperDriver Rev0.1.b#8
├── StepperDriver Rev0.1.b#9
├── StepperDriver Rev0.1.brd
├── StepperDriver Rev0.1.s#1
├── StepperDriver Rev0.1.s#2
├── StepperDriver Rev0.1.s#3
├── StepperDriver Rev0.1.s#4
├── StepperDriver Rev0.1.s#5
├── StepperDriver Rev0.1.s#6
├── StepperDriver Rev0.1.s#7
├── StepperDriver Rev0.1.s#8
├── StepperDriver Rev0.1.sch
├── StepperDriver Rev0.brd
├── StepperDriver Rev1.b##
├── StepperDriver Rev1.b#1
├── StepperDriver Rev1.b#2
├── StepperDriver Rev1.b#3
├── StepperDriver Rev1.b#4
├── StepperDriver Rev1.b#5
├── StepperDriver Rev1.b#6
├── StepperDriver Rev1.b#7
├── StepperDriver Rev1.b#8
├── StepperDriver Rev1.b#9
├── StepperDriver Rev1.brd
├── StepperDriver Rev1.s#1
├── StepperDriver Rev1.s#2
├── StepperDriver Rev1.s#3
├── StepperDriver Rev1.s#4
├── StepperDriver Rev1.s#5
├── StepperDriver Rev1.s#6
├── StepperDriver Rev1.sch
├── StepperDriver Rev2.b##
├── StepperDriver Rev2.b#1
├── StepperDriver Rev2.b#2
├── StepperDriver Rev2.b#3
├── StepperDriver Rev2.b#4
├── StepperDriver Rev2.b#5
├── StepperDriver Rev2.b#6
├── StepperDriver Rev2.b#7
├── StepperDriver Rev2.b#8
├── StepperDriver Rev2.b#9
├── StepperDriver Rev2.brd
├── StepperDriver Rev2.s#1
├── StepperDriver Rev2.s#2
├── StepperDriver Rev2.s#3
├── StepperDriver Rev2.s#4
├── StepperDriver Rev2.s#5
├── StepperDriver Rev2.s#6
├── StepperDriver Rev2.s#7
├── StepperDriver Rev2.s#8
├── StepperDriver Rev2.s#9
├── StepperDriver Rev2.sch
├── StepperDriver.b#1
├── StepperDriver.b#2
├── StepperDriver.b#3
├── StepperDriver.b#4
├── StepperDriver.b#5
├── StepperDriver.b#6
├── StepperDriver.b#7
├── StepperDriver.b#8
├── StepperDriver.b#9
├── StepperDriver.pro
├── StepperDriver.s#1
├── StepperDriver.s#2
├── StepperDriver.s#3
├── StepperDriver.s#4
├── StepperDriver.s#5
├── StepperDriver.s#6
├── StepperDriver.s#7
├── StepperDriver.s#8
├── StepperDriver.s#9
├── StepperDriver.sch
└── eagle.epf
├── README
└── UnipolarStepperDriver
├── UnipolarStepperDriver.aps
├── UnipolarStepperDriver.c
├── default
├── Makefile
├── UnipolarStepperDriver.eep
├── UnipolarStepperDriver.elf
├── UnipolarStepperDriver.hex
├── UnipolarStepperDriver.lss
├── UnipolarStepperDriver.map
├── UnipolarStepperDriver.o
├── dep
│ ├── UnipolarStepperDriver.o.d
│ ├── serial.o.d
│ ├── usi_i2c_master.o.d
│ └── usi_i2c_slave.o.d
├── serial.o
├── usi_i2c_master.o
└── usi_i2c_slave.o
├── serial.c
├── serial.h
├── unipolarstepperdriver.aws
├── usi_i2c_master.c
├── usi_i2c_master.h
├── usi_i2c_slave.c
└── usi_i2c_slave.h
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/L297-L298-Stepper-Driver.aps:
--------------------------------------------------------------------------------
1 | L297-L298-Stepper-Driver23-Jan-2012 21:06:4121-Mar-2012 14:45:54241023-Jan-2012 21:06:4144, 18, 0, 685AVR GCCdefault\L297-L298-Stepper-Driver.elfE:\Programming\Stepper Motor Controller\AVR Studio 4 Software Project\L297-L298-Stepper-Driver\AVR SimulatorATtiny2313falseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000L297-L298-Stepper-Driver.cserial.cusi_i2c_master.cUSI_TWI_Master.cppserial.husi_i2c_master.hUSI_TWI_Master.hdefault\L297-L298-Stepper-Driver.lssdefault\L297-L298-Stepper-Driver.mapdefaultNOattiny231311
L297-L298-Stepper-Driver.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\WinAVR-20090313\bin\avr-gcc.exeC:\WinAVR-20090313\utils\bin\make.exe00000L297-L298-Stepper-Driver.c100001serial.c100002serial.h100003usi_i2c_master.c100004usi_i2c_master.h100005USI_TWI_Master.cpp1
2 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/L297-L298-Stepper-Driver.c:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------*\
2 | | L297 Stepper Motor Controller with Serial and I2C Interface |
3 | | Based on ATTiny2313 microcontroller, this motor controller |
4 | | can drive stepper motors using the ST L297/298 chipset |
5 | | |
6 | | Adam Honse (amhb59@mail.mst.edu, calcprogrammer1@gmail.com) |
7 | | 3/16/2012, Designed for Senior Design Project |
8 | \*-------------------------------------------------------------*/
9 |
10 | #include
11 | #include
12 | #include
13 | #include "serial.h"
14 | #include "usi_i2c_master.h"
15 |
16 | //L297 Pins on Port B
17 | #define L297_PORTB_DDR 0b00011111
18 | #define L297_PIN_HF PB0
19 | #define L297_PIN_CW_CCW PB1
20 | #define L297_PIN_CLOCK PB2
21 | #define L297_PIN_SYNC PB3
22 | #define L297_PIN_ENABLE PB4
23 |
24 | //L297 Pins on Port D
25 | #define L297_PORTD_DDR 0b01100000
26 | #define L297_PIN_HOME PD2
27 | #define L297_PIN_CNTL PD5
28 | #define L297_PIN_RESET PD6
29 |
30 | //Set up the timer overflow to generate a clock for the L297's SYNC line
31 | void setup_l297_clock()
32 | {
33 | DDRB = L297_PORTB_DDR;
34 | DDRD = L297_PORTD_DDR;
35 |
36 | OCR1A = 0;
37 | TCCR1A = ((1 << COM1A1) | (1 << WGM10) | (1 << WGM11));
38 | TCCR1B = ((1 << CS10) | (0 << CS11) | (1 << CS12) | (0 << WGM12));
39 | TIMSK = (0<
19 | //#include
20 | //#include
21 | }
22 |
23 | #include "USI_TWI_Master.h"
24 | #include "TinyWireM.h"
25 |
26 |
27 | // Initialize Class Variables //////////////////////////////////////////////////
28 | uint8_t USI_TWI::USI_Buf[USI_BUF_SIZE]; // holds I2C send and receive data
29 | uint8_t USI_TWI::USI_BufIdx = 0; // current number of bytes in the send buff
30 | uint8_t USI_TWI::USI_LastRead = 0; // number of bytes read so far
31 | uint8_t USI_TWI::USI_BytesAvail = 0; // number of bytes requested but not read
32 |
33 | // Constructors ////////////////////////////////////////////////////////////////
34 |
35 | USI_TWI::USI_TWI(){
36 | }
37 |
38 | // Public Methods //////////////////////////////////////////////////////////////
39 |
40 | void USI_TWI::begin(){ // initialize I2C lib
41 | USI_TWI_Master_Initialise();
42 | }
43 |
44 | void USI_TWI::beginTransmission(uint8_t slaveAddr){ // setup address & write bit
45 | USI_BufIdx = 0;
46 | USI_Buf[USI_BufIdx] = (slaveAddr<= USI_BUF_SIZE) return; // dont blow out the buffer
51 | USI_BufIdx++; // inc for next byte in buffer
52 | USI_Buf[USI_BufIdx] = data;
53 | }
54 |
55 | uint8_t USI_TWI::endTransmission(){ // actually sends the buffer
56 | bool xferOK = false;
57 | uint8_t errorCode = 0;
58 | xferOK = USI_TWI_Start_Read_Write(USI_Buf,USI_BufIdx+1); // core func that does the work
59 | USI_BufIdx = 0;
60 | if (xferOK) return 0;
61 | else { // there was an error
62 | errorCode = USI_TWI_Get_State_Info(); // this function returns the error number
63 | return errorCode;
64 | }
65 | }
66 |
67 | uint8_t USI_TWI::requestFrom(uint8_t slaveAddr, uint8_t numBytes){ // setup for receiving from slave
68 | bool xferOK = false;
69 | uint8_t errorCode = 0;
70 | USI_LastRead = 0;
71 | USI_BytesAvail = numBytes; // save this off in a global
72 | numBytes++; // add extra byte to transmit header
73 | USI_Buf[0] = (slaveAddr<
41 | #define USI_SEND 0 // indicates sending to TWI
42 | #define USI_RCVE 1 // indicates receiving from TWI
43 | #define USI_BUF_SIZE 16 // bytes in message buffer
44 |
45 | class USI_TWI
46 | {
47 | private:
48 | static uint8_t USI_Buf[]; // holds I2C send and receive data
49 | static uint8_t USI_BufIdx; // current number of bytes in the send buff
50 | static uint8_t USI_LastRead; // number of bytes read so far
51 | static uint8_t USI_BytesAvail; // number of bytes requested but not read
52 |
53 | public:
54 | USI_TWI();
55 | void begin();
56 | void beginTransmission(uint8_t);
57 | void send(uint8_t);
58 | uint8_t endTransmission();
59 | uint8_t requestFrom(uint8_t, uint8_t);
60 | uint8_t receive();
61 | uint8_t available();
62 | };
63 |
64 | extern USI_TWI TinyWireM;
65 |
66 | #endif
67 |
68 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/USI_TWI_Master.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | *
3 | *
4 | * File USI_TWI_Master.c compiled with gcc
5 | * Date Friday, 10/31/08 Boo!
6 | * Updated by jkl
7 | *
8 |
9 | * AppNote : AVR310 - Using the USI module as a TWI Master
10 | *
11 | * Extensively modified to provide complete I2C driver.
12 | *
13 | *Notes:
14 | * - T4_TWI and T2_TWI delays are modified to work with 1MHz default clock
15 | * and now use hard code values. They would need to change
16 | * for other clock rates. Refer to the Apps Note.
17 | *
18 | * 12/17/08 Added USI_TWI_Start_Memory_Read Routine -jkl
19 | * Note msg buffer will have slave adrs ( with write bit set) and memory adrs;
20 | * length should be these two bytes plus the number of bytes to read.
21 | ****************************************************************************/
22 | #include
23 | #define F_CPU 1000000UL // Sets up the default speed for delay.h
24 | #include
25 | #include
26 | #include "USI_TWI_Master.h"
27 |
28 | unsigned char USI_TWI_Start_Transceiver_With_Data( unsigned char * , unsigned char );
29 | unsigned char USI_TWI_Master_Transfer( unsigned char );
30 | unsigned char USI_TWI_Master_Stop( void );
31 | unsigned char USI_TWI_Master_Start( void );
32 |
33 | union USI_TWI_state
34 | {
35 | unsigned char errorState; // Can reuse the TWI_state for error states since it will not be needed if there is an error.
36 | struct
37 | {
38 | unsigned char addressMode : 1;
39 | unsigned char masterWriteDataMode : 1;
40 | unsigned char memReadMode : 1;
41 | unsigned char unused : 5;
42 | };
43 | } USI_TWI_state;
44 |
45 | /*---------------------------------------------------------------
46 | USI TWI single master initialization function
47 | ---------------------------------------------------------------*/
48 | void USI_TWI_Master_Initialise( void )
49 | {
50 | PORT_USI |= (1< (unsigned char*)RAMEND) // Test if address is outside SRAM space
146 | {
147 | USI_TWI_state.errorState = USI_TWI_DATA_OUT_OF_BOUND;
148 | return (FALSE);
149 | }
150 | if(msgSize <= 1) // Test if the transmission buffer is empty
151 | {
152 | USI_TWI_state.errorState = USI_TWI_NO_DATA;
153 | return (FALSE);
154 | }
155 | #endif
156 |
157 | #ifdef NOISE_TESTING // Test if any unexpected conditions have arrived prior to this execution.
158 | if( USISR & (1<4,7us
29 | #define T4_TWI 4 // >4,0us
30 |
31 | // Defines error code generating
32 | //#define PARAM_VERIFICATION
33 | //#define NOISE_TESTING
34 | #define SIGNAL_VERIFY // This should probably be on always.
35 |
36 | /****************************************************************************
37 | Bit and byte definitions
38 | ****************************************************************************/
39 | #define TWI_READ_BIT 0 // Bit position for R/W bit in "address byte".
40 | #define TWI_ADR_BITS 1 // Bit position for LSB of the slave address bits in the init byte.
41 | #define TWI_NACK_BIT 0 // Bit position for (N)ACK bit.
42 |
43 | // Note these have been renumbered from the Atmel Apps Note. Most likely errors are now
44 | // lowest numbers so they're easily recognized as LED flashes.
45 | #define USI_TWI_NO_DATA 0x08 // Transmission buffer is empty
46 | #define USI_TWI_DATA_OUT_OF_BOUND 0x09 // Transmission buffer is outside SRAM space
47 | #define USI_TWI_UE_START_CON 0x07 // Unexpected Start Condition
48 | #define USI_TWI_UE_STOP_CON 0x06 // Unexpected Stop Condition
49 | #define USI_TWI_UE_DATA_COL 0x05 // Unexpected Data Collision (arbitration)
50 | #define USI_TWI_NO_ACK_ON_DATA 0x02 // The slave did not acknowledge all data
51 | #define USI_TWI_NO_ACK_ON_ADDRESS 0x01 // The slave did not acknowledge the address
52 | #define USI_TWI_MISSING_START_CON 0x03 // Generated Start Condition not detected on bus
53 | #define USI_TWI_MISSING_STOP_CON 0x04 // Generated Stop Condition not detected on bus
54 | #define USI_TWI_BAD_MEM_READ 0x0A // Error during external memory read
55 |
56 | // Device dependant defines ADDED BACK IN FROM ORIGINAL ATMEL .H
57 |
58 | #if defined(__AVR_AT90Mega169__) | defined(__AVR_ATmega169__) | \
59 | defined(__AVR_AT90Mega165__) | defined(__AVR_ATmega165__) | \
60 | defined(__AVR_ATmega325__) | defined(__AVR_ATmega3250__) | \
61 | defined(__AVR_ATmega645__) | defined(__AVR_ATmega6450__) | \
62 | defined(__AVR_ATmega329__) | defined(__AVR_ATmega3290__) | \
63 | defined(__AVR_ATmega649__) | defined(__AVR_ATmega6490__)
64 | #define DDR_USI DDRE
65 | #define PORT_USI PORTE
66 | #define PIN_USI PINE
67 | #define PORT_USI_SDA PORTE5
68 | #define PORT_USI_SCL PORTE4
69 | #define PIN_USI_SDA PINE5
70 | #define PIN_USI_SCL PINE4
71 | #endif
72 |
73 | #if defined(__AVR_ATtiny25__) | defined(__AVR_ATtiny45__) | defined(__AVR_ATtiny85__) | \
74 | defined(__AVR_AT90Tiny26__) | defined(__AVR_ATtiny26__)
75 | #define DDR_USI DDRB
76 | #define PORT_USI PORTB
77 | #define PIN_USI PINB
78 | #define PORT_USI_SDA PORTB0
79 | #define PORT_USI_SCL PORTB2
80 | #define PIN_USI_SDA PINB0
81 | #define PIN_USI_SCL PINB2
82 | #endif
83 |
84 | #if defined(__AVR_AT90Tiny2313__) | defined(__AVR_ATtiny2313__)
85 | #define DDR_USI DDRB
86 | #define PORT_USI PORTB
87 | #define PIN_USI PINB
88 | #define PORT_USI_SDA PORTB5
89 | #define PORT_USI_SCL PORTB7
90 | #define PIN_USI_SDA PINB5
91 | #define PIN_USI_SCL PINB7
92 | #endif
93 |
94 | /* From the original .h
95 | // Device dependant defines - These for ATtiny2313. // CHANGED FOR ATtiny85
96 |
97 | #define DDR_USI DDRB
98 | #define PORT_USI PORTB
99 | #define PIN_USI PINB
100 | #define PORT_USI_SDA PORTB0 // was PORTB5 - N/U
101 | #define PORT_USI_SCL PORTB2 // was PORTB7 - N/U
102 | #define PIN_USI_SDA PINB0 // was PINB5
103 | #define PIN_USI_SCL PINB2 // was PINB7
104 | */
105 |
106 | // General defines
107 | #define TRUE 1
108 | #define FALSE 0
109 |
110 | //********** Prototypes **********//
111 |
112 | void USI_TWI_Master_Initialise( void );
113 | unsigned char USI_TWI_Start_Random_Read( unsigned char * , unsigned char );
114 | unsigned char USI_TWI_Start_Read_Write( unsigned char * , unsigned char );
115 | unsigned char USI_TWI_Get_State_Info( void );
116 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.eep:
--------------------------------------------------------------------------------
1 | :00000001FF
2 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.elf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.elf
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.hex:
--------------------------------------------------------------------------------
1 | :1000000012C01FC01EC01DC01CC01BC01AC051C0E2
2 | :1000100018C017C016C015C014C013C012C011C03C
3 | :1000200010C00FC00EC011241FBECFEDCDBF10E019
4 | :10003000A0E6B0E001C01D92A237B107E1F712D0EF
5 | :10004000C9C1DECF8FE187BB80E681BB1BBC1ABC78
6 | :1000500083E88FBD85E08EBD19BE8FEF90E09BBD1C
7 | :100060008ABD0895CF93DF938CE090E046D08FE176
8 | :1000700087BB80E681BB1BBC1ABC83E88FBD85E0D3
9 | :100080008EBD19BE8FEF90E09BBD8ABD66D0C49A2D
10 | :1000900020E137E2C8ECD0E005C0CE010197F1F7CE
11 | :1000A0002150304021153105C1F7BED020E137E2A3
12 | :1000B000F4CF1F920F920FB60F9211248F939F933C
13 | :1000C000EF93FF93809170009CB1E82FF0E0E05A2D
14 | :1000D000FF4F90838F5F80937000813410F01092F7
15 | :1000E0007000FF91EF919F918F910F900FBE0F9035
16 | :1000F0001F90189580917000089592B989B986E093
17 | :1001000083B988E98AB9089590917000992311F410
18 | :1001100020E00EC020916000E0E6F0E08181819354
19 | :1001200080E0EF39F807D1F710829150909370007A
20 | :10013000822F08951092700008955D9BFECF0000FD
21 | :100140008CB90895FC0105C05D9BFECF00008CB901
22 | :10015000319680818823C1F7089588B3806A88BB6F
23 | :1001600087B38F7587BB8FEF8FB98AE28DB980EF28
24 | :100170008EB908958FB980EF8EB935E09BE222E009
25 | :10018000832F8A95F1F79DB9B79BFECF822F8A9571
26 | :10019000F1F79DB9769BF4CF85E08A95F1F78FB1A1
27 | :1001A0009FEF9FB9BD9A08950F931F93CF93DF934D
28 | :1001B0008C01EB01C798F80181918F018FB98EEF07
29 | :1001C000D9DFBD988EEFD6DF2197A1F780E090E0D0
30 | :1001D000DF91CF911F910F910895FF920F931F937D
31 | :1001E000CF93DF938C01EB01FF24FA94BD9880EF4D
32 | :1001F000C1DFF80181938F01C130D10511F4FFB83F
33 | :1002000001C01FB88EEFB6DF219781F780E090E044
34 | :10021000DF91CF911F910F91FF90089580E090E0C2
35 | :10022000089580E090E00895C598C79AB79BFECFE7
36 | :10023000C59A0895C598C7980895C59AC79ABF9A50
37 | :10024000BD9A8FEF8FB98AE28DB980EF8EB908958C
38 | :100250008091710008958EB921E09BE2822F8A95EA
39 | :10026000F1F79DB9B79BFECF822F8A95F1F79DB923
40 | :10027000769BF4CF81E08A95F1F78FB19FEF9FB91C
41 | :10028000BD9A0895C79AC79BFECF81E0982F9A9593
42 | :10029000F1F7C5988A95F1F7C798C59A779B02C080
43 | :1002A00081E0089583E08093710080E00895C5980F
44 | :1002B000C79AB79BFECF81E0982F9A95F1F7C59A20
45 | :1002C0008A95F1F7759B02C081E0089584E08093E0
46 | :1002D000710080E00895CF92DF92EF92FF920F932A
47 | :1002E0001F93CF93DF938C01E62E90917100892F9D
48 | :1002F000816080937100F801808180FD03C093606C
49 | :1003000090937100BFDF882309F44DC0FE2CE801F3
50 | :10031000CC24C394DD24DA948091710080FD02C066
51 | :1003200081FF2EC0C79888818FB980EF94DFBD9878
52 | :100330008EEF91DF9091710080FF09C090FF02C0A5
53 | :1003400081E001C082E08093710080E02CC090FDCC
54 | :1003500010C092FF0EC0F801808181608083C0923E
55 | :10036000710090DF882319F0FE2CE80116C08AE0A6
56 | :10037000EACF2196809171008E7F809371000DC02D
57 | :10038000BD9880EF68DF8883F1E0FF1611F4DFB8D5
58 | :1003900001C01FB821968EEF5EDFFA9409F0BCCF42
59 | :1003A00086DF811181E0DF91CF911F910F91FF9046
60 | :1003B000EF90DF90CF900895109271008CDF089538
61 | :1003C000FC0180818E7F808384E080937100CF0167
62 | :0803D00082DF0895F894FFCFCD
63 | :00000001FF
64 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.lss:
--------------------------------------------------------------------------------
1 |
2 | L297-L298-Stepper-Driver.elf: file format elf32-avr
3 |
4 | Sections:
5 | Idx Name Size VMA LMA File off Algn
6 | 0 .text 000003d8 00000000 00000000 00000074 2**1
7 | CONTENTS, ALLOC, LOAD, READONLY, CODE
8 | 1 .bss 00000012 00800060 00800060 0000044c 2**0
9 | ALLOC
10 | 2 .debug_aranges 00000080 00000000 00000000 0000044c 2**0
11 | CONTENTS, READONLY, DEBUGGING
12 | 3 .debug_pubnames 000002c8 00000000 00000000 000004cc 2**0
13 | CONTENTS, READONLY, DEBUGGING
14 | 4 .debug_info 00000aaf 00000000 00000000 00000794 2**0
15 | CONTENTS, READONLY, DEBUGGING
16 | 5 .debug_abbrev 00000526 00000000 00000000 00001243 2**0
17 | CONTENTS, READONLY, DEBUGGING
18 | 6 .debug_line 000009f3 00000000 00000000 00001769 2**0
19 | CONTENTS, READONLY, DEBUGGING
20 | 7 .debug_frame 000001d0 00000000 00000000 0000215c 2**2
21 | CONTENTS, READONLY, DEBUGGING
22 | 8 .debug_str 00000659 00000000 00000000 0000232c 2**0
23 | CONTENTS, READONLY, DEBUGGING
24 | 9 .debug_loc 0000035e 00000000 00000000 00002985 2**0
25 | CONTENTS, READONLY, DEBUGGING
26 | 10 .debug_ranges 00000090 00000000 00000000 00002ce3 2**0
27 | CONTENTS, READONLY, DEBUGGING
28 |
29 | Disassembly of section .text:
30 |
31 | 00000000 <__vectors>:
32 | 0: 12 c0 rjmp .+36 ; 0x26 <__ctors_end>
33 | 2: 1f c0 rjmp .+62 ; 0x42 <__bad_interrupt>
34 | 4: 1e c0 rjmp .+60 ; 0x42 <__bad_interrupt>
35 | 6: 1d c0 rjmp .+58 ; 0x42 <__bad_interrupt>
36 | 8: 1c c0 rjmp .+56 ; 0x42 <__bad_interrupt>
37 | a: 1b c0 rjmp .+54 ; 0x42 <__bad_interrupt>
38 | c: 1a c0 rjmp .+52 ; 0x42 <__bad_interrupt>
39 | e: 51 c0 rjmp .+162 ; 0xb2 <__vector_7>
40 | 10: 18 c0 rjmp .+48 ; 0x42 <__bad_interrupt>
41 | 12: 17 c0 rjmp .+46 ; 0x42 <__bad_interrupt>
42 | 14: 16 c0 rjmp .+44 ; 0x42 <__bad_interrupt>
43 | 16: 15 c0 rjmp .+42 ; 0x42 <__bad_interrupt>
44 | 18: 14 c0 rjmp .+40 ; 0x42 <__bad_interrupt>
45 | 1a: 13 c0 rjmp .+38 ; 0x42 <__bad_interrupt>
46 | 1c: 12 c0 rjmp .+36 ; 0x42 <__bad_interrupt>
47 | 1e: 11 c0 rjmp .+34 ; 0x42 <__bad_interrupt>
48 | 20: 10 c0 rjmp .+32 ; 0x42 <__bad_interrupt>
49 | 22: 0f c0 rjmp .+30 ; 0x42 <__bad_interrupt>
50 | 24: 0e c0 rjmp .+28 ; 0x42 <__bad_interrupt>
51 |
52 | 00000026 <__ctors_end>:
53 | 26: 11 24 eor r1, r1
54 | 28: 1f be out 0x3f, r1 ; 63
55 | 2a: cf ed ldi r28, 0xDF ; 223
56 | 2c: cd bf out 0x3d, r28 ; 61
57 |
58 | 0000002e <__do_clear_bss>:
59 | 2e: 10 e0 ldi r17, 0x00 ; 0
60 | 30: a0 e6 ldi r26, 0x60 ; 96
61 | 32: b0 e0 ldi r27, 0x00 ; 0
62 | 34: 01 c0 rjmp .+2 ; 0x38 <.do_clear_bss_start>
63 |
64 | 00000036 <.do_clear_bss_loop>:
65 | 36: 1d 92 st X+, r1
66 |
67 | 00000038 <.do_clear_bss_start>:
68 | 38: a2 37 cpi r26, 0x72 ; 114
69 | 3a: b1 07 cpc r27, r17
70 | 3c: e1 f7 brne .-8 ; 0x36 <.do_clear_bss_loop>
71 | 3e: 12 d0 rcall .+36 ; 0x64
72 | 40: c9 c1 rjmp .+914 ; 0x3d4 <_exit>
73 |
74 | 00000042 <__bad_interrupt>:
75 | 42: de cf rjmp .-68 ; 0x0 <__vectors>
76 |
77 | 00000044 <_Z16setup_l297_clockv>:
78 | #define L297_PIN_RESET PD6
79 |
80 | //Set up the timer overflow to generate a clock for the L297's SYNC line
81 | void setup_l297_clock()
82 | {
83 | DDRB = L297_PORTB_DDR;
84 | 44: 8f e1 ldi r24, 0x1F ; 31
85 | 46: 87 bb out 0x17, r24 ; 23
86 | DDRD = L297_PORTD_DDR;
87 | 48: 80 e6 ldi r24, 0x60 ; 96
88 | 4a: 81 bb out 0x11, r24 ; 17
89 |
90 | OCR1A = 0;
91 | 4c: 1b bc out 0x2b, r1 ; 43
92 | 4e: 1a bc out 0x2a, r1 ; 42
93 | TCCR1A = ((1 << COM1A1) | (1 << WGM10) | (1 << WGM11));
94 | 50: 83 e8 ldi r24, 0x83 ; 131
95 | 52: 8f bd out 0x2f, r24 ; 47
96 | TCCR1B = ((1 << CS10) | (0 << CS11) | (1 << CS12) | (0 << WGM12));
97 | 54: 85 e0 ldi r24, 0x05 ; 5
98 | 56: 8e bd out 0x2e, r24 ; 46
99 | TIMSK = (0<:
111 |
112 |
113 | int main()
114 | 64: cf 93 push r28
115 | 66: df 93 push r29
116 | {
117 | //Initialize serial interface to 38400 baud
118 | serial_init(12);
119 | 68: 8c e0 ldi r24, 0x0C ; 12
120 | 6a: 90 e0 ldi r25, 0x00 ; 0
121 | 6c: 46 d0 rcall .+140 ; 0xfa <_Z11serial_initj>
122 | #define L297_PIN_RESET PD6
123 |
124 | //Set up the timer overflow to generate a clock for the L297's SYNC line
125 | void setup_l297_clock()
126 | {
127 | DDRB = L297_PORTB_DDR;
128 | 6e: 8f e1 ldi r24, 0x1F ; 31
129 | 70: 87 bb out 0x17, r24 ; 23
130 | DDRD = L297_PORTD_DDR;
131 | 72: 80 e6 ldi r24, 0x60 ; 96
132 | 74: 81 bb out 0x11, r24 ; 17
133 |
134 | OCR1A = 0;
135 | 76: 1b bc out 0x2b, r1 ; 43
136 | 78: 1a bc out 0x2a, r1 ; 42
137 | TCCR1A = ((1 << COM1A1) | (1 << WGM10) | (1 << WGM11));
138 | 7a: 83 e8 ldi r24, 0x83 ; 131
139 | 7c: 8f bd out 0x2f, r24 ; 47
140 | TCCR1B = ((1 << CS10) | (0 << CS11) | (1 << CS12) | (0 << WGM12));
141 | 7e: 85 e0 ldi r24, 0x05 ; 5
142 | 80: 8e bd out 0x2e, r24 ; 46
143 | TIMSK = (0<
158 |
159 | //Enable L297
160 | PORTB |= (1 << L297_PIN_ENABLE);
161 | 8e: c4 9a sbi 0x18, 4 ; 24
162 | 90: 20 e1 ldi r18, 0x10 ; 16
163 | 92: 37 e2 ldi r19, 0x27 ; 39
164 | __asm__ volatile (
165 | "1: sbiw %0,1" "\n\t"
166 | "brne 1b"
167 | : "=w" (__count)
168 | : "0" (__count)
169 | );
170 | 94: c8 ec ldi r28, 0xC8 ; 200
171 | 96: d0 e0 ldi r29, 0x00 ; 0
172 | 98: 05 c0 rjmp .+10 ; 0xa4
173 | 9a: ce 01 movw r24, r28
174 | 9c: 01 97 sbiw r24, 0x01 ; 1
175 | 9e: f1 f7 brne .-4 ; 0x9c
176 | __ticks = (uint16_t) (__ms * 10.0);
177 | while(__ticks)
178 | {
179 | // wait 1/10 ms
180 | _delay_loop_2(((F_CPU) / 4e3) / 10);
181 | __ticks --;
182 | a0: 21 50 subi r18, 0x01 ; 1
183 | a2: 30 40 sbci r19, 0x00 ; 0
184 | __ticks = 1;
185 | else if (__tmp > 65535)
186 | {
187 | // __ticks = requested delay in 1/10 ms
188 | __ticks = (uint16_t) (__ms * 10.0);
189 | while(__ticks)
190 | a4: 21 15 cp r18, r1
191 | a6: 31 05 cpc r19, r1
192 | a8: c1 f7 brne .-16 ; 0x9a
193 |
194 | while(1)
195 | {
196 | _delay_ms(1000);
197 | usi_i2c_master_stop();
198 | aa: be d0 rcall .+380 ; 0x228 <_Z19usi_i2c_master_stopv>
199 | ac: 20 e1 ldi r18, 0x10 ; 16
200 | ae: 37 e2 ldi r19, 0x27 ; 39
201 | b0: f4 cf rjmp .-24 ; 0x9a
202 |
203 | 000000b2 <__vector_7>:
204 |
205 | unsigned char buffer[16]; //Serial buffer
206 | unsigned char buffer_pos = 0; //Current use of buffer
207 |
208 | //USART Receive interrupt pushes the incoming byte into the buffer
209 | ISR(USART_RX_vect)
210 | b2: 1f 92 push r1
211 | b4: 0f 92 push r0
212 | b6: 0f b6 in r0, 0x3f ; 63
213 | b8: 0f 92 push r0
214 | ba: 11 24 eor r1, r1
215 | bc: 8f 93 push r24
216 | be: 9f 93 push r25
217 | c0: ef 93 push r30
218 | c2: ff 93 push r31
219 | {
220 | buffer[buffer_pos] = UDR;
221 | c4: 80 91 70 00 lds r24, 0x0070
222 | c8: 9c b1 in r25, 0x0c ; 12
223 | ca: e8 2f mov r30, r24
224 | cc: f0 e0 ldi r31, 0x00 ; 0
225 | ce: e0 5a subi r30, 0xA0 ; 160
226 | d0: ff 4f sbci r31, 0xFF ; 255
227 | d2: 90 83 st Z, r25
228 | //Increment buffer position
229 | buffer_pos++;
230 | d4: 8f 5f subi r24, 0xFF ; 255
231 | d6: 80 93 70 00 sts 0x0070, r24
232 | if(buffer_pos > 64)
233 | da: 81 34 cpi r24, 0x41 ; 65
234 | dc: 10 f0 brcs .+4 ; 0xe2 <__stack+0x3>
235 | {
236 | buffer_pos = 0;
237 | de: 10 92 70 00 sts 0x0070, r1
238 | }
239 | }
240 | e2: ff 91 pop r31
241 | e4: ef 91 pop r30
242 | e6: 9f 91 pop r25
243 | e8: 8f 91 pop r24
244 | ea: 0f 90 pop r0
245 | ec: 0f be out 0x3f, r0 ; 63
246 | ee: 0f 90 pop r0
247 | f0: 1f 90 pop r1
248 | f2: 18 95 reti
249 |
250 | 000000f4 <_Z16serial_availablev>:
251 |
252 | unsigned char serial_available()
253 | {
254 | return buffer_pos;
255 | }
256 | f4: 80 91 70 00 lds r24, 0x0070
257 | f8: 08 95 ret
258 |
259 | 000000fa <_Z11serial_initj>:
260 |
261 | void serial_init(unsigned int baud)
262 | {
263 | //Set baud rate
264 | UBRRH = (unsigned char) (baud >> 8);
265 | fa: 92 b9 out 0x02, r25 ; 2
266 | UBRRL = (unsigned char) (baud);
267 | fc: 89 b9 out 0x09, r24 ; 9
268 |
269 | //Set frame format: 8 data, no parity, 2 stop bits
270 | UCSRC = (0<:
282 |
283 | //Buffered read pops the first byte off the buffer
284 | unsigned char serial_read()
285 | {
286 | if(buffer_pos == 0)
287 | 108: 90 91 70 00 lds r25, 0x0070
288 | 10c: 99 23 and r25, r25
289 | 10e: 11 f4 brne .+4 ; 0x114 <_Z11serial_readv+0xc>
290 | 110: 20 e0 ldi r18, 0x00 ; 0
291 | 112: 0e c0 rjmp .+28 ; 0x130 <_Z11serial_readv+0x28>
292 | {
293 | return 0;
294 | }
295 | char value = buffer[0];
296 | 114: 20 91 60 00 lds r18, 0x0060
297 | 118: e0 e6 ldi r30, 0x60 ; 96
298 | 11a: f0 e0 ldi r31, 0x00 ; 0
299 | for(char i = 1; i < 64; i++)
300 | {
301 | buffer[i-1] = buffer[i];
302 | 11c: 81 81 ldd r24, Z+1 ; 0x01
303 | 11e: 81 93 st Z+, r24
304 | if(buffer_pos == 0)
305 | {
306 | return 0;
307 | }
308 | char value = buffer[0];
309 | for(char i = 1; i < 64; i++)
310 | 120: 80 e0 ldi r24, 0x00 ; 0
311 | 122: ef 39 cpi r30, 0x9F ; 159
312 | 124: f8 07 cpc r31, r24
313 | 126: d1 f7 brne .-12 ; 0x11c <_Z11serial_readv+0x14>
314 | {
315 | buffer[i-1] = buffer[i];
316 | }
317 | buffer[63] = 0;
318 | 128: 10 82 st Z, r1
319 | buffer_pos--;
320 | 12a: 91 50 subi r25, 0x01 ; 1
321 | 12c: 90 93 70 00 sts 0x0070, r25
322 |
323 | return value;
324 | }
325 | 130: 82 2f mov r24, r18
326 | 132: 08 95 ret
327 |
328 | 00000134 <_Z12serial_flushv>:
329 |
330 | //Deletes all items in the buffer
331 | void serial_flush()
332 | {
333 | buffer_pos = 0;
334 | 134: 10 92 70 00 sts 0x0070, r1
335 | }
336 | 138: 08 95 ret
337 |
338 | 0000013a <_Z15serial_transmith>:
339 |
340 | void serial_transmit(unsigned char data)
341 | {
342 | //Wait for empty transmit buffer
343 | while(!(UCSRA & (1<
346 | {
347 | asm("nop");
348 | 13e: 00 00 nop
349 | }
350 |
351 | //Put data into buffer, send data
352 | UDR = data;
353 | 140: 8c b9 out 0x0c, r24 ; 12
354 | }
355 | 142: 08 95 ret
356 |
357 | 00000144 <_Z12serial_printPc>:
358 |
359 | void serial_print(char * text)
360 | 144: fc 01 movw r30, r24
361 | 146: 05 c0 rjmp .+10 ; 0x152 <_Z12serial_printPc+0xe>
362 | }
363 |
364 | void serial_transmit(unsigned char data)
365 | {
366 | //Wait for empty transmit buffer
367 | while(!(UCSRA & (1<
370 | {
371 | asm("nop");
372 | 14c: 00 00 nop
373 | }
374 |
375 | //Put data into buffer, send data
376 | UDR = data;
377 | 14e: 8c b9 out 0x0c, r24 ; 12
378 | 150: 31 96 adiw r30, 0x01 ; 1
379 | }
380 |
381 | void serial_print(char * text)
382 | {
383 | int pos = 0;
384 | while(text[pos] != '\0')
385 | 152: 80 81 ld r24, Z
386 | 154: 88 23 and r24, r24
387 | 156: c1 f7 brne .-16 ; 0x148 <_Z12serial_printPc+0x4>
388 | {
389 | serial_transmit(text[pos]);
390 | pos++;
391 | }
392 | }
393 | 158: 08 95 ret
394 |
395 | 0000015a <_Z25usi_i2c_master_initializev>:
396 | #define USISR_1_BIT 0b11111110
397 |
398 | void usi_i2c_master_initialize()
399 | {
400 | //Set up output pins
401 | PORT_USI |= (1 << PIN_USI_SDA) | (1 << PIN_USI_SCL);
402 | 15a: 88 b3 in r24, 0x18 ; 24
403 | 15c: 80 6a ori r24, 0xA0 ; 160
404 | 15e: 88 bb out 0x18, r24 ; 24
405 | DDR_USI &= ~((1 << PIN_USI_SDA) | (1 << PIN_USI_SCL));
406 | 160: 87 b3 in r24, 0x17 ; 23
407 | 162: 8f 75 andi r24, 0x5F ; 95
408 | 164: 87 bb out 0x17, r24 ; 23
409 |
410 | //Set up USI module
411 | USIDR = 0xFF;
412 | 166: 8f ef ldi r24, 0xFF ; 255
413 | 168: 8f b9 out 0x0f, r24 ; 15
414 | USICR = (1 << USIWM1) | (1 << USICS1) | (1 << USICLK);
415 | 16a: 8a e2 ldi r24, 0x2A ; 42
416 | 16c: 8d b9 out 0x0d, r24 ; 13
417 | USISR = (1 << USISIF) | (1 << USIOIF) | (1 << USIPF) | (1 << USIDC);
418 | 16e: 80 ef ldi r24, 0xF0 ; 240
419 | 170: 8e b9 out 0x0e, r24 ; 14
420 | }
421 | 172: 08 95 ret
422 |
423 | 00000174 <_Z23usi_i2c_master_transferc>:
424 |
425 | char usi_i2c_master_transfer(char data)
426 |
427 | {
428 | USIDR = data;
429 | 174: 8f b9 out 0x0f, r24 ; 15
430 |
431 | USISR = USISR_8_BIT; //Set USISR to transmit 8 bits
432 | 176: 80 ef ldi r24, 0xF0 ; 240
433 | 178: 8e b9 out 0x0e, r24 ; 14
434 | __asm__ volatile (
435 | "1: dec %0" "\n\t"
436 | "brne 1b"
437 | : "=r" (__count)
438 | : "0" (__count)
439 | );
440 | 17a: 35 e0 ldi r19, 0x05 ; 5
441 |
442 | {
443 |
444 | _delay_us(I2C_DELAY_2);
445 |
446 | USICR = temp; // Generate positve SCL edge.
447 | 17c: 9b e2 ldi r25, 0x2B ; 43
448 | 17e: 22 e0 ldi r18, 0x02 ; 2
449 | 180: 83 2f mov r24, r19
450 | 182: 8a 95 dec r24
451 | 184: f1 f7 brne .-4 ; 0x182 <_Z23usi_i2c_master_transferc+0xe>
452 | 186: 9d b9 out 0x0d, r25 ; 13
453 |
454 |
455 | while(!(PIN_USI & (1 << PIN_USI_SCL))) // Wait for SCL to go high.
456 | 188: b7 9b sbis 0x16, 7 ; 22
457 | 18a: fe cf rjmp .-4 ; 0x188 <_Z23usi_i2c_master_transferc+0x14>
458 | 18c: 82 2f mov r24, r18
459 | 18e: 8a 95 dec r24
460 | 190: f1 f7 brne .-4 ; 0x18e <_Z23usi_i2c_master_transferc+0x1a>
461 | }
462 |
463 |
464 | _delay_us(I2C_DELAY_4);
465 |
466 | USICR = temp; // Generate negative SCL edge.
467 | 192: 9d b9 out 0x0d, r25 ; 13
468 | (1<
476 | 198: 85 e0 ldi r24, 0x05 ; 5
477 | 19a: 8a 95 dec r24
478 | 19c: f1 f7 brne .-4 ; 0x19a <_Z23usi_i2c_master_transferc+0x26>
479 |
480 |
481 | _delay_us(I2C_DELAY_2);
482 |
483 |
484 | temp = USIDR; // Read out data.
485 | 19e: 8f b1 in r24, 0x0f ; 15
486 |
487 | USIDR = 0xFF; // Release SDA.
488 | 1a0: 9f ef ldi r25, 0xFF ; 255
489 | 1a2: 9f b9 out 0x0f, r25 ; 15
490 |
491 | DDR_USI |= (1 << PIN_USI_SDA); // Enable SDA as output.
492 | 1a4: bd 9a sbi 0x17, 5 ; 23
493 |
494 |
495 | return temp; // Return the data from the USIDR
496 |
497 | }
498 | 1a6: 08 95 ret
499 |
500 | 000001a8 <_Z23usi_i2c_master_transmitPci>:
501 |
502 | int usi_i2c_master_transmit(char* data, int len)
503 | 1a8: 0f 93 push r16
504 | 1aa: 1f 93 push r17
505 | 1ac: cf 93 push r28
506 | 1ae: df 93 push r29
507 | 1b0: 8c 01 movw r16, r24
508 | 1b2: eb 01 movw r28, r22
509 |
510 | {
511 |
512 | // Write a byte
513 |
514 | PORT_USI &= ~(1<
526 |
527 |
528 |
529 | // Clock and verify (N)ACK from slave
530 |
531 | DDR_USI &= ~(1<
538 | }
539 |
540 | int usi_i2c_master_transmit(char* data, int len)
541 | {
542 |
543 | do
544 | 1c8: 21 97 sbiw r28, 0x01 ; 1
545 | 1ca: a1 f7 brne .-24 ; 0x1b4 <_Z23usi_i2c_master_transmitPci+0xc>
546 | usi_i2c_master_transfer(USISR_1_BIT);
547 |
548 |
549 | }while(--len); // Until all data sent/received.
550 | return 0;
551 | }
552 | 1cc: 80 e0 ldi r24, 0x00 ; 0
553 | 1ce: 90 e0 ldi r25, 0x00 ; 0
554 | 1d0: df 91 pop r29
555 | 1d2: cf 91 pop r28
556 | 1d4: 1f 91 pop r17
557 | 1d6: 0f 91 pop r16
558 | 1d8: 08 95 ret
559 |
560 | 000001da <_Z22usi_i2c_master_receivePci>:
561 |
562 | int usi_i2c_master_receive(char* data, int len)
563 | 1da: ff 92 push r15
564 | 1dc: 0f 93 push r16
565 | 1de: 1f 93 push r17
566 | 1e0: cf 93 push r28
567 | 1e2: df 93 push r29
568 | 1e4: 8c 01 movw r16, r24
569 | 1e6: eb 01 movw r28, r22
570 |
571 | if(len == 1) // If transmission of last byte was performed.
572 |
573 | {
574 |
575 | USIDR = 0xFF; // Load NACK to confirm End Of Transmission.
576 | 1e8: ff 24 eor r15, r15
577 | 1ea: fa 94 dec r15
578 |
579 | {
580 |
581 | // Read a data byte
582 |
583 | DDR_USI &= ~(1<
590 | 1f2: f8 01 movw r30, r16
591 | 1f4: 81 93 st Z+, r24
592 | 1f6: 8f 01 movw r16, r30
593 |
594 |
595 | // Prepare to generate ACK (or NACK in case of End Of Transmission)
596 |
597 | if(len == 1) // If transmission of last byte was performed.
598 | 1f8: c1 30 cpi r28, 0x01 ; 1
599 | 1fa: d1 05 cpc r29, r1
600 | 1fc: 11 f4 brne .+4 ; 0x202 <_Z22usi_i2c_master_receivePci+0x28>
601 |
602 | {
603 |
604 | USIDR = 0xFF; // Load NACK to confirm End Of Transmission.
605 | 1fe: ff b8 out 0x0f, r15 ; 15
606 | 200: 01 c0 rjmp .+2 ; 0x204 <_Z22usi_i2c_master_receivePci+0x2a>
607 |
608 | else
609 |
610 | {
611 |
612 | USIDR = 0x00; // Load ACK. Set data register bit 7 (output for SDA) low.
613 | 202: 1f b8 out 0x0f, r1 ; 15
614 |
615 | }
616 |
617 | usi_i2c_master_transfer(USISR_1_BIT); // Generate ACK/NACK.
618 | 204: 8e ef ldi r24, 0xFE ; 254
619 | 206: b6 df rcall .-148 ; 0x174 <_Z23usi_i2c_master_transferc>
620 | }
621 |
622 | int usi_i2c_master_receive(char* data, int len)
623 | {
624 |
625 | do
626 | 208: 21 97 sbiw r28, 0x01 ; 1
627 | 20a: 81 f7 brne .-32 ; 0x1ec <_Z22usi_i2c_master_receivePci+0x12>
628 |
629 | usi_i2c_master_transfer(USISR_1_BIT); // Generate ACK/NACK.
630 |
631 | }while(--len);
632 | return 0;
633 | }
634 | 20c: 80 e0 ldi r24, 0x00 ; 0
635 | 20e: 90 e0 ldi r25, 0x00 ; 0
636 | 210: df 91 pop r29
637 | 212: cf 91 pop r28
638 | 214: 1f 91 pop r17
639 | 216: 0f 91 pop r16
640 | 218: ff 90 pop r15
641 | 21a: 08 95 ret
642 |
643 | 0000021c <_Z20usi_i2c_master_writecPci>:
644 |
645 | int usi_i2c_master_write(char addr, char* data, int len)
646 | {
647 | return 0;
648 | }
649 | 21c: 80 e0 ldi r24, 0x00 ; 0
650 | 21e: 90 e0 ldi r25, 0x00 ; 0
651 | 220: 08 95 ret
652 |
653 | 00000222 <_Z19usi_i2c_master_readcPci>:
654 |
655 | int usi_i2c_master_read(char addr, char* data, int len)
656 | {
657 | return 0;
658 | }
659 | 222: 80 e0 ldi r24, 0x00 ; 0
660 | 224: 90 e0 ldi r25, 0x00 ; 0
661 | 226: 08 95 ret
662 |
663 | 00000228 <_Z19usi_i2c_master_stopv>:
664 |
665 | void usi_i2c_master_stop()
666 |
667 | {
668 |
669 | PORT_USI &= ~(1 << PIN_USI_SDA); // Pull SDA low.
670 | 228: c5 98 cbi 0x18, 5 ; 24
671 |
672 | PORT_USI |= (1 << PIN_USI_SCL); // Release SCL.
673 | 22a: c7 9a sbi 0x18, 7 ; 24
674 |
675 |
676 | while(!(PIN_USI & (1 << PIN_USI_SCL))) // Wait for SCL to go high.
677 | 22c: b7 9b sbis 0x16, 7 ; 22
678 | 22e: fe cf rjmp .-4 ; 0x22c <_Z19usi_i2c_master_stopv+0x4>
679 | {
680 | }
681 |
682 |
683 | PORT_USI |= (1 << PIN_USI_SDA); // Release SDA.
684 | 230: c5 9a sbi 0x18, 5 ; 24
685 |
686 | }
687 | 232: 08 95 ret
688 |
689 | 00000234 <_Z20usi_i2c_master_startv>:
690 |
691 | void usi_i2c_master_start()
692 | {
693 | PORT_USI &= ~(1 << PIN_USI_SDA); // Pull SDA low
694 | 234: c5 98 cbi 0x18, 5 ; 24
695 | PORT_USI &= ~(1 << PIN_USI_SCL); // Pull SCL low
696 | 236: c7 98 cbi 0x18, 7 ; 24
697 | }
698 | 238: 08 95 ret
699 |
700 | 0000023a <_Z25USI_TWI_Master_Initialisev>:
701 | /*---------------------------------------------------------------
702 | USI TWI single master initialization function
703 | ---------------------------------------------------------------*/
704 | void USI_TWI_Master_Initialise( void )
705 | {
706 | PORT_USI |= (1<:
733 | Use this function to get hold of the error message from the last transmission
734 | ---------------------------------------------------------------*/
735 | unsigned char USI_TWI_Get_State_Info( void )
736 | {
737 | return ( USI_TWI_state.errorState ); // Return error state.
738 | }
739 | 250: 80 91 71 00 lds r24, 0x0071
740 | 254: 08 95 ret
741 |
742 | 00000256 <_Z23USI_TWI_Master_Transferh>:
743 | Data to be sent has to be placed into the USIDR prior to calling
744 | this function. Data read, will be return'ed from the function.
745 | ---------------------------------------------------------------*/
746 | unsigned char USI_TWI_Master_Transfer( unsigned char temp )
747 | {
748 | USISR = temp; // Set USISR according to temp.
749 | 256: 8e b9 out 0x0e, r24 ; 14
750 | 258: 21 e0 ldi r18, 0x01 ; 1
751 | (1<
761 | 262: 9d b9 out 0x0d, r25 ; 13
762 | while( !(PIN_USI & (1<
765 | 268: 82 2f mov r24, r18
766 | 26a: 8a 95 dec r24
767 | 26c: f1 f7 brne .-4 ; 0x26a <_Z23USI_TWI_Master_Transferh+0x14>
768 | _delay_us(T4_TWI);
769 | USICR = temp; // Generate negative SCL edge.
770 | 26e: 9d b9 out 0x0d, r25 ; 13
771 | // Prepare clocking.
772 | temp = (0<
779 | 274: 81 e0 ldi r24, 0x01 ; 1
780 | 276: 8a 95 dec r24
781 | 278: f1 f7 brne .-4 ; 0x276 <_Z23USI_TWI_Master_Transferh+0x20>
782 | _delay_us(T4_TWI);
783 | USICR = temp; // Generate negative SCL edge.
784 | }while( !(USISR & (1<:
800 | Function for generating a TWI Start Condition.
801 | ---------------------------------------------------------------*/
802 | unsigned char USI_TWI_Master_Start( void )
803 | {
804 | /* Release SCL to ensure that (repeated) Start can be performed */
805 | PORT_USI |= (1<
810 | 28a: 81 e0 ldi r24, 0x01 ; 1
811 | 28c: 98 2f mov r25, r24
812 | 28e: 9a 95 dec r25
813 | 290: f1 f7 brne .-4 ; 0x28e <_Z20USI_TWI_Master_Startv+0xa>
814 | _delay_us(T2_TWI);
815 |
816 | /* Generate Start Condition */
817 | PORT_USI &= ~(1<
821 | _delay_us(T4_TWI);
822 | PORT_USI &= ~(1<
831 | 2a0: 81 e0 ldi r24, 0x01 ; 1
832 | 2a2: 08 95 ret
833 | {
834 | USI_TWI_state.errorState = USI_TWI_MISSING_START_CON;
835 | 2a4: 83 e0 ldi r24, 0x03 ; 3
836 | 2a6: 80 93 71 00 sts 0x0071, r24
837 | 2aa: 80 e0 ldi r24, 0x00 ; 0
838 | return (FALSE);
839 | }
840 | #endif
841 | return (TRUE);
842 | }
843 | 2ac: 08 95 ret
844 |
845 | 000002ae <_Z19USI_TWI_Master_Stopv>:
846 | Function for generating a TWI Stop Condition. Used to release
847 | the TWI bus.
848 | ---------------------------------------------------------------*/
849 | unsigned char USI_TWI_Master_Stop( void )
850 | {
851 | PORT_USI &= ~(1<
858 | 2b6: 81 e0 ldi r24, 0x01 ; 1
859 | 2b8: 98 2f mov r25, r24
860 | 2ba: 9a 95 dec r25
861 | 2bc: f1 f7 brne .-4 ; 0x2ba <_Z19USI_TWI_Master_Stopv+0xc>
862 | _delay_us(T4_TWI);
863 | PORT_USI |= (1<
867 | _delay_us(T2_TWI);
868 |
869 | #ifdef SIGNAL_VERIFY
870 | if( !(USISR & (1<
873 | 2c8: 81 e0 ldi r24, 0x01 ; 1
874 | 2ca: 08 95 ret
875 | {
876 | USI_TWI_state.errorState = USI_TWI_MISSING_STOP_CON;
877 | 2cc: 84 e0 ldi r24, 0x04 ; 4
878 | 2ce: 80 93 71 00 sts 0x0071, r24
879 | 2d2: 80 e0 ldi r24, 0x00 ; 0
880 | return (FALSE);
881 | }
882 | #endif
883 |
884 | return (TRUE);
885 | }
886 | 2d4: 08 95 ret
887 |
888 | 000002d6 <_Z35USI_TWI_Start_Transceiver_With_DataPhh>:
889 | the slave address again and reading the data.
890 |
891 | Success or error code is returned. Error codes are defined in
892 | USI_TWI_Master.h
893 | ---------------------------------------------------------------*/
894 | unsigned char USI_TWI_Start_Transceiver_With_Data( unsigned char *msg, unsigned char msgSize)
895 | 2d6: cf 92 push r12
896 | 2d8: df 92 push r13
897 | 2da: ef 92 push r14
898 | 2dc: ff 92 push r15
899 | 2de: 0f 93 push r16
900 | 2e0: 1f 93 push r17
901 | 2e2: cf 93 push r28
902 | 2e4: df 93 push r29
903 | 2e6: 8c 01 movw r16, r24
904 | 2e8: e6 2e mov r14, r22
905 | unsigned char savedMsgSize;
906 |
907 | //This clear must be done before calling this function so that memReadMode can be specified.
908 | // USI_TWI_state.errorState = 0; // Clears all mode bits also
909 |
910 | USI_TWI_state.addressMode = TRUE; // Always true for first byte
911 | 2ea: 90 91 71 00 lds r25, 0x0071
912 | 2ee: 89 2f mov r24, r25
913 | 2f0: 81 60 ori r24, 0x01 ; 1
914 | 2f2: 80 93 71 00 sts 0x0071, r24
915 | USI_TWI_state.errorState = USI_TWI_UE_DATA_COL;
916 | return (FALSE);
917 | }
918 | #endif
919 |
920 | if ( !(*msg & (1<
925 | {
926 | USI_TWI_state.masterWriteDataMode = TRUE;
927 | 2fe: 93 60 ori r25, 0x03 ; 3
928 | 300: 90 93 71 00 sts 0x0071, r25
929 | // {
930 | savedMsg = msg;
931 | savedMsgSize = msgSize;
932 | // }
933 |
934 | if ( !USI_TWI_Master_Start( ))
935 | 304: bf df rcall .-130 ; 0x284 <_Z20USI_TWI_Master_Startv>
936 | 306: 88 23 and r24, r24
937 | 308: 09 f4 brne .+2 ; 0x30c <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x36>
938 | 30a: 4d c0 rjmp .+154 ; 0x3a6 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xd0>
939 | 30c: fe 2c mov r15, r14
940 | 30e: e8 01 movw r28, r16
941 | if ((!USI_TWI_state.addressMode) && USI_TWI_state.memReadMode)// means memory start address has been written
942 | {
943 | msg = savedMsg; // start at slave address again
944 | *(msg) |= (TRUE<
966 | 320: 81 ff sbrs r24, 1
967 | 322: 2e c0 rjmp .+92 ; 0x380 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xaa>
968 | {
969 | /* Write a byte */
970 | PORT_USI &= ~(1<
978 |
979 | /* Clock and verify (N)ACK from slave */
980 | DDR_USI &= ~(1<
985 | 334: 90 91 71 00 lds r25, 0x0071
986 | 338: 80 ff sbrs r24, 0
987 | 33a: 09 c0 rjmp .+18 ; 0x34e <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x78>
988 | {
989 | if ( USI_TWI_state.addressMode )
990 | 33c: 90 ff sbrs r25, 0
991 | 33e: 02 c0 rjmp .+4 ; 0x344 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x6e>
992 | USI_TWI_state.errorState = USI_TWI_NO_ACK_ON_ADDRESS;
993 | 340: 81 e0 ldi r24, 0x01 ; 1
994 | 342: 01 c0 rjmp .+2 ; 0x346 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x70>
995 | else
996 | USI_TWI_state.errorState = USI_TWI_NO_ACK_ON_DATA;
997 | 344: 82 e0 ldi r24, 0x02 ; 2
998 | 346: 80 93 71 00 sts 0x0071, r24
999 | 34a: 80 e0 ldi r24, 0x00 ; 0
1000 | 34c: 2c c0 rjmp .+88 ; 0x3a6 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xd0>
1001 | return (FALSE);
1002 | }
1003 |
1004 | if ((!USI_TWI_state.addressMode) && USI_TWI_state.memReadMode)// means memory start address has been written
1005 | 34e: 90 fd sbrc r25, 0
1006 | 350: 10 c0 rjmp .+32 ; 0x372 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x9c>
1007 | 352: 92 ff sbrs r25, 2
1008 | 354: 0e c0 rjmp .+28 ; 0x372 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x9c>
1009 | {
1010 | msg = savedMsg; // start at slave address again
1011 | *(msg) |= (TRUE<
1023 | 364: 88 23 and r24, r24
1024 | 366: 19 f0 breq .+6 ; 0x36e <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x98>
1025 | 368: fe 2c mov r15, r14
1026 | 36a: e8 01 movw r28, r16
1027 | 36c: 16 c0 rjmp .+44 ; 0x39a <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xc4>
1028 | {
1029 | USI_TWI_state.errorState = USI_TWI_BAD_MEM_READ;
1030 | 36e: 8a e0 ldi r24, 0x0A ; 10
1031 | 370: ea cf rjmp .-44 ; 0x346 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x70>
1032 | /* If masterWrite cycle (or inital address tranmission)*/
1033 | if (USI_TWI_state.addressMode || USI_TWI_state.masterWriteDataMode)
1034 | {
1035 | /* Write a byte */
1036 | PORT_USI &= ~(1<
1049 | }
1050 | /* Else masterRead cycle*/
1051 | else
1052 | {
1053 | /* Read a data byte */
1054 | DDR_USI &= ~(1<
1059 | 386: 88 83 st Y, r24
1060 |
1061 | /* Prepare to generate ACK (or NACK in case of End Of Transmission) */
1062 | if( msgSize == 1) // If transmission of last byte was performed.
1063 | 388: f1 e0 ldi r31, 0x01 ; 1
1064 | 38a: ff 16 cp r15, r31
1065 | 38c: 11 f4 brne .+4 ; 0x392 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xbc>
1066 | {
1067 | USIDR = 0xFF; // Load NACK to confirm End Of Transmission.
1068 | 38e: df b8 out 0x0f, r13 ; 15
1069 | 390: 01 c0 rjmp .+2 ; 0x394 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xbe>
1070 | }
1071 | else
1072 | {
1073 | USIDR = 0x00; // Load ACK. Set data register bit 7 (output for SDA) low.
1074 | 392: 1f b8 out 0x0f, r1 ; 15
1075 | /* Else masterRead cycle*/
1076 | else
1077 | {
1078 | /* Read a data byte */
1079 | DDR_USI &= ~(1<
1090 | {
1091 | return (FALSE); // Send a START condition on the TWI bus.
1092 | }
1093 |
1094 | /*Write address and Read/Write data */
1095 | do
1096 | 39a: fa 94 dec r15
1097 | 39c: 09 f0 breq .+2 ; 0x3a0 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0xca>
1098 | 39e: bc cf rjmp .-136 ; 0x318 <_Z35USI_TWI_Start_Transceiver_With_DataPhh+0x42>
1099 | }
1100 | USI_TWI_Master_Transfer( tempUSISR_1bit ); // Generate ACK/NACK.
1101 | }
1102 | }while( --msgSize) ; // Until all data sent/received.
1103 |
1104 | if (!USI_TWI_Master_Stop())
1105 | 3a0: 86 df rcall .-244 ; 0x2ae <_Z19USI_TWI_Master_Stopv>
1106 | 3a2: 81 11 cpse r24, r1
1107 | 3a4: 81 e0 ldi r24, 0x01 ; 1
1108 | return (FALSE); // Send a STOP condition on the TWI bus.
1109 | }
1110 |
1111 | /* Transmission successfully completed*/
1112 | return (TRUE);
1113 | }
1114 | 3a6: df 91 pop r29
1115 | 3a8: cf 91 pop r28
1116 | 3aa: 1f 91 pop r17
1117 | 3ac: 0f 91 pop r16
1118 | 3ae: ff 90 pop r15
1119 | 3b0: ef 90 pop r14
1120 | 3b2: df 90 pop r13
1121 | 3b4: cf 90 pop r12
1122 | 3b6: 08 95 ret
1123 |
1124 | 000003b8 <_Z24USI_TWI_Start_Read_WritePhh>:
1125 | USI_TWI_Master.h
1126 | ---------------------------------------------------------------*/
1127 | unsigned char USI_TWI_Start_Read_Write( unsigned char *msg, unsigned char msgSize)
1128 | {
1129 |
1130 | USI_TWI_state.errorState = 0; // Clears all mode bits also
1131 | 3b8: 10 92 71 00 sts 0x0071, r1
1132 |
1133 | return (USI_TWI_Start_Transceiver_With_Data( msg, msgSize));
1134 | 3bc: 8c df rcall .-232 ; 0x2d6 <_Z35USI_TWI_Start_Transceiver_With_DataPhh>
1135 |
1136 | }
1137 | 3be: 08 95 ret
1138 |
1139 | 000003c0 <_Z25USI_TWI_Start_Random_ReadPhh>:
1140 | The msgSize is passed to USI_TWI_Start_Transceiver_With_Data.
1141 |
1142 | Success or error code is returned. Error codes are defined in
1143 | USI_TWI_Master.h
1144 | ---------------------------------------------------------------*/
1145 | unsigned char USI_TWI_Start_Random_Read( unsigned char *msg, unsigned char msgSize)
1146 | 3c0: fc 01 movw r30, r24
1147 | {
1148 | *(msg) &= ~(TRUE<
1160 | }
1161 | 3d2: 08 95 ret
1162 |
1163 | 000003d4 <_exit>:
1164 | 3d4: f8 94 cli
1165 |
1166 | 000003d6 <__stop_program>:
1167 | 3d6: ff cf rjmp .-2 ; 0x3d6 <__stop_program>
1168 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.map:
--------------------------------------------------------------------------------
1 | Archive member included because of file (symbol)
2 |
3 | c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
4 | c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o (exit)
5 | c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_clear_bss.o)
6 | serial.o (__do_clear_bss)
7 |
8 | Memory Configuration
9 |
10 | Name Origin Length Attributes
11 | text 0x00000000 0x00002000 xr
12 | data 0x00800060 0x0000ffa0 rw !x
13 | eeprom 0x00810000 0x00010000 rw !x
14 | fuse 0x00820000 0x00000400 rw !x
15 | lock 0x00830000 0x00000400 rw !x
16 | signature 0x00840000 0x00000400 rw !x
17 | *default* 0x00000000 0xffffffff
18 |
19 | Linker script and memory map
20 |
21 | LOAD c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
22 | LOAD L297-L298-Stepper-Driver.o
23 | LOAD serial.o
24 | LOAD usi_i2c_master.o
25 | LOAD USI_TWI_Master.o
26 | LOAD c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a
27 | LOAD c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25\libm.a
28 | LOAD c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a
29 | LOAD c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25\libc.a
30 | LOAD c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a
31 |
32 | .hash
33 | *(.hash)
34 |
35 | .dynsym
36 | *(.dynsym)
37 |
38 | .dynstr
39 | *(.dynstr)
40 |
41 | .gnu.version
42 | *(.gnu.version)
43 |
44 | .gnu.version_d
45 | *(.gnu.version_d)
46 |
47 | .gnu.version_r
48 | *(.gnu.version_r)
49 |
50 | .rel.init
51 | *(.rel.init)
52 |
53 | .rela.init
54 | *(.rela.init)
55 |
56 | .rel.text
57 | *(.rel.text)
58 | *(.rel.text.*)
59 | *(.rel.gnu.linkonce.t*)
60 |
61 | .rela.text
62 | *(.rela.text)
63 | *(.rela.text.*)
64 | *(.rela.gnu.linkonce.t*)
65 |
66 | .rel.fini
67 | *(.rel.fini)
68 |
69 | .rela.fini
70 | *(.rela.fini)
71 |
72 | .rel.rodata
73 | *(.rel.rodata)
74 | *(.rel.rodata.*)
75 | *(.rel.gnu.linkonce.r*)
76 |
77 | .rela.rodata
78 | *(.rela.rodata)
79 | *(.rela.rodata.*)
80 | *(.rela.gnu.linkonce.r*)
81 |
82 | .rel.data
83 | *(.rel.data)
84 | *(.rel.data.*)
85 | *(.rel.gnu.linkonce.d*)
86 |
87 | .rela.data
88 | *(.rela.data)
89 | *(.rela.data.*)
90 | *(.rela.gnu.linkonce.d*)
91 |
92 | .rel.ctors
93 | *(.rel.ctors)
94 |
95 | .rela.ctors
96 | *(.rela.ctors)
97 |
98 | .rel.dtors
99 | *(.rel.dtors)
100 |
101 | .rela.dtors
102 | *(.rela.dtors)
103 |
104 | .rel.got
105 | *(.rel.got)
106 |
107 | .rela.got
108 | *(.rela.got)
109 |
110 | .rel.bss
111 | *(.rel.bss)
112 |
113 | .rela.bss
114 | *(.rela.bss)
115 |
116 | .rel.plt
117 | *(.rel.plt)
118 |
119 | .rela.plt
120 | *(.rela.plt)
121 |
122 | .text 0x00000000 0x3d8
123 | *(.vectors)
124 | .vectors 0x00000000 0x26 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
125 | 0x00000000 __vectors
126 | 0x00000000 __vector_default
127 | *(.vectors)
128 | *(.progmem.gcc*)
129 | *(.progmem*)
130 | 0x00000026 . = ALIGN (0x2)
131 | 0x00000026 __trampolines_start = .
132 | *(.trampolines)
133 | .trampolines 0x00000026 0x0 linker stubs
134 | *(.trampolines*)
135 | 0x00000026 __trampolines_end = .
136 | *(.jumptables)
137 | *(.jumptables*)
138 | *(.lowtext)
139 | *(.lowtext*)
140 | 0x00000026 __ctors_start = .
141 | *(.ctors)
142 | 0x00000026 __ctors_end = .
143 | 0x00000026 __dtors_start = .
144 | *(.dtors)
145 | 0x00000026 __dtors_end = .
146 | SORT(*)(.ctors)
147 | SORT(*)(.dtors)
148 | *(.init0)
149 | .init0 0x00000026 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
150 | 0x00000026 __init
151 | *(.init0)
152 | *(.init1)
153 | *(.init1)
154 | *(.init2)
155 | .init2 0x00000026 0x8 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
156 | *(.init2)
157 | *(.init3)
158 | *(.init3)
159 | *(.init4)
160 | .init4 0x0000002e 0x10 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_clear_bss.o)
161 | 0x0000002e __do_clear_bss
162 | *(.init4)
163 | *(.init5)
164 | *(.init5)
165 | *(.init6)
166 | *(.init6)
167 | *(.init7)
168 | *(.init7)
169 | *(.init8)
170 | *(.init8)
171 | *(.init9)
172 | .init9 0x0000003e 0x4 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
173 | *(.init9)
174 | *(.text)
175 | .text 0x00000042 0x2 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
176 | 0x00000042 __vector_1
177 | 0x00000042 __vector_12
178 | 0x00000042 __bad_interrupt
179 | 0x00000042 __vector_6
180 | 0x00000042 __vector_3
181 | 0x00000042 __vector_11
182 | 0x00000042 __vector_13
183 | 0x00000042 __vector_17
184 | 0x00000042 __vector_5
185 | 0x00000042 __vector_4
186 | 0x00000042 __vector_9
187 | 0x00000042 __vector_2
188 | 0x00000042 __vector_15
189 | 0x00000042 __vector_8
190 | 0x00000042 __vector_14
191 | 0x00000042 __vector_10
192 | 0x00000042 __vector_16
193 | 0x00000042 __vector_18
194 | .text 0x00000044 0x6e L297-L298-Stepper-Driver.o
195 | 0x00000044 setup_l297_clock()
196 | 0x00000064 main
197 | .text 0x000000b2 0xa8 serial.o
198 | 0x000000f4 serial_available()
199 | 0x00000108 serial_read()
200 | 0x000000fa serial_init(unsigned int)
201 | 0x000000b2 __vector_7
202 | 0x00000144 serial_print(char*)
203 | 0x0000013a serial_transmit(unsigned char)
204 | 0x00000134 serial_flush()
205 | .text 0x0000015a 0xe0 usi_i2c_master.o
206 | 0x0000015a usi_i2c_master_initialize()
207 | 0x000001da usi_i2c_master_receive(char*, int)
208 | 0x00000174 usi_i2c_master_transfer(char)
209 | 0x00000234 usi_i2c_master_start()
210 | 0x0000021c usi_i2c_master_write(char, char*, int)
211 | 0x000001a8 usi_i2c_master_transmit(char*, int)
212 | 0x00000228 usi_i2c_master_stop()
213 | 0x00000222 usi_i2c_master_read(char, char*, int)
214 | .text 0x0000023a 0x19a USI_TWI_Master.o
215 | 0x00000284 USI_TWI_Master_Start()
216 | 0x0000023a USI_TWI_Master_Initialise()
217 | 0x00000250 USI_TWI_Get_State_Info()
218 | 0x000002ae USI_TWI_Master_Stop()
219 | 0x00000256 USI_TWI_Master_Transfer(unsigned char)
220 | 0x000002d6 USI_TWI_Start_Transceiver_With_Data(unsigned char*, unsigned char)
221 | 0x000003c0 USI_TWI_Start_Random_Read(unsigned char*, unsigned char)
222 | 0x000003b8 USI_TWI_Start_Read_Write(unsigned char*, unsigned char)
223 | .text 0x000003d4 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
224 | .text 0x000003d4 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_clear_bss.o)
225 | 0x000003d4 . = ALIGN (0x2)
226 | *(.text.*)
227 | .text.libgcc 0x000003d4 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
228 | .text.libgcc 0x000003d4 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_clear_bss.o)
229 | 0x000003d4 . = ALIGN (0x2)
230 | *(.fini9)
231 | .fini9 0x000003d4 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
232 | 0x000003d4 exit
233 | 0x000003d4 _exit
234 | *(.fini9)
235 | *(.fini8)
236 | *(.fini8)
237 | *(.fini7)
238 | *(.fini7)
239 | *(.fini6)
240 | *(.fini6)
241 | *(.fini5)
242 | *(.fini5)
243 | *(.fini4)
244 | *(.fini4)
245 | *(.fini3)
246 | *(.fini3)
247 | *(.fini2)
248 | *(.fini2)
249 | *(.fini1)
250 | *(.fini1)
251 | *(.fini0)
252 | .fini0 0x000003d4 0x4 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
253 | *(.fini0)
254 | 0x000003d8 _etext = .
255 |
256 | .data 0x00800060 0x0 load address 0x000003d8
257 | 0x00800060 PROVIDE (__data_start, .)
258 | *(.data)
259 | .data 0x00800060 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
260 | .data 0x00800060 0x0 L297-L298-Stepper-Driver.o
261 | .data 0x00800060 0x0 serial.o
262 | .data 0x00800060 0x0 usi_i2c_master.o
263 | .data 0x00800060 0x0 USI_TWI_Master.o
264 | .data 0x00800060 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
265 | .data 0x00800060 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_clear_bss.o)
266 | *(.data*)
267 | *(.rodata)
268 | *(.rodata*)
269 | *(.gnu.linkonce.d*)
270 | 0x00800060 . = ALIGN (0x2)
271 | 0x00800060 _edata = .
272 | 0x00800060 PROVIDE (__data_end, .)
273 |
274 | .bss 0x00800060 0x12
275 | 0x00800060 PROVIDE (__bss_start, .)
276 | *(.bss)
277 | .bss 0x00800060 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn2313.o
278 | .bss 0x00800060 0x0 L297-L298-Stepper-Driver.o
279 | .bss 0x00800060 0x11 serial.o
280 | 0x00800070 buffer_pos
281 | 0x00800060 buffer
282 | .bss 0x00800071 0x0 usi_i2c_master.o
283 | .bss 0x00800071 0x1 USI_TWI_Master.o
284 | 0x00800071 USI_TWI_state
285 | .bss 0x00800072 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
286 | .bss 0x00800072 0x0 c:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_clear_bss.o)
287 | *(.bss*)
288 | *(COMMON)
289 | 0x00800072 PROVIDE (__bss_end, .)
290 | 0x000003d8 __data_load_start = LOADADDR (.data)
291 | 0x000003d8 __data_load_end = (__data_load_start + SIZEOF (.data))
292 |
293 | .noinit 0x00800072 0x0
294 | 0x00800072 PROVIDE (__noinit_start, .)
295 | *(.noinit*)
296 | 0x00800072 PROVIDE (__noinit_end, .)
297 | 0x00800072 _end = .
298 | 0x00800072 PROVIDE (__heap_start, .)
299 |
300 | .eeprom 0x00810000 0x0
301 | *(.eeprom*)
302 | 0x00810000 __eeprom_end = .
303 |
304 | .fuse
305 | *(.fuse)
306 | *(.lfuse)
307 | *(.hfuse)
308 | *(.efuse)
309 |
310 | .lock
311 | *(.lock*)
312 |
313 | .signature
314 | *(.signature*)
315 |
316 | .stab
317 | *(.stab)
318 |
319 | .stabstr
320 | *(.stabstr)
321 |
322 | .stab.excl
323 | *(.stab.excl)
324 |
325 | .stab.exclstr
326 | *(.stab.exclstr)
327 |
328 | .stab.index
329 | *(.stab.index)
330 |
331 | .stab.indexstr
332 | *(.stab.indexstr)
333 |
334 | .comment
335 | *(.comment)
336 |
337 | .debug
338 | *(.debug)
339 |
340 | .line
341 | *(.line)
342 |
343 | .debug_srcinfo
344 | *(.debug_srcinfo)
345 |
346 | .debug_sfnames
347 | *(.debug_sfnames)
348 |
349 | .debug_aranges 0x00000000 0x80
350 | *(.debug_aranges)
351 | .debug_aranges
352 | 0x00000000 0x20 L297-L298-Stepper-Driver.o
353 | .debug_aranges
354 | 0x00000020 0x20 serial.o
355 | .debug_aranges
356 | 0x00000040 0x20 usi_i2c_master.o
357 | .debug_aranges
358 | 0x00000060 0x20 USI_TWI_Master.o
359 |
360 | .debug_pubnames
361 | 0x00000000 0x2c8
362 | *(.debug_pubnames)
363 | .debug_pubnames
364 | 0x00000000 0x30 L297-L298-Stepper-Driver.o
365 | .debug_pubnames
366 | 0x00000030 0xa6 serial.o
367 | .debug_pubnames
368 | 0x000000d6 0xe5 usi_i2c_master.o
369 | .debug_pubnames
370 | 0x000001bb 0x10d USI_TWI_Master.o
371 |
372 | .debug_info 0x00000000 0xaaf
373 | *(.debug_info)
374 | .debug_info 0x00000000 0x134 L297-L298-Stepper-Driver.o
375 | .debug_info 0x00000134 0x1d4 serial.o
376 | .debug_info 0x00000308 0x346 usi_i2c_master.o
377 | .debug_info 0x0000064e 0x461 USI_TWI_Master.o
378 | *(.gnu.linkonce.wi.*)
379 |
380 | .debug_abbrev 0x00000000 0x526
381 | *(.debug_abbrev)
382 | .debug_abbrev 0x00000000 0xd4 L297-L298-Stepper-Driver.o
383 | .debug_abbrev 0x000000d4 0x152 serial.o
384 | .debug_abbrev 0x00000226 0x132 usi_i2c_master.o
385 | .debug_abbrev 0x00000358 0x1ce USI_TWI_Master.o
386 |
387 | .debug_line 0x00000000 0x9f3
388 | *(.debug_line)
389 | .debug_line 0x00000000 0x1bd L297-L298-Stepper-Driver.o
390 | .debug_line 0x000001bd 0x178 serial.o
391 | .debug_line 0x00000335 0x2bf usi_i2c_master.o
392 | .debug_line 0x000005f4 0x3ff USI_TWI_Master.o
393 |
394 | .debug_frame 0x00000000 0x1d0
395 | *(.debug_frame)
396 | .debug_frame 0x00000000 0x30 L297-L298-Stepper-Driver.o
397 | .debug_frame 0x00000030 0x80 serial.o
398 | .debug_frame 0x000000b0 0x90 usi_i2c_master.o
399 | .debug_frame 0x00000140 0x90 USI_TWI_Master.o
400 |
401 | .debug_str 0x00000000 0x659
402 | *(.debug_str)
403 | .debug_str 0x00000000 0x11f L297-L298-Stepper-Driver.o
404 | 0x153 (size before relaxing)
405 | .debug_str 0x0000011f 0xee serial.o
406 | 0x1cf (size before relaxing)
407 | .debug_str 0x0000020d 0x1db usi_i2c_master.o
408 | 0x304 (size before relaxing)
409 | .debug_str 0x000003e8 0x271 USI_TWI_Master.o
410 | 0x3ba (size before relaxing)
411 |
412 | .debug_loc 0x00000000 0x35e
413 | *(.debug_loc)
414 | .debug_loc 0x00000000 0x40 L297-L298-Stepper-Driver.o
415 | .debug_loc 0x00000040 0x4e serial.o
416 | .debug_loc 0x0000008e 0x130 usi_i2c_master.o
417 | .debug_loc 0x000001be 0x1a0 USI_TWI_Master.o
418 |
419 | .debug_macinfo
420 | *(.debug_macinfo)
421 | OUTPUT(L297-L298-Stepper-Driver.elf elf32-avr)
422 | LOAD linker stubs
423 |
424 | .debug_ranges 0x00000000 0x90
425 | .debug_ranges 0x00000000 0x60 usi_i2c_master.o
426 | .debug_ranges 0x00000060 0x30 USI_TWI_Master.o
427 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/L297-L298-Stepper-Driver.o
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/Makefile:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Makefile for the project L297-L298-Stepper-Driver
3 | ###############################################################################
4 |
5 | ## General Flags
6 | PROJECT = L297-L298-Stepper-Driver
7 | MCU = attiny2313
8 | TARGET = L297-L298-Stepper-Driver.elf
9 | CC = avr-gcc
10 |
11 | CPP = avr-g++
12 |
13 | ## Options common to compile, link and assembly rules
14 | COMMON = -mmcu=$(MCU)
15 |
16 | ## Compile options common for all C compilation units.
17 | CFLAGS = $(COMMON)
18 | CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
19 | CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
20 |
21 | ## Assembly specific flags
22 | ASMFLAGS = $(COMMON)
23 | ASMFLAGS += $(CFLAGS)
24 | ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
25 |
26 | ## Linker flags
27 | LDFLAGS = $(COMMON)
28 | LDFLAGS += -Wl,-Map=L297-L298-Stepper-Driver.map
29 |
30 |
31 | ## Intel Hex file production flags
32 | HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
33 |
34 | HEX_EEPROM_FLAGS = -j .eeprom
35 | HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
36 | HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
37 |
38 |
39 | ## Objects that must be built in order to link
40 | OBJECTS = L297-L298-Stepper-Driver.o serial.o usi_i2c_master.o USI_TWI_Master.o
41 |
42 | ## Objects explicitly added by the user
43 | LINKONLYOBJECTS =
44 |
45 | ## Build
46 | all: $(TARGET) L297-L298-Stepper-Driver.hex L297-L298-Stepper-Driver.eep L297-L298-Stepper-Driver.lss size
47 |
48 | ## Compile
49 | L297-L298-Stepper-Driver.o: ../L297-L298-Stepper-Driver.c
50 | $(CPP) $(INCLUDES) $(CFLAGS) -c $<
51 |
52 | serial.o: ../serial.c
53 | $(CPP) $(INCLUDES) $(CFLAGS) -c $<
54 |
55 | usi_i2c_master.o: ../usi_i2c_master.c
56 | $(CPP) $(INCLUDES) $(CFLAGS) -c $<
57 |
58 | USI_TWI_Master.o: ../USI_TWI_Master.cpp
59 | $(CPP) $(INCLUDES) $(CFLAGS) -c $<
60 |
61 | ##Link
62 | $(TARGET): $(OBJECTS)
63 | $(CPP) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
64 |
65 | %.hex: $(TARGET)
66 | avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
67 |
68 | %.eep: $(TARGET)
69 | -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
70 |
71 | %.lss: $(TARGET)
72 | avr-objdump -h -S $< > $@
73 |
74 | size: ${TARGET}
75 | @echo
76 | @avr-size -C --mcu=${MCU} ${TARGET}
77 |
78 | ## Clean target
79 | .PHONY: clean
80 | clean:
81 | -rm -rf $(OBJECTS) L297-L298-Stepper-Driver.elf dep/* L297-L298-Stepper-Driver.hex L297-L298-Stepper-Driver.eep L297-L298-Stepper-Driver.lss L297-L298-Stepper-Driver.map
82 |
83 |
84 | ## Other dependencies
85 | -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
86 |
87 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/USI_TWI_Master.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/USI_TWI_Master.o
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/dep/L297-L298-Stepper-Driver.o.d:
--------------------------------------------------------------------------------
1 | L297-L298-Stepper-Driver.o: ../L297-L298-Stepper-Driver.c \
2 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/interrupt.h \
13 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h \
14 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay_basic.h \
15 | ../serial.h ../usi_i2c_master.h
16 |
17 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h:
18 |
19 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h:
20 |
21 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h:
22 |
23 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h:
24 |
25 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h:
26 |
27 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h:
28 |
29 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h:
30 |
31 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h:
32 |
33 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h:
34 |
35 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h:
36 |
37 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/interrupt.h:
38 |
39 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:
40 |
41 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay_basic.h:
42 |
43 | ../serial.h:
44 |
45 | ../usi_i2c_master.h:
46 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/dep/USI_TWI_Master.o.d:
--------------------------------------------------------------------------------
1 | USI_TWI_Master.o: ../USI_TWI_Master.cpp \
2 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/interrupt.h \
3 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h \
4 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h \
5 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h \
6 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h \
7 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h \
8 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h \
9 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h \
10 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h \
11 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h \
12 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h \
13 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h \
14 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay_basic.h \
15 | ../USI_TWI_Master.h
16 |
17 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/interrupt.h:
18 |
19 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h:
20 |
21 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h:
22 |
23 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h:
24 |
25 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h:
26 |
27 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h:
28 |
29 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h:
30 |
31 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h:
32 |
33 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h:
34 |
35 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h:
36 |
37 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h:
38 |
39 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:
40 |
41 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay_basic.h:
42 |
43 | ../USI_TWI_Master.h:
44 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/dep/serial.o.d:
--------------------------------------------------------------------------------
1 | serial.o: ../serial.c ../serial.h \
2 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/interrupt.h
13 |
14 | ../serial.h:
15 |
16 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h:
17 |
18 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h:
19 |
20 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h:
21 |
22 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h:
23 |
24 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h:
25 |
26 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h:
27 |
28 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h:
29 |
30 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h:
31 |
32 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h:
33 |
34 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h:
35 |
36 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/interrupt.h:
37 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/dep/usi_i2c_master.o.d:
--------------------------------------------------------------------------------
1 | usi_i2c_master.o: ../usi_i2c_master.c ../usi_i2c_master.h \
2 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h \
13 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay_basic.h
14 |
15 | ../usi_i2c_master.h:
16 |
17 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/io.h:
18 |
19 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/sfr_defs.h:
20 |
21 | c:/winavr-20090313/lib/gcc/../../avr/include/inttypes.h:
22 |
23 | c:/winavr-20090313/lib/gcc/../../avr/include/stdint.h:
24 |
25 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/iotn2313.h:
26 |
27 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/portpins.h:
28 |
29 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/common.h:
30 |
31 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/version.h:
32 |
33 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/fuse.h:
34 |
35 | c:/winavr-20090313/lib/gcc/../../avr/include/avr/lock.h:
36 |
37 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:
38 |
39 | c:/winavr-20090313/lib/gcc/../../avr/include/util/delay_basic.h:
40 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/serial.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/serial.o
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/usi_i2c_master.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/default/usi_i2c_master.o
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/l297-l298-stepper-driver.aws:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/serial.c:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------*\
2 | | RGB Fan Controller - Serial Port Code File |
3 | | This file contains the functionality of the |
4 | | buffered serial port. It uses a buffer array|
5 | | and a position value. The default buffer |
6 | | size is 64 bytes, though you can increase |
7 | | it if you need a larger buffer. |
8 | | |
9 | | Adam Honse (CalcProgrammer1), 2010 |
10 | \*---------------------------------------------*/
11 | #include "serial.h"
12 |
13 | unsigned char buffer[16]; //Serial buffer
14 | unsigned char buffer_pos = 0; //Current use of buffer
15 |
16 | //USART Receive interrupt pushes the incoming byte into the buffer
17 | ISR(USART_RX_vect)
18 | {
19 | buffer[buffer_pos] = UDR;
20 | //Increment buffer position
21 | buffer_pos++;
22 | if(buffer_pos > 64)
23 | {
24 | buffer_pos = 0;
25 | }
26 | }
27 |
28 | unsigned char serial_available()
29 | {
30 | return buffer_pos;
31 | }
32 |
33 | void serial_init(unsigned int baud)
34 | {
35 | //Set baud rate
36 | UBRRH = (unsigned char) (baud >> 8);
37 | UBRRL = (unsigned char) (baud);
38 |
39 | //Set frame format: 8 data, no parity, 2 stop bits
40 | UCSRC = (0<
15 | #include
16 |
17 | // Serial_Init
18 | // Initializes the serial port
19 | // Takes an AVR USART speed (see the ATMega168 datasheet)
20 | void serial_init(unsigned int baud);
21 |
22 | // Serial_Transmit
23 | // Transmits a single byte of data
24 | void serial_transmit(unsigned char data);
25 |
26 | // Serial_Available
27 | // Returns number of available bytes in buffer
28 | unsigned char serial_available();
29 |
30 | // Serial_Read
31 | // Buffered read on Serial
32 | // Pulls the first byte from the serial port buffer and deletes it
33 | unsigned char serial_read();
34 |
35 | // Serial_Flush
36 | // Flush the Serial buffer
37 | // Deletes any data currently in the read buffer
38 | void serial_flush();
39 |
40 | // Serial Print
41 | // Prints a string
42 | void serial_print(char * text);
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/AVR Studio 4 Software Project/L297-L298-Stepper-Driver/usi_i2c_master.c:
--------------------------------------------------------------------------------
1 | /*---------------------------------*\
2 | | USI I2C/TWI Master - Adam Honse |
3 | | Senior Design 3/18/2012 |
4 | \*---------------------------------*/
5 |
6 | #include "usi_i2c_master.h"
7 | #include
8 | #include
9 |
10 | void usi_i2c_master_initialize()
11 | {
12 | //Enable pullups on SDA and SCL
13 | PORT_USI |= (1 << PIN_USI_SDA) | (1 << PIN_USI_SCL);
14 |
15 | //Set SDA and SCL as output
16 | DDR_USI &= ~((1 << PIN_USI_SDA) | (1 << PIN_USI_SCL));
17 |
18 | //Set up USI module//
19 | //Preload data register with "released level" data
20 | USIDR = 0xFF;
21 |
22 | //Disable interrupts, USI in Two-Wire mode, software strobe as counter clock source
23 | USICR = (0 << USISIE) | (0 << USIOIE) | (1 << USIWM1) | (0 << USIWM0) | (1 << USICS1) | (0 << USICS0) | (1 << USICLK) | (0 << USITC);
24 |
25 | //Clear flags and reset counter to zero
26 | USISR = (1 << USISIF) | (1 << USIOIF) | (1 << USIPF) | (1 << USIDC) | (0x0 << USICNT0);
27 | }
28 |
29 | char usi_i2c_master_transfer(char data)
30 | {
31 | //Load the USI data register with data to be transferred out
32 | USIDR = data;
33 |
34 | USISR = USISR_8_BIT;
35 |
36 | //Interrupts disabled, two wire mode, software clock strobe, toggle clock port
37 | char temp = (0< 4.7 uS
17 | #define I2C_DELAY_4 4 // > 4.0 uS
18 |
19 | #define USISR_8_BIT 0b11110000
20 | #define USISR_1_BIT 0b11111110
21 |
22 | void usi_i2c_master_initialize();
23 |
24 | int usi_i2c_master_transmit(char* data, int len);
25 |
26 | int usi_i2c_master_receive(char* data, int len);
27 |
28 | int usi_i2c_master_write(char addr, char* data, int len);
29 |
30 | int usi_i2c_master_read(char addr, char* data, int len);
31 |
32 | void usi_i2c_master_stop();
33 |
--------------------------------------------------------------------------------
/EAGLE Board Files/StepperDriver.pro:
--------------------------------------------------------------------------------
1 | EAGLE AutoRouter Statistics:
2 |
3 | Job : C:/Users/Adam Honse/Documents/eagle/Senior Design Stepper Driver/StepperDriver.brd
4 |
5 | Start at : 15:18:26 (2/5/2012)
6 | End at : 15:18:26 (2/5/2012)
7 | Elapsed time : 00:00:00
8 |
9 | Signals : 31 RoutingGrid: 50 mil Layers: 2
10 | Connections : 64 predefined: 64 ( 14 Vias )
11 |
12 | Router memory : 46632
13 |
14 | Passname : Route Optimize1 Optimize2 Optimize3 Optimize4
15 |
16 | Time per pass : 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00
17 | Number of Ripups : 0 0 0 0 0
18 | max. Level : 0 0 0 0 0
19 | max. Total : 0 0 0 0 0
20 |
21 | Routed : 0 0 0 0 0
22 | Vias : 0 0 0 0 0
23 | Resolution : 100.0 % 100.0 % 100.0 % 100.0 % 100.0 %
24 |
25 | Final : 100.0% finished
26 |
--------------------------------------------------------------------------------
/EAGLE Board Files/eagle.epf:
--------------------------------------------------------------------------------
1 | [Eagle]
2 | Version="06 01 00"
3 | Platform="Windows"
4 | Serial="7004B95A68-LSR-WLM-1CP"
5 | Globals="Globals"
6 | Desktop="Desktop"
7 |
8 | [Globals]
9 | AutoSaveProject=1
10 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/19inch.lbr"
11 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/40xx.lbr"
12 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/41xx.lbr"
13 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/45xx.lbr"
14 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/74ac-logic.lbr"
15 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/74ttl-din.lbr"
16 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/74xx-eu.lbr"
17 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/74xx-little-de.lbr"
18 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/74xx-little-us.lbr"
19 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/74xx-us.lbr"
20 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/751xx.lbr"
21 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/advanced-test-technologies.lbr"
22 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/agilent-technologies.lbr"
23 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/allegro.lbr"
24 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/altera-cyclone-II.lbr"
25 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/altera-cyclone-III.lbr"
26 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/altera-stratix-iv.lbr"
27 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/altera.lbr"
28 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/am29-memory.lbr"
29 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/amd-mach.lbr"
30 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/amd.lbr"
31 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/amis.lbr"
32 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/analog-devices.lbr"
33 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ase.lbr"
34 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/atmel.lbr"
35 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/austriamicrosystems.lbr"
36 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/avago.lbr"
37 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/axis.lbr"
38 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/battery.lbr"
39 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/belton-engineering.lbr"
40 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/burr-brown.lbr"
41 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/busbar.lbr"
42 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/buzzer.lbr"
43 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/c-trimm.lbr"
44 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/california-micro-devices.lbr"
45 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/capacitor-wima.lbr"
46 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/chipcard-siemens.lbr"
47 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/cirrus-logic.lbr"
48 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-3m.lbr"
49 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-4ucon.lbr"
50 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amp-champ.lbr"
51 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amp-micromatch.lbr"
52 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amp-mt.lbr"
53 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amp-mt6.lbr"
54 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amp-quick.lbr"
55 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amp.lbr"
56 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-amphenol.lbr"
57 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-avx.lbr"
58 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-berg.lbr"
59 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-bosch.lbr"
60 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-chipcard-iso7816.lbr"
61 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-coax.lbr"
62 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-commcon.lbr"
63 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-conrad.lbr"
64 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-cpci.lbr"
65 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-cui.lbr"
66 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-cypressindustries.lbr"
67 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-deutsch.lbr"
68 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-dil.lbr"
69 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-ebyelectro.lbr"
70 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-elco.lbr"
71 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-erni.lbr"
72 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-faston.lbr"
73 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-fci.lbr"
74 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-friwo.lbr"
75 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-garry.lbr"
76 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-harting-h.lbr"
77 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-harting-ml.lbr"
78 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-harting-v.lbr"
79 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-harting.lbr"
80 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-hirose.lbr"
81 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-hirschmann.lbr"
82 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-jack.lbr"
83 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-jae.lbr"
84 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-jst.lbr"
85 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-kycon.lbr"
86 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-kyocera-elco.lbr"
87 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-lemo.lbr"
88 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-leotronics.lbr"
89 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-lsta.lbr"
90 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-lstb.lbr"
91 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-lumberg.lbr"
92 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-ml.lbr"
93 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-molex.lbr"
94 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-neutrik_ag.lbr"
95 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-omron.lbr"
96 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-panasonic.lbr"
97 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-panduit.lbr"
98 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-pc.lbr"
99 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-pc104.lbr"
100 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-254.lbr"
101 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-3.81.lbr"
102 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-350.lbr"
103 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-500.lbr"
104 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-508.lbr"
105 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-762.lbr"
106 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-me_max.lbr"
107 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-mkds_5.lbr"
108 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-phoenix-smkdsp.lbr"
109 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-ptr500.lbr"
110 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-pulse.lbr"
111 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-rib.lbr"
112 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-samtec.lbr"
113 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-shallin.lbr"
114 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-shiua-chyuan.lbr"
115 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-stewart.lbr"
116 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-stocko.lbr"
117 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-subd.lbr"
118 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-sullinselectronics.lbr"
119 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-thomas-betts.lbr"
120 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-tyco.lbr"
121 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-tycoelectronics.lbr"
122 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-vg.lbr"
123 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-wago-500.lbr"
124 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-wago-508.lbr"
125 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-wago.lbr"
126 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-wago255.lbr"
127 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-weidmueller-sl35.lbr"
128 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-wenzhou-yihua.lbr"
129 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-xmultiple.lbr"
130 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/con-yamaichi.lbr"
131 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/crystal.lbr"
132 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/csr.lbr"
133 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/cypress.lbr"
134 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/davicom.lbr"
135 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/dc-dc-converter.lbr"
136 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/dimensions.lbr"
137 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/diode.lbr"
138 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/discrete.lbr"
139 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/display-hp.lbr"
140 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/display-kingbright.lbr"
141 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/display-lcd.lbr"
142 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/docu-dummy.lbr"
143 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ecl.lbr"
144 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/em-microelectronic.lbr"
145 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/etx-board.lbr"
146 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/exar.lbr"
147 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fairchild-semic.lbr"
148 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/farnell.lbr"
149 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fiber-optic-hp.lbr"
150 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fiber-optic-siemens.lbr"
151 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fifo.lbr"
152 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/flexipanel.lbr"
153 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fox-electronics.lbr"
154 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/frames.lbr"
155 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/freescale.lbr"
156 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ftdichip.lbr"
157 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fujitsu.lbr"
158 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/fuse.lbr"
159 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/gennum.lbr"
160 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/halo-electronics.lbr"
161 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/heatsink.lbr"
162 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/holes.lbr"
163 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/holtek.lbr"
164 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ic-package.lbr"
165 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/inductor-coilcraft.lbr"
166 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/inductor-neosid.lbr"
167 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/inductor-nkl.lbr"
168 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/inductors.lbr"
169 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/infineon-tricore.lbr"
170 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/infineon.lbr"
171 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/intersil.lbr"
172 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ir.lbr"
173 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/isd.lbr"
174 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/johanson-technology.lbr"
175 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/jump-0r-smd.lbr"
176 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/jumper.lbr"
177 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lantronix.lbr"
178 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lattice.lbr"
179 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lc-filter.lbr"
180 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/led-7-segment.lbr"
181 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/led-citizen-electronics.lbr"
182 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/led-lumiled.lbr"
183 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/led.lbr"
184 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lem.lbr"
185 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/linear-technology.lbr"
186 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/linear.lbr"
187 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/linx.lbr"
188 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/logo.lbr"
189 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lprs.lbr"
190 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lsi-computer-systems.lbr"
191 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/lumiled.lbr"
192 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/marks.lbr"
193 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/maxim.lbr"
194 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/maxstream.lbr"
195 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/melexis.lbr"
196 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-hitachi.lbr"
197 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-idt.lbr"
198 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-micron.lbr"
199 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-motorola-dram.lbr"
200 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-nec.lbr"
201 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-samsung.lbr"
202 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory-sram.lbr"
203 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/memory.lbr"
204 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/mems.lbr"
205 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micrel.lbr"
206 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-cyrod.lbr"
207 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-fujitsu.lbr"
208 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-harris.lbr"
209 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-hitachi.lbr"
210 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-infineon.lbr"
211 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-intel.lbr"
212 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-mc68000.lbr"
213 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-motorola.lbr"
214 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-philips.lbr"
215 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-renesas.lbr"
216 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-samsung.lbr"
217 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micro-siemens.lbr"
218 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/microchip.lbr"
219 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micron.lbr"
220 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/micronas.lbr"
221 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/microphon.lbr"
222 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/microwave.lbr"
223 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/midori-sensor.lbr"
224 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/minicircuits.lbr"
225 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/mitsubishi-semiconductor.lbr"
226 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/motorola-sensor-driver.lbr"
227 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/murata-filter.lbr"
228 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/murata-sensor.lbr"
229 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/nanotec.lbr"
230 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/national-instruments.lbr"
231 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/national-semiconductor.lbr"
232 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/nec-lqfp100-pack.lbr"
233 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/nec.lbr"
234 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/nrj-semiconductor.lbr"
235 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/omnivision.lbr"
236 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/on-semiconductor.lbr"
237 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-honeywell-3000.lbr"
238 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-honeywell-4000.lbr"
239 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-honeywell.lbr"
240 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-micro-linear.lbr"
241 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-trans-siemens.lbr"
242 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-transmittter-hp.lbr"
243 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/opto-vishay.lbr"
244 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/optocoupler.lbr"
245 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/pal.lbr"
246 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/philips-semiconductors.lbr"
247 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/photo-elements.lbr"
248 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/piher.lbr"
249 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/pinhead.lbr"
250 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/plcc-socket.lbr"
251 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/pld-intel.lbr"
252 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/plxtech.lbr"
253 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/pot-vitrohm.lbr"
254 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/pot-xicor.lbr"
255 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/pot.lbr"
256 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ptc-ntc.lbr"
257 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/quantum-research-group.lbr"
258 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/rcl.lbr"
259 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/recom-international.lbr"
260 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/rectifier.lbr"
261 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ref-packages-longpad.lbr"
262 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/ref-packages.lbr"
263 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/relay.lbr"
264 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/renesas.lbr"
265 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-bourns.lbr"
266 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-dil.lbr"
267 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-net.lbr"
268 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-power.lbr"
269 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-ruf.lbr"
270 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-shunt.lbr"
271 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor-sil.lbr"
272 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/resistor.lbr"
273 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/rf-micro-devices.lbr"
274 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/rf-solutions.lbr"
275 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/rohm.lbr"
276 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/semicon-smd-ipc.lbr"
277 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/sensor-comus-group.lbr"
278 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/sensor-heraeus.lbr"
279 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/sensor-infratec.lbr"
280 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/sharp.lbr"
281 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/silabs.lbr"
282 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/sim-technology.lbr"
283 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/sipex.lbr"
284 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/smd-ipc.lbr"
285 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/smd-special.lbr"
286 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/solomon-systech.lbr"
287 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/solpad.lbr"
288 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/special-drill.lbr"
289 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/special.lbr"
290 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/st-microelectronics.lbr"
291 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/supertex.lbr"
292 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/supply1.lbr"
293 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/supply2.lbr"
294 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-alps.lbr"
295 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-coto.lbr"
296 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-dil.lbr"
297 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-misc.lbr"
298 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-omron.lbr"
299 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-raychem.lbr"
300 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch-reed.lbr"
301 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/switch.lbr"
302 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/telcom.lbr"
303 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/telecontrolli.lbr"
304 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/telefunken.lbr"
305 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/testpad.lbr"
306 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/texas.lbr"
307 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/toshiba.lbr"
308 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/traco-electronic.lbr"
309 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/trafo-bei.lbr"
310 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/trafo-siemens.lbr"
311 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/trafo-xicon.lbr"
312 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/trafo.lbr"
313 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor-fet.lbr"
314 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor-neu-to92.lbr"
315 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor-npn.lbr"
316 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor-pnp.lbr"
317 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor-power.lbr"
318 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor-small-signal.lbr"
319 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/transistor.lbr"
320 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/triac.lbr"
321 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/trimble.lbr"
322 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/tripas.lbr"
323 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/u-blox.lbr"
324 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/uln-udn.lbr"
325 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/v-reg-micrel.lbr"
326 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/v-reg.lbr"
327 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/varistor.lbr"
328 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/wafer-scale-psd.lbr"
329 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/wirepad.lbr"
330 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/xicor.lbr"
331 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/xilinx-virtex-v5.lbr"
332 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/xilinx-xc18v.lbr"
333 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/xilinx-xc9.lbr"
334 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/xilinx-xcv.lbr"
335 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/zetex.lbr"
336 | UsedLibrary="C:/Program Files (x86)/EAGLE-6.1.0/lbr/zilog.lbr"
337 | UsedLibrary="C:/Users/Adam Honse/Downloads/avr-5.lbr"
338 | UsedLibrary="C:/Users/Adam Honse/Desktop/SparkFun-DigitalIC.lbr"
339 | UsedLibrary="C:/Users/Adam Honse/Desktop/SparkFun-Electromechanical.lbr"
340 | UsedLibrary="C:/Users/Adam Honse/Downloads/avr-7.lbr"
341 | UsedLibrary="C:/Users/Adam Honse/Desktop/SparkFun-LED.lbr"
342 | UsedLibrary="C:/Users/Adam Honse/Downloads/led_rgb.lbr"
343 |
344 | [Win_1]
345 | Type="Control Panel"
346 | Loc="2187 213 2786 612"
347 | State=2
348 | Number=0
349 |
350 | [Desktop]
351 | Screen="2960 1050"
352 | Window="Win_1"
353 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/README
--------------------------------------------------------------------------------
/UnipolarStepperDriver/UnipolarStepperDriver.aps:
--------------------------------------------------------------------------------
1 | UnipolarStepperDriver23-Mar-2012 22:19:1729-Jul-2012 21:58:48241023-Mar-2012 22:19:1744, 18, 0, 685AVR GCCdefault\UnipolarStepperDriver.elf\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\AVR SimulatorATtiny2313.xmlfalseR00R01R02R03R04R05R06R07R08R09R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25R26R27R28R29R30R31Auto000UnipolarStepperDriver.cserial.cusi_i2c_slave.cusi_i2c_master.cserial.husi_i2c_slave.husi_i2c_master.hdefault\UnipolarStepperDriver.lssdefault\UnipolarStepperDriver.mapdefaultNOattiny231311
UnipolarStepperDriver.elfdefault\1-Wall -gdwarf-2 -std=gnu99 -DF_CPU=20000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enumsdefault1C:\WinAVR-20100110\bin\avr-gcc.exeC:\WinAVR-20100110\utils\bin\make.exe\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\serial.h\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\usi_i2c_slave.h\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\usi_i2c_master.h\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\UnipolarStepperDriver.c\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\serial.c\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\usi_i2c_slave.c\\adam-server\raid5\Programming\Stepper Motor Controller\UnipolarStepperDriver\usi_i2c_master.c00000serial.c25700001serial.h100002UnipolarStepperDriver.c100003usi_i2c_slave.c100004usi_i2c_slave.h100005usi_i2c_master.h100006usi_i2c_master.c1
2 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/UnipolarStepperDriver.c:
--------------------------------------------------------------------------------
1 | /*-------------------------------------*\
2 | | TinyStepper Unipolar Stepper Driver |
3 | | ATTiny2313-based unipolar driver for |
4 | | 6-wire or 8-wire stepper motors. |
5 | | |
6 | | Serial and i2c interface |
7 | | |
8 | | Adam Honse (amhb59@mail.mst.edu/ |
9 | | calcprogrammer1@gmail.com)|
10 | | 3/31/2012 |
11 | \*-------------------------------------*/
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | #include "serial.h"
19 | #include "usi_i2c_slave.h"
20 | #include "usi_i2c_master.h"
21 |
22 | char step_current;
23 | char step_state;
24 | char step_max;
25 |
26 | char step_mode;
27 | char step_dir;
28 | char step_enabled;
29 | volatile int step_count = 0;
30 | volatile int step_compare = 0;
31 |
32 | char serial_i2c_buffer[8];
33 | char serial_i2c_buffer_pos;
34 |
35 | extern char usi_i2c_slave_address;
36 | extern char* USI_Slave_register_buffer[];
37 | //Normal
38 | volatile char step_table[16] = {0b00001000, 0b00100000, 0b00010000, 0b01000000,
39 |
40 | //Double Phase
41 | 0b00101000, 0b00110000, 0b01010000, 0b01001000,
42 |
43 | //Half Stepping
44 | 0b00001000, 0b00101000, 0b00100000, 0b00110000,
45 |
46 | 0b00010000, 0b01010000, 0b01000000, 0b01001000};
47 |
48 | inline void status_led_on();
49 | inline void status_led_off();
50 | inline void process_serial_message();
51 |
52 | void set_rgb_led(char led);
53 | void initialize_timer();
54 | void process_i2c_message();
55 | void fill_i2c_buffer_from_serial(char len, char addr, char rw);
56 |
57 | inline void status_led_on()
58 | {
59 | PORTD |= 0b00000100;
60 | }
61 |
62 | inline void status_led_off()
63 | {
64 | PORTD &= 0b11111011;
65 | }
66 |
67 | void set_rgb_led(char led)
68 | {
69 | led = led << 2;
70 | PORTB |= (led & 0b00011100);
71 | PORTB &= (led | 0b11100011);
72 | }
73 |
74 | void initialize_timer()
75 | {
76 | //OCR1A - Timer 1 Compare A - Used for motor speed
77 | OCR1A = step_compare;
78 |
79 | //OCR2A/B - Timer 0 Compare A/B - Used for motor PWM
80 | OCR0A = 20;
81 | OCR0B = 100;
82 |
83 | //Reset step states
84 | step_current = 0x00000000;
85 | step_state = 0;
86 | step_mode = 0;
87 | step_dir = 1;
88 | step_enabled = 0;
89 | step_max = 3;
90 |
91 | //Enable output compare A interrupt for timers 0 and 1
92 | TIMSK = (1< 0)
104 | {
105 | if(step_dir == 1)
106 | {
107 | set_rgb_led(0b00000010);
108 | if(++step_state > step_max) step_state = 0;
109 | }
110 | else
111 | {
112 | set_rgb_led(0b00000001);
113 | if(--step_state < 0) step_state = step_max;
114 | }
115 |
116 | if(step_enabled == 1)
117 | {
118 | if(step_mode == 0)
119 | {
120 | step_current = step_table[step_state];
121 | step_max = 3;
122 | }
123 | else if(step_mode == 1)
124 | {
125 | step_current = step_table[step_state+4];
126 | step_max = 3;
127 | }
128 | else if(step_mode == 2)
129 | {
130 | step_current = step_table[step_state+8];
131 | step_max = 7;
132 | }
133 | }
134 | step_count--;
135 | }
136 | if(step_count == 0)
137 | {
138 | step_enabled = 0;
139 | set_rgb_led(0b00000100);
140 | }
141 | }
142 | else
143 | {
144 | set_rgb_led(0b00000100);
145 | }
146 |
147 | TCNT1 = 0;
148 | }
149 |
150 | ISR(TIMER0_COMPB_vect)
151 | {
152 | PORTD &= 0b10000111;
153 | TCNT0 = 0;
154 | }
155 |
156 | ISR(TIMER0_COMPA_vect)
157 | {
158 | if(step_enabled == 1)
159 | {
160 | PORTD |= step_current;
161 | }
162 | }
163 |
164 | int main()
165 | {
166 | DDRB = 0b00011100;
167 | DDRD = 0b01111100;
168 |
169 | sei();
170 | initialize_timer();
171 | serial_init(65);
172 |
173 | usi_i2c_slave_address = eeprom_read_byte((uint8_t*)1);
174 | if((usi_i2c_slave_address < 0x04) || (usi_i2c_slave_address > 0x77))
175 | {
176 | //If the stored address is out of range, default to 0x66.
177 | usi_i2c_slave_address = 0x66;
178 | }
179 |
180 | //USI_I2C_Init(usi_i2c_slave_address);
181 |
182 | //master init
183 | DDR_USI |= (1 << PORT_USI_SDA) | (1 << PORT_USI_SCL);
184 | PORT_USI |= (1 << PORT_USI_SCL);
185 | PORT_USI |= (1 << PORT_USI_SDA);
186 | USIDR = 0xFF;
187 | USICR = (0 << USISIE) | (0 << USIOIE) | (1 << USIWM1) | (0 << USIWM0) | (1 << USICS1) | (0 << USICS0) | (1 << USICLK) | (0 << USITC);
188 | USISR = (1 << USISIF) | (1 << USIOIF) | (1 << USIPF) | (1 << USIDC) | (0x00 << USICNT0);
189 |
190 | USI_Slave_register_buffer[0] = (unsigned char*)&step_compare;
191 | USI_Slave_register_buffer[1] = (unsigned char*)(&step_compare)+1;
192 | USI_Slave_register_buffer[2] = (unsigned char*)&step_count;
193 | USI_Slave_register_buffer[3] = (unsigned char*)(&step_count)+1;
194 | USI_Slave_register_buffer[4] = &step_dir;
195 | USI_Slave_register_buffer[5] = &step_mode;
196 | USI_Slave_register_buffer[6] = &step_enabled;
197 | USI_Slave_register_buffer[7] = &step_enabled;
198 | while(1)
199 | {
200 | if(step_compare != OCR1A)
201 | {
202 | OCR1A = step_compare;
203 | }
204 | process_serial_message();
205 | }
206 | }
207 |
208 | inline void process_serial_message()
209 | {
210 | if(serial_available() > 2)
211 | {
212 | status_led_on();
213 |
214 | char buffer[3];
215 | serial_read_buffer(buffer, 3);
216 |
217 | switch(buffer[0])
218 | {
219 | //Set I2C Address
220 | case 0x22:
221 | usi_i2c_slave_address = buffer[1];
222 | eeprom_write_byte((uint8_t*)1, usi_i2c_slave_address);
223 | break;
224 |
225 | //Read I2C Address
226 | case 0x23:
227 | serial_transmit_byte(usi_i2c_slave_address);
228 | break;
229 |
230 | //Send I2C Write
231 | case 0x24:
232 | fill_i2c_buffer_from_serial(buffer[1], buffer[2], 0);
233 | serial_transmit_byte(USI_I2C_Master_Start_Transmission(serial_i2c_buffer, buffer[1]+1));
234 | break;
235 |
236 | //Send I2C Read
237 | case 0x25:
238 | {
239 | char addr = buffer[2] << 1 | 1;
240 | serial_i2c_buffer[0] = addr;
241 | USI_I2C_Master_Start_Transmission(serial_i2c_buffer, buffer[1]+1);
242 | for(char i = 1; i <= buffer[1]; i++)
243 | {
244 | serial_transmit_byte(serial_i2c_buffer[i]);
245 | }
246 | }
247 | break;
248 | }
249 | status_led_off();
250 | }
251 | }
252 |
253 |
254 | void fill_i2c_buffer_from_serial(char len, char addr, char rw)
255 | {
256 | //Set R/W bit of address
257 | addr = addr << 1 | rw;
258 |
259 | //Put address into i2c buffer
260 | serial_i2c_buffer[0] = addr;
261 |
262 | for(char i = 1; i <= len; i++)
263 | {
264 | while(serial_available() < 1);
265 | serial_i2c_buffer[i] = serial_read();
266 | }
267 | }
268 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/Makefile:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Makefile for the project UnipolarStepperDriver
3 | ###############################################################################
4 |
5 | ## General Flags
6 | PROJECT = UnipolarStepperDriver
7 | MCU = attiny2313
8 | TARGET = UnipolarStepperDriver.elf
9 | CC = avr-gcc
10 |
11 | CPP = avr-g++
12 |
13 | ## Options common to compile, link and assembly rules
14 | COMMON = -mmcu=$(MCU)
15 |
16 | ## Compile options common for all C compilation units.
17 | CFLAGS = $(COMMON)
18 | CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=20000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
19 | CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
20 |
21 | ## Assembly specific flags
22 | ASMFLAGS = $(COMMON)
23 | ASMFLAGS += $(CFLAGS)
24 | ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
25 |
26 | ## Linker flags
27 | LDFLAGS = $(COMMON)
28 | LDFLAGS += -Wl,-Map=UnipolarStepperDriver.map
29 |
30 |
31 | ## Intel Hex file production flags
32 | HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
33 |
34 | HEX_EEPROM_FLAGS = -j .eeprom
35 | HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
36 | HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
37 |
38 |
39 | ## Objects that must be built in order to link
40 | OBJECTS = UnipolarStepperDriver.o serial.o usi_i2c_slave.o usi_i2c_master.o
41 |
42 | ## Objects explicitly added by the user
43 | LINKONLYOBJECTS =
44 |
45 | ## Build
46 | all: $(TARGET) UnipolarStepperDriver.hex UnipolarStepperDriver.eep UnipolarStepperDriver.lss size
47 |
48 | ## Compile
49 | UnipolarStepperDriver.o: ../UnipolarStepperDriver.c
50 | $(CC) $(INCLUDES) $(CFLAGS) -c $<
51 |
52 | serial.o: ../serial.c
53 | $(CC) $(INCLUDES) $(CFLAGS) -c $<
54 |
55 | usi_i2c_slave.o: ../usi_i2c_slave.c
56 | $(CC) $(INCLUDES) $(CFLAGS) -c $<
57 |
58 | usi_i2c_master.o: ../usi_i2c_master.c
59 | $(CC) $(INCLUDES) $(CFLAGS) -c $<
60 |
61 | ##Link
62 | $(TARGET): $(OBJECTS)
63 | $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
64 |
65 | %.hex: $(TARGET)
66 | avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
67 |
68 | %.eep: $(TARGET)
69 | -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
70 |
71 | %.lss: $(TARGET)
72 | avr-objdump -h -S $< > $@
73 |
74 | size: ${TARGET}
75 | @echo
76 | @avr-size -C --mcu=${MCU} ${TARGET}
77 |
78 | ## Clean target
79 | .PHONY: clean
80 | clean:
81 | -rm -rf $(OBJECTS) UnipolarStepperDriver.elf dep/* UnipolarStepperDriver.hex UnipolarStepperDriver.eep UnipolarStepperDriver.lss UnipolarStepperDriver.map
82 |
83 |
84 | ## Other dependencies
85 | -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
86 |
87 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/UnipolarStepperDriver.eep:
--------------------------------------------------------------------------------
1 | :00000001FF
2 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/UnipolarStepperDriver.elf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/UnipolarStepperDriver/default/UnipolarStepperDriver.elf
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/UnipolarStepperDriver.hex:
--------------------------------------------------------------------------------
1 | :1000000012C02AC029C028C052C026C025C0BFC106
2 | :1000100023C022C021C020C01FC0DDC0CCC045C24B
3 | :100020005FC21AC019C011241FBECFEDCDBF10E0B2
4 | :10003000A0E6B0E0E2E1F7E002C005900D92A03743
5 | :10004000B107D9F710E0A0E7B0E001C01D92AB3ACC
6 | :10005000B107E1F7EFD05BC3D3CF880F880F28B388
7 | :10006000982F9C71922B98BB98B3836E982398BB62
8 | :10007000089580917200909173009BBD8ABD84E1C8
9 | :1000800086BF84E68CBF1092850010928200109289
10 | :10009000770081E0809384001092800093E0909339
11 | :1000A000810085E489BF9EBD82E083BF08951F92D1
12 | :1000B0000F920FB60F9211242F933F934F935F939C
13 | :1000C0006F937F938F939F93AF93BF93EF93FF9320
14 | :1000D00080918000813009F059C08091700090912A
15 | :1000E0007100181619060CF049C080918400813007
16 | :1000F00071F482E0B2DF809182008F5F8093820092
17 | :1001000090918100981750F41092820007C081E00E
18 | :10011000A4DF8091820081508093820080918000D2
19 | :10012000813019F580917700882331F4E0918200C5
20 | :10013000F0E0E05AFF4F07C0813051F4E0918200B7
21 | :10014000F0E0EC59FF4F80818093850083E00BC085
22 | :10015000823059F4E0918200F0E0E859FF4F80814D
23 | :100160008093850087E0809381008091700090915A
24 | :1001700071000197909371008093700080917000DE
25 | :1001800090917100892B21F41092800084E065DF4A
26 | :100190001DBC1CBCFF91EF91BF91AF919F918F91BE
27 | :1001A0007F916F915F914F913F912F910F900FBE73
28 | :1001B0000F901F9018951F920F920FB60F92112457
29 | :1001C0008F9382B3877882BB12BE8F910F900FBE40
30 | :1001D0000F901F9018951F920F920FB60F92112437
31 | :1001E0008F939F9380918000813029F482B3909106
32 | :1001F0008500892B82BB9F918F910F900FBE0F902E
33 | :100200001F9018950F931F93082F660F642B609310
34 | :10021000780011E00AC0DCD08823E9F3E3D0E12FB5
35 | :10022000F0E0E858FF4F80831F5F0117A0F71F9190
36 | :100230000F910895EF92FF921F93DF93CF9300D019
37 | :100240000F92CDB7DEB78CE187BB8CE781BB78948A
38 | :1002500010DF81E490E0BFD081E090E042D2809353
39 | :1002600096008450843718F086E68093960087B312
40 | :10027000806A87BBC79AC59A8FEF8FB98AE28DB91A
41 | :1002800080EF8EB982E790E090939A008093990076
42 | :10029000019690939C0080939B0080E790E0909360
43 | :1002A0009E0080939D0001969093A00080939F00F4
44 | :1002B00084E890E09093A2008093A10087E790E00B
45 | :1002C0009093A4008093A30080E890E09093A60010
46 | :1002D0008093A5009093A8008093A7007E010894C6
47 | :1002E000E11CF11C20917200309173008AB59BB51E
48 | :1002F0002817390731F080917200909173009BBDEF
49 | :100300008ABD66D0833070F3929AC70163E070E0D3
50 | :100310007FD08981833289F0843218F48232A9F542
51 | :1003200005C0843269F0853281F517C06A81609317
52 | :10033000960081E090E0DDD128C0809196000BC04E
53 | :100340008A816B8140E05EDF6A8170E06F5F7F4F82
54 | :1003500088E790E060D17FD018C08B81880F8160E2
55 | :10036000809378006A8170E06F5F7F4F88E790E04C
56 | :1003700052D111E007C0E12FF0E0E858FF4F808133
57 | :100380006AD01F5F8A818117B0F79298ABCF1F9216
58 | :100390000F920FB60F9211248F939F93EF93FF93B9
59 | :1003A000809174009CB1E82FF0E0EA57FF4F9083F2
60 | :1003B0008F5F80937400813110F010927400FF9170
61 | :1003C000EF919F918F910F900FBE0F901F901895F6
62 | :1003D00080917400089592B989B986E083B988E95B
63 | :1003E0008AB9089590917400992311F420E00EC009
64 | :1003F00020918600E6E8F0E08181819380E0E53994
65 | :10040000F807D1F71082915090937400822F0895CD
66 | :10041000EF92FF920F931F93CF93DF937C018B0199
67 | :10042000C0E0D0E00AC080917400882349F0DADF90
68 | :10043000F701EC0FFD1F80832196C017D1079CF3B5
69 | :10044000CE01DF91CF911F910F91FF90EF90089512
70 | :100450001092740008955D9BFECF8CB9089520E042
71 | :1004600030E009C0FC01E20FF31FE0815D9BFECF8D
72 | :10047000ECB92F5F3F4F26173707A4F30895FC010F
73 | :1004800004C05D9BFECF8CB9319680818823C9F76B
74 | :100490000895C798C5988093960087B38F7587BBDA
75 | :1004A00088EA8DB980EF8EB908951F920F920FB62A
76 | :1004B0000F9211248F9310929800BD98B79B02C0A1
77 | :1004C000B59BFCCFB59902C088EE01C088EB8DB911
78 | :1004D00080EF8EB98F910F900FBE0F901F901895DF
79 | :1004E0001F920F920FB60F9211248F939F93EF9349
80 | :1004F000FF9380919800823021F1833030F488237B
81 | :1005000069F0813009F069C028C0843009F43FC027
82 | :100510008430E8F0853009F060C03FC08FB1882397
83 | :1005200031F08FB1869590919600891799F4789B58
84 | :1005300002C081E003C01092760084E080939800AE
85 | :1005400048C0C59883E080939800BD9844C08FB19F
86 | :10055000882319F088EA8DB91EC0909175009930F2
87 | :1005600060F4E92FF0E0EE0FFF1FE756FF4F019018
88 | :10057000F081E02D80818FB901C01FB89F5F9093FB
89 | :10058000750082E080939800BD9AC59A04C085E00A
90 | :1005900080939800BD9880E71FC084E08093980006
91 | :1005A00080917600882339F48FB18093750081E0C3
92 | :1005B000809376000EC0E0917500E93050F48FB161
93 | :1005C000F0E0EE0FFF1FE756FF4F0190F081E02DA6
94 | :1005D00080831FB8BD9A8EE78EB9FF91EF919F91EE
95 | :1005E0008F910F900FBE0F901F9018958EB93FE11D
96 | :1005F0009BE22AE1832F8A95F1F79DB9B79BFECF45
97 | :10060000822F8A95F1F79DB9769BF4CF8FE18A9579
98 | :10061000F1F78FB10895EF92FF920F931F93CF934D
99 | :10062000DF93EC01162F1092AA00C79AB79BFECF5A
100 | :100630008FE1982F9A95F1F7BD9ABF9AC5989AE1E4
101 | :100640009A95F1F7C7988A95F1F7C59A82E0E82E56
102 | :10065000FF24F3940FEF8091AA00813069F081307C
103 | :1006600018F0823039F519C0888180FD03C0F092FE
104 | :10067000AA0002C0E092AA00C79888818FB980EFD3
105 | :10068000B5DFBD988EEFB2DF80FF04C0C79AC59A70
106 | :1006900080E020C02196BD9A0DC0BD9880EFA6DFF6
107 | :1006A0008883BD9A113011F40FB901C01FB821968B
108 | :1006B0008EEF9CDF115079F6C5988FE18A95F1F79E
109 | :1006C000BF98B79BFECF8AE18A95F1F7BD98B59B9D
110 | :1006D000FECF81E0DF91CF911F910F91FF90EF90BE
111 | :1006E0000895E199FECF1FBA8EBBE09A99278DB38A
112 | :1006F0000895262FE199FECF1CBA1FBA8EBB2DBBE1
113 | :100700000FB6F894E29AE19A0FBE01960895F89414
114 | :02071000FFCF19
115 | :100712000820104028305048082820301050404807
116 | :00000001FF
117 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/UnipolarStepperDriver.map:
--------------------------------------------------------------------------------
1 | Archive member included because of file (symbol)
2 |
3 | c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
4 | c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o (exit)
5 | c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_copy_data.o)
6 | UnipolarStepperDriver.o (__do_copy_data)
7 | c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_clear_bss.o)
8 | UnipolarStepperDriver.o (__do_clear_bss)
9 | c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eerd_byte_attiny2313.o)
10 | UnipolarStepperDriver.o (__eerd_byte_tn2313)
11 | c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eewr_byte_attiny2313.o)
12 | UnipolarStepperDriver.o (__eewr_byte_tn2313)
13 |
14 | Allocating common symbols
15 | Common symbol size file
16 |
17 | step_mode 0x1 UnipolarStepperDriver.o
18 | serial_i2c_buffer 0x8 UnipolarStepperDriver.o
19 | step_enabled 0x1 UnipolarStepperDriver.o
20 | usi_i2c_slave_address
21 | 0x1 usi_i2c_slave.o
22 | usi_i2c_slave_internal_address
23 | 0x1 usi_i2c_slave.o
24 | step_max 0x1 UnipolarStepperDriver.o
25 | USI_I2C_Slave_State
26 | 0x1 usi_i2c_slave.o
27 | serial_buffer 0x10 serial.o
28 | USI_Slave_register_buffer
29 | 0x10 usi_i2c_slave.o
30 | step_state 0x1 UnipolarStepperDriver.o
31 | serial_i2c_buffer_pos
32 | 0x1 UnipolarStepperDriver.o
33 | step_dir 0x1 UnipolarStepperDriver.o
34 | USI_I2C_Master_State
35 | 0x1 usi_i2c_master.o
36 | usi_i2c_mode 0x1 usi_i2c_slave.o
37 | step_current 0x1 UnipolarStepperDriver.o
38 |
39 | Memory Configuration
40 |
41 | Name Origin Length Attributes
42 | text 0x00000000 0x00002000 xr
43 | data 0x00800060 0x0000ffa0 rw !x
44 | eeprom 0x00810000 0x00010000 rw !x
45 | fuse 0x00820000 0x00000400 rw !x
46 | lock 0x00830000 0x00000400 rw !x
47 | signature 0x00840000 0x00000400 rw !x
48 | *default* 0x00000000 0xffffffff
49 |
50 | Linker script and memory map
51 |
52 | LOAD c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
53 | LOAD UnipolarStepperDriver.o
54 | LOAD serial.o
55 | LOAD usi_i2c_slave.o
56 | LOAD usi_i2c_master.o
57 | LOAD c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a
58 | LOAD c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a
59 | LOAD c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a
60 |
61 | .hash
62 | *(.hash)
63 |
64 | .dynsym
65 | *(.dynsym)
66 |
67 | .dynstr
68 | *(.dynstr)
69 |
70 | .gnu.version
71 | *(.gnu.version)
72 |
73 | .gnu.version_d
74 | *(.gnu.version_d)
75 |
76 | .gnu.version_r
77 | *(.gnu.version_r)
78 |
79 | .rel.init
80 | *(.rel.init)
81 |
82 | .rela.init
83 | *(.rela.init)
84 |
85 | .rel.text
86 | *(.rel.text)
87 | *(.rel.text.*)
88 | *(.rel.gnu.linkonce.t*)
89 |
90 | .rela.text
91 | *(.rela.text)
92 | *(.rela.text.*)
93 | *(.rela.gnu.linkonce.t*)
94 |
95 | .rel.fini
96 | *(.rel.fini)
97 |
98 | .rela.fini
99 | *(.rela.fini)
100 |
101 | .rel.rodata
102 | *(.rel.rodata)
103 | *(.rel.rodata.*)
104 | *(.rel.gnu.linkonce.r*)
105 |
106 | .rela.rodata
107 | *(.rela.rodata)
108 | *(.rela.rodata.*)
109 | *(.rela.gnu.linkonce.r*)
110 |
111 | .rel.data
112 | *(.rel.data)
113 | *(.rel.data.*)
114 | *(.rel.gnu.linkonce.d*)
115 |
116 | .rela.data
117 | *(.rela.data)
118 | *(.rela.data.*)
119 | *(.rela.gnu.linkonce.d*)
120 |
121 | .rel.ctors
122 | *(.rel.ctors)
123 |
124 | .rela.ctors
125 | *(.rela.ctors)
126 |
127 | .rel.dtors
128 | *(.rel.dtors)
129 |
130 | .rela.dtors
131 | *(.rela.dtors)
132 |
133 | .rel.got
134 | *(.rel.got)
135 |
136 | .rela.got
137 | *(.rela.got)
138 |
139 | .rel.bss
140 | *(.rel.bss)
141 |
142 | .rela.bss
143 | *(.rela.bss)
144 |
145 | .rel.plt
146 | *(.rel.plt)
147 |
148 | .rela.plt
149 | *(.rela.plt)
150 |
151 | .text 0x00000000 0x712
152 | *(.vectors)
153 | .vectors 0x00000000 0x26 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
154 | 0x00000000 __vectors
155 | 0x00000000 __vector_default
156 | *(.vectors)
157 | *(.progmem.gcc*)
158 | *(.progmem*)
159 | 0x00000026 . = ALIGN (0x2)
160 | 0x00000026 __trampolines_start = .
161 | *(.trampolines)
162 | .trampolines 0x00000026 0x0 linker stubs
163 | *(.trampolines*)
164 | 0x00000026 __trampolines_end = .
165 | *(.jumptables)
166 | *(.jumptables*)
167 | *(.lowtext)
168 | *(.lowtext*)
169 | 0x00000026 __ctors_start = .
170 | *(.ctors)
171 | 0x00000026 __ctors_end = .
172 | 0x00000026 __dtors_start = .
173 | *(.dtors)
174 | 0x00000026 __dtors_end = .
175 | SORT(*)(.ctors)
176 | SORT(*)(.dtors)
177 | *(.init0)
178 | .init0 0x00000026 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
179 | 0x00000026 __init
180 | *(.init0)
181 | *(.init1)
182 | *(.init1)
183 | *(.init2)
184 | .init2 0x00000026 0x8 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
185 | *(.init2)
186 | *(.init3)
187 | *(.init3)
188 | *(.init4)
189 | .init4 0x0000002e 0x16 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_copy_data.o)
190 | 0x0000002e __do_copy_data
191 | .init4 0x00000044 0x10 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_clear_bss.o)
192 | 0x00000044 __do_clear_bss
193 | *(.init4)
194 | *(.init5)
195 | *(.init5)
196 | *(.init6)
197 | *(.init6)
198 | *(.init7)
199 | *(.init7)
200 | *(.init8)
201 | *(.init8)
202 | *(.init9)
203 | .init9 0x00000054 0x4 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
204 | *(.init9)
205 | *(.text)
206 | .text 0x00000058 0x2 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
207 | 0x00000058 __vector_1
208 | 0x00000058 __vector_12
209 | 0x00000058 __bad_interrupt
210 | 0x00000058 __vector_6
211 | 0x00000058 __vector_3
212 | 0x00000058 __vector_11
213 | 0x00000058 __vector_17
214 | 0x00000058 __vector_5
215 | 0x00000058 __vector_9
216 | 0x00000058 __vector_2
217 | 0x00000058 __vector_8
218 | 0x00000058 __vector_10
219 | 0x00000058 __vector_18
220 | .text 0x0000005a 0x334 UnipolarStepperDriver.o
221 | 0x00000072 initialize_timer
222 | 0x000001d6 __vector_13
223 | 0x00000204 fill_i2c_buffer_from_serial
224 | 0x00000234 main
225 | 0x000000ae __vector_4
226 | 0x0000005a set_rgb_led
227 | 0x000001b6 __vector_14
228 | .text 0x0000038e 0x104 serial.o
229 | 0x000003d0 serial_available
230 | 0x0000047e serial_print
231 | 0x00000450 serial_flush
232 | 0x0000045e serial_transmit_data
233 | 0x00000456 serial_transmit_byte
234 | 0x0000038e __vector_7
235 | 0x00000410 serial_read_buffer
236 | 0x000003d6 serial_init
237 | 0x000003e4 serial_read
238 | .text 0x00000492 0x15a usi_i2c_slave.o
239 | 0x00000492 USI_I2C_Init
240 | 0x000004aa __vector_15
241 | 0x000004e0 __vector_16
242 | .text 0x000005ec 0xf6 usi_i2c_master.o
243 | 0x00000616 USI_I2C_Master_Start_Transmission
244 | 0x000005ec USI_I2C_Master_Transfer
245 | .text 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
246 | .text 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_copy_data.o)
247 | .text 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_clear_bss.o)
248 | .text 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eerd_byte_attiny2313.o)
249 | .text 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eewr_byte_attiny2313.o)
250 | 0x000006e2 . = ALIGN (0x2)
251 | *(.text.*)
252 | .text.libgcc 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
253 | .text.libgcc 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_copy_data.o)
254 | .text.libgcc 0x000006e2 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_clear_bss.o)
255 | .text.avr-libc
256 | 0x000006e2 0x10 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eerd_byte_attiny2313.o)
257 | 0x000006e2 __eerd_byte_tn2313
258 | .text.avr-libc
259 | 0x000006f2 0x1c c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eewr_byte_attiny2313.o)
260 | 0x000006f2 __eewr_byte_tn2313
261 | 0x000006f4 __eewr_r18_tn2313
262 | 0x0000070e . = ALIGN (0x2)
263 | *(.fini9)
264 | .fini9 0x0000070e 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
265 | 0x0000070e exit
266 | 0x0000070e _exit
267 | *(.fini9)
268 | *(.fini8)
269 | *(.fini8)
270 | *(.fini7)
271 | *(.fini7)
272 | *(.fini6)
273 | *(.fini6)
274 | *(.fini5)
275 | *(.fini5)
276 | *(.fini4)
277 | *(.fini4)
278 | *(.fini3)
279 | *(.fini3)
280 | *(.fini2)
281 | *(.fini2)
282 | *(.fini1)
283 | *(.fini1)
284 | *(.fini0)
285 | .fini0 0x0000070e 0x4 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
286 | *(.fini0)
287 | 0x00000712 _etext = .
288 |
289 | .data 0x00800060 0x10 load address 0x00000712
290 | 0x00800060 PROVIDE (__data_start, .)
291 | *(.data)
292 | .data 0x00800060 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
293 | .data 0x00800060 0x10 UnipolarStepperDriver.o
294 | 0x00800060 step_table
295 | .data 0x00800070 0x0 serial.o
296 | .data 0x00800070 0x0 usi_i2c_slave.o
297 | .data 0x00800070 0x0 usi_i2c_master.o
298 | .data 0x00800070 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
299 | .data 0x00800070 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_copy_data.o)
300 | .data 0x00800070 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_clear_bss.o)
301 | .data 0x00800070 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eerd_byte_attiny2313.o)
302 | .data 0x00800070 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eewr_byte_attiny2313.o)
303 | *(.data*)
304 | *(.rodata)
305 | *(.rodata*)
306 | *(.gnu.linkonce.d*)
307 | 0x00800070 . = ALIGN (0x2)
308 | 0x00800070 _edata = .
309 | 0x00800070 PROVIDE (__data_end, .)
310 |
311 | .bss 0x00800070 0x3b
312 | 0x00800070 PROVIDE (__bss_start, .)
313 | *(.bss)
314 | .bss 0x00800070 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25/crttn2313.o
315 | .bss 0x00800070 0x4 UnipolarStepperDriver.o
316 | 0x00800070 step_count
317 | 0x00800072 step_compare
318 | .bss 0x00800074 0x1 serial.o
319 | 0x00800074 serial_buffer_pos
320 | .bss 0x00800075 0x2 usi_i2c_slave.o
321 | 0x00800075 USI_Slave_internal_address
322 | 0x00800076 USI_Slave_internal_address_set
323 | .bss 0x00800077 0x0 usi_i2c_master.o
324 | .bss 0x00800077 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_exit.o)
325 | .bss 0x00800077 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_copy_data.o)
326 | .bss 0x00800077 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/avr25\libgcc.a(_clear_bss.o)
327 | .bss 0x00800077 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eerd_byte_attiny2313.o)
328 | .bss 0x00800077 0x0 c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr25\libc.a(eewr_byte_attiny2313.o)
329 | *(.bss*)
330 | *(COMMON)
331 | COMMON 0x00800077 0xf UnipolarStepperDriver.o
332 | 0x00800077 step_mode
333 | 0x00800078 serial_i2c_buffer
334 | 0x00800080 step_enabled
335 | 0x00800081 step_max
336 | 0x00800082 step_state
337 | 0x00800083 serial_i2c_buffer_pos
338 | 0x00800084 step_dir
339 | 0x00800085 step_current
340 | COMMON 0x00800086 0x10 serial.o
341 | 0x00800086 serial_buffer
342 | COMMON 0x00800096 0x14 usi_i2c_slave.o
343 | 0x00800096 usi_i2c_slave_address
344 | 0x00800097 usi_i2c_slave_internal_address
345 | 0x00800098 USI_I2C_Slave_State
346 | 0x00800099 USI_Slave_register_buffer
347 | 0x008000a9 usi_i2c_mode
348 | COMMON 0x008000aa 0x1 usi_i2c_master.o
349 | 0x008000aa USI_I2C_Master_State
350 | 0x008000ab PROVIDE (__bss_end, .)
351 | 0x00000712 __data_load_start = LOADADDR (.data)
352 | 0x00000722 __data_load_end = (__data_load_start + SIZEOF (.data))
353 |
354 | .noinit 0x008000ab 0x0
355 | 0x008000ab PROVIDE (__noinit_start, .)
356 | *(.noinit*)
357 | 0x008000ab PROVIDE (__noinit_end, .)
358 | 0x008000ab _end = .
359 | 0x008000ab PROVIDE (__heap_start, .)
360 |
361 | .eeprom 0x00810000 0x0
362 | *(.eeprom*)
363 | 0x00810000 __eeprom_end = .
364 |
365 | .fuse
366 | *(.fuse)
367 | *(.lfuse)
368 | *(.hfuse)
369 | *(.efuse)
370 |
371 | .lock
372 | *(.lock*)
373 |
374 | .signature
375 | *(.signature*)
376 |
377 | .stab
378 | *(.stab)
379 |
380 | .stabstr
381 | *(.stabstr)
382 |
383 | .stab.excl
384 | *(.stab.excl)
385 |
386 | .stab.exclstr
387 | *(.stab.exclstr)
388 |
389 | .stab.index
390 | *(.stab.index)
391 |
392 | .stab.indexstr
393 | *(.stab.indexstr)
394 |
395 | .comment
396 | *(.comment)
397 |
398 | .debug
399 | *(.debug)
400 |
401 | .line
402 | *(.line)
403 |
404 | .debug_srcinfo
405 | *(.debug_srcinfo)
406 |
407 | .debug_sfnames
408 | *(.debug_sfnames)
409 |
410 | .debug_aranges 0x00000000 0x80
411 | *(.debug_aranges)
412 | .debug_aranges
413 | 0x00000000 0x20 UnipolarStepperDriver.o
414 | .debug_aranges
415 | 0x00000020 0x20 serial.o
416 | .debug_aranges
417 | 0x00000040 0x20 usi_i2c_slave.o
418 | .debug_aranges
419 | 0x00000060 0x20 usi_i2c_master.o
420 |
421 | .debug_pubnames
422 | 0x00000000 0x3a6
423 | *(.debug_pubnames)
424 | .debug_pubnames
425 | 0x00000000 0x147 UnipolarStepperDriver.o
426 | .debug_pubnames
427 | 0x00000147 0xe9 serial.o
428 | .debug_pubnames
429 | 0x00000230 0x109 usi_i2c_slave.o
430 | .debug_pubnames
431 | 0x00000339 0x6d usi_i2c_master.o
432 |
433 | .debug_info 0x00000000 0xa81
434 | *(.debug_info)
435 | .debug_info 0x00000000 0x32a UnipolarStepperDriver.o
436 | .debug_info 0x0000032a 0x27e serial.o
437 | .debug_info 0x000005a8 0x179 usi_i2c_slave.o
438 | .debug_info 0x00000721 0x360 usi_i2c_master.o
439 | *(.gnu.linkonce.wi.*)
440 |
441 | .debug_abbrev 0x00000000 0x540
442 | *(.debug_abbrev)
443 | .debug_abbrev 0x00000000 0x1a9 UnipolarStepperDriver.o
444 | .debug_abbrev 0x000001a9 0x1aa serial.o
445 | .debug_abbrev 0x00000353 0xb0 usi_i2c_slave.o
446 | .debug_abbrev 0x00000403 0x13d usi_i2c_master.o
447 |
448 | .debug_line 0x00000000 0xa08
449 | *(.debug_line)
450 | .debug_line 0x00000000 0x36f UnipolarStepperDriver.o
451 | .debug_line 0x0000036f 0x1cf serial.o
452 | .debug_line 0x0000053e 0x1dc usi_i2c_slave.o
453 | .debug_line 0x0000071a 0x2ee usi_i2c_master.o
454 |
455 | .debug_frame 0x00000000 0x190
456 | *(.debug_frame)
457 | .debug_frame 0x00000000 0x80 UnipolarStepperDriver.o
458 | .debug_frame 0x00000080 0xa0 serial.o
459 | .debug_frame 0x00000120 0x40 usi_i2c_slave.o
460 | .debug_frame 0x00000160 0x30 usi_i2c_master.o
461 |
462 | .debug_str 0x00000000 0x530
463 | *(.debug_str)
464 | .debug_str 0x00000000 0x207 UnipolarStepperDriver.o
465 | 0x247 (size before relaxing)
466 | .debug_str 0x00000207 0xc7 serial.o
467 | 0x19b (size before relaxing)
468 | .debug_str 0x000002ce 0x14f usi_i2c_slave.o
469 | 0x256 (size before relaxing)
470 | .debug_str 0x0000041d 0x113 usi_i2c_master.o
471 | 0x1e2 (size before relaxing)
472 |
473 | .debug_loc 0x00000000 0x2cc
474 | *(.debug_loc)
475 | .debug_loc 0x00000000 0xe1 UnipolarStepperDriver.o
476 | .debug_loc 0x000000e1 0xc6 serial.o
477 | .debug_loc 0x000001a7 0x13 usi_i2c_slave.o
478 | .debug_loc 0x000001ba 0x112 usi_i2c_master.o
479 |
480 | .debug_macinfo
481 | *(.debug_macinfo)
482 | OUTPUT(UnipolarStepperDriver.elf elf32-avr)
483 | LOAD linker stubs
484 |
485 | .debug_ranges 0x00000000 0xc8
486 | .debug_ranges 0x00000000 0x38 UnipolarStepperDriver.o
487 | .debug_ranges 0x00000038 0x90 usi_i2c_master.o
488 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/UnipolarStepperDriver.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/UnipolarStepperDriver/default/UnipolarStepperDriver.o
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/dep/UnipolarStepperDriver.o.d:
--------------------------------------------------------------------------------
1 | UnipolarStepperDriver.o: ../UnipolarStepperDriver.c \
2 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h \
13 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h \
14 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay_basic.h \
15 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/eeprom.h \
16 | c:\winavr-20100110\bin\../lib/gcc/avr/4.3.3/include/stddef.h \
17 | ../serial.h ../usi_i2c_slave.h ../usi_i2c_master.h
18 |
19 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:
20 |
21 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h:
22 |
23 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h:
24 |
25 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h:
26 |
27 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h:
28 |
29 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h:
30 |
31 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h:
32 |
33 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h:
34 |
35 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h:
36 |
37 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h:
38 |
39 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h:
40 |
41 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:
42 |
43 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay_basic.h:
44 |
45 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/eeprom.h:
46 |
47 | c:\winavr-20100110\bin\../lib/gcc/avr/4.3.3/include/stddef.h:
48 |
49 | ../serial.h:
50 |
51 | ../usi_i2c_slave.h:
52 |
53 | ../usi_i2c_master.h:
54 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/dep/serial.o.d:
--------------------------------------------------------------------------------
1 | serial.o: ../serial.c ../serial.h \
2 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h
13 |
14 | ../serial.h:
15 |
16 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:
17 |
18 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h:
19 |
20 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h:
21 |
22 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h:
23 |
24 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h:
25 |
26 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h:
27 |
28 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h:
29 |
30 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h:
31 |
32 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h:
33 |
34 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h:
35 |
36 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h:
37 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/dep/usi_i2c_master.o.d:
--------------------------------------------------------------------------------
1 | usi_i2c_master.o: ../usi_i2c_master.c ../usi_i2c_master.h \
2 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h \
13 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay_basic.h \
14 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h
15 |
16 | ../usi_i2c_master.h:
17 |
18 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:
19 |
20 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h:
21 |
22 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h:
23 |
24 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h:
25 |
26 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h:
27 |
28 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h:
29 |
30 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h:
31 |
32 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h:
33 |
34 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h:
35 |
36 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h:
37 |
38 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:
39 |
40 | c:/winavr-20100110/lib/gcc/../../avr/include/util/delay_basic.h:
41 |
42 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h:
43 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/dep/usi_i2c_slave.o.d:
--------------------------------------------------------------------------------
1 | usi_i2c_slave.o: ../usi_i2c_slave.c ../usi_i2c_slave.h \
2 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h \
3 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h \
4 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h \
5 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h \
6 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h \
7 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h \
8 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h \
9 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h \
10 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h \
11 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h \
12 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h
13 |
14 | ../usi_i2c_slave.h:
15 |
16 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:
17 |
18 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/sfr_defs.h:
19 |
20 | c:/winavr-20100110/lib/gcc/../../avr/include/inttypes.h:
21 |
22 | c:/winavr-20100110/lib/gcc/../../avr/include/stdint.h:
23 |
24 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/iotn2313.h:
25 |
26 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/portpins.h:
27 |
28 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/common.h:
29 |
30 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/version.h:
31 |
32 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/fuse.h:
33 |
34 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/lock.h:
35 |
36 | c:/winavr-20100110/lib/gcc/../../avr/include/avr/interrupt.h:
37 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/serial.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/UnipolarStepperDriver/default/serial.o
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/usi_i2c_master.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/UnipolarStepperDriver/default/usi_i2c_master.o
--------------------------------------------------------------------------------
/UnipolarStepperDriver/default/usi_i2c_slave.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalcProgrammer1/Stepper-Motor-Controller/97f808f1e3ec3d14cac693925063766bd549a7ed/UnipolarStepperDriver/default/usi_i2c_slave.o
--------------------------------------------------------------------------------
/UnipolarStepperDriver/serial.c:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------*\
2 | | RGB Fan Controller - Serial Port Code File |
3 | | This file contains the functionality of the |
4 | | buffered serial port. It uses a buffer array|
5 | | and a position value. The default buffer |
6 | | size is 64 bytes, though you can increase |
7 | | it if you need a larger buffer. |
8 | | |
9 | | Adam Honse (CalcProgrammer1), 2010 |
10 | \*---------------------------------------------*/
11 | #include "serial.h"
12 |
13 | #define SERIAL_BUFFER_LENGTH 16
14 | unsigned char serial_buffer[SERIAL_BUFFER_LENGTH]; //Serial buffer
15 | unsigned char serial_buffer_pos = 0; //Current use of buffer
16 |
17 | //USART Receive interrupt pushes the incoming byte into the buffer
18 | ISR(USART_RX_vect)
19 | {
20 | serial_buffer[serial_buffer_pos] = UDR;
21 |
22 | if(++serial_buffer_pos > SERIAL_BUFFER_LENGTH)
23 | {
24 | serial_buffer_pos = 0;
25 | }
26 | }
27 |
28 | unsigned char serial_available()
29 | {
30 | return serial_buffer_pos;
31 | }
32 |
33 | void serial_init(unsigned int baud)
34 | {
35 | //Set baud rate
36 | UBRRH = (unsigned char) (baud >> 8);
37 | UBRRL = (unsigned char) (baud);
38 |
39 | //Set frame format: 8 data, no parity, 2 stop bits
40 | UCSRC = (0< 0)
71 | {
72 | data[i] = serial_read();
73 | }
74 | else
75 | {
76 | return i;
77 | }
78 | }
79 | return i;
80 | }
81 |
82 | //Deletes all items in the buffer
83 | void serial_flush()
84 | {
85 | serial_buffer_pos = 0;
86 | }
87 |
88 | void serial_transmit_byte(char data)
89 | {
90 | //Wait for empty transmit buffer
91 | while(!(UCSRA & (1<
15 | #include
16 |
17 | // Serial_Init
18 | // Initializes the serial port
19 | // Takes an AVR USART speed (see the ATMega168 datasheet)
20 | void serial_init(unsigned int baud);
21 |
22 | // Serial_Transmit
23 | // Transmits a single byte of data
24 | void serial_transmit_byte(char data);
25 |
26 | // Serial_Available
27 | // Returns number of available bytes in buffer
28 | unsigned char serial_available();
29 |
30 | // Serial_Read
31 | // Buffered read on Serial
32 | // Pulls the first byte from the serial port buffer and deletes it
33 | unsigned char serial_read();
34 |
35 | // Serial_Flush
36 | // Flush the Serial buffer
37 | // Deletes any data currently in the read buffer
38 | void serial_flush();
39 |
40 | // Serial Print
41 | // Prints a string
42 | void serial_print(char * text);
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/unipolarstepperdriver.aws:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/usi_i2c_master.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------*\
2 | | USI I2C Slave Master |
3 | | |
4 | | This library provides a robust I2C master protocol |
5 | | implementation on top of Atmel's Universal Serial |
6 | | Interface (USI) found in many ATTiny microcontrollers.|
7 | | |
8 | | Adam Honse (GitHub: CalcProgrammer1) - 7/29/2012 |
9 | | -calcprogrammer1@gmail.com |
10 | \*-----------------------------------------------------*/
11 |
12 | #include "usi_i2c_master.h"
13 | #include
14 | ///////////////////////////////////////////////////////////////////////////////
15 | ////USI Master Macros//////////////////////////////////////////////////////////
16 | ///////////////////////////////////////////////////////////////////////////////
17 |
18 | #define USISR_TRANSFER_8_BIT 0b11110000 | (0x00<
15 | #include
16 |
17 | //I2C Bus Specification v2.1 FAST mode timing limits
18 | #ifdef I2C_FAST_MODE
19 | #define I2C_TLOW 1.3
20 | #define I2C_THIGH 0.6
21 |
22 | //I2C Bus Specification v2.1 STANDARD mode timing limits
23 | #else
24 | #define I2C_TLOW 4.7
25 | #define I2C_THIGH 4.0
26 | #endif
27 |
28 | //Microcontroller Dependent Definitions
29 | #if defined (__AVR_ATtiny24__) | \
30 | defined (__AVR_ATtiny44__) | \
31 | defined (__AVR_ATtiny84__)
32 | #define DDR_USI DDRA
33 | #define PORT_USI PORTA
34 | #define PIN_USI PINA
35 | #define PORT_USI_SDA PA6
36 | #define PORT_USI_SCL PA4
37 | #define PIN_USI_SDA PINA6
38 | #define PIN_USI_SCL PINA4
39 | #endif
40 |
41 | #if defined(__AVR_AT90Tiny2313__) | \
42 | defined(__AVR_ATtiny2313__)
43 | #define DDR_USI DDRB
44 | #define PORT_USI PORTB
45 | #define PIN_USI PINB
46 | #define PORT_USI_SDA PB5
47 | #define PORT_USI_SCL PB7
48 | #define PIN_USI_SDA PINB5
49 | #define PIN_USI_SCL PINB7
50 | #endif
51 |
52 | //USI I2C Master Transceiver Start
53 | // Starts the transceiver to send or receive data based on the r/w bit
54 | char USI_I2C_Master_Transceiver_Start(char *msg, char msg_size);
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/usi_i2c_slave.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------*\
2 | | USI I2C Slave Driver |
3 | | |
4 | | This library provides a robust, interrupt-driven I2C |
5 | | slave implementation built on the ATTiny Universal |
6 | | Serial Interface (USI) hardware. Slave operation is |
7 | | implemented as a register bank, where each 'register' |
8 | | is a pointer to an 8-bit variable in the main code. |
9 | | This was chosen to make I2C integration transparent |
10 | | to the mainline code and making I2C reads simple. |
11 | | This library also works well with the Linux I2C-Tools |
12 | | utilities i2cdetect, i2cget, i2cset, and i2cdump. |
13 | | |
14 | | Adam Honse (GitHub: CalcProgrammer1) - 7/29/2012 |
15 | | -calcprogrammer1@gmail.com |
16 | \*-----------------------------------------------------*/
17 |
18 | #include "usi_i2c_slave.h"
19 |
20 | char usi_i2c_slave_internal_address;
21 | char usi_i2c_slave_address;
22 | char usi_i2c_mode;
23 |
24 | ///////////////////////////////////////////////////////////////////////////////////////////////////
25 | ////USI Slave States///////////////////////////////////////////////////////////////////////////////
26 | ///////////////////////////////////////////////////////////////////////////////////////////////////
27 |
28 | #define USI_SLAVE_REGISTER_COUNT 8
29 |
30 | // The I2C register file is stored as an array of pointers, point these to whatever your I2C registers
31 | // need to read/write in your code. This abstracts the buffer and makes it easier to write directly
32 | // to values in your code.
33 | char* USI_Slave_register_buffer[USI_SLAVE_REGISTER_COUNT];
34 | char USI_Slave_internal_address = 0;
35 | char USI_Slave_internal_address_set = 0;
36 |
37 | enum
38 | {
39 | USI_SLAVE_CHECK_ADDRESS,
40 | USI_SLAVE_SEND_DATA,
41 | USI_SLAVE_SEND_DATA_ACK_WAIT,
42 | USI_SLAVE_SEND_DATA_ACK_CHECK,
43 | USI_SLAVE_RECV_DATA_WAIT,
44 | USI_SLAVE_RECV_DATA_ACK_SEND
45 | } USI_I2C_Slave_State;
46 |
47 | /////////////////////////////////////////////////
48 | ////USI Register Setup Values////////////////////
49 | /////////////////////////////////////////////////
50 |
51 | #define USI_SLAVE_COUNT_ACK_USISR 0b01110000 | (0x0E << USICNT0) //Counts one clock (ACK)
52 | #define USI_SLAVE_COUNT_BYTE_USISR 0b01110000 | (0x00 << USICNT0) //Counts 8 clocks (BYTE)
53 | #define USI_SLAVE_CLEAR_START_USISR 0b11110000 | (0x00 << USICNT0) //Clears START flag
54 | #define USI_SLAVE_SET_START_COND_USISR 0b01110000 | (0x00 << USICNT0)
55 | #define USI_SLAVE_SET_START_COND_USICR 0b10101000
56 | #define USI_SLAVE_STOP_DID_OCCUR_USICR 0b10111000
57 | #define USI_SLAVE_STOP_NOT_OCCUR_USICR 0b11101000
58 |
59 | /////////////////////////////////////////////////
60 | ////USI Direction Macros/////////////////////////
61 | /////////////////////////////////////////////////
62 |
63 | #define USI_SET_SDA_OUTPUT() { DDR_USI |= (1 << PORT_USI_SDA); }
64 | #define USI_SET_SDA_INPUT() { DDR_USI &= ~(1 << PORT_USI_SDA); }
65 |
66 | #define USI_SET_SCL_OUTPUT() { DDR_USI |= (1 << PORT_USI_SCL); }
67 | #define USI_SET_SCL_INPUT() { DDR_USI &= ~(1 << PORT_USI_SCL); }
68 |
69 | #define USI_SET_BOTH_OUTPUT() { DDR_USI |= (1 << PORT_USI_SDA) | (1 << PORT_USI_SCL); }
70 | #define USI_SET_BOTH_INPUT() { DDR_USI &= ~((1 << PORT_USI_SDA) | (1 << PORT_USI_SCL)); }
71 |
72 | ////////////////////////////////////////////////////////////////////////////////////////////////////
73 |
74 | void USI_I2C_Init(char address)
75 | {
76 | PORT_USI &= ~(1 << PORT_USI_SCL);
77 | PORT_USI &= ~(1 << PORT_USI_SDA);
78 |
79 | usi_i2c_slave_address = address;
80 |
81 | USI_SET_BOTH_INPUT();
82 |
83 | USICR = (1 << USISIE) | (0 << USIOIE) | (1 << USIWM1) | (0 << USIWM0) | (1 << USICS1) | (0 << USICS0) | (0 << USICLK) | (0 << USITC);
84 | USISR = (1 << USISIF) | (1 << USIOIF) | (1 << USIPF) | (1 << USIDC);
85 | }
86 |
87 | /////////////////////////////////////////////////////////////////////////////////
88 | // ISR USI_START_vect - USI Start Condition Detector Interrupt //
89 | // //
90 | // This interrupt occurs when the USI Start Condition Detector detects a //
91 | // start condition. A start condition marks the beginning of an I2C //
92 | // transmission and occurs when SDA has a high->low transition followed by an //
93 | // SCL high->low transition. When a start condition occurs, the I2C slave //
94 | // state is set to check address mode and the counter is set to wait 8 clocks //
95 | // (enough for the address/rw byte to be transmitted) before overflowing and //
96 | // triggering the first state table interrupt. If a stop condition occurs, //
97 | // reset the start condition detector to detect the next start condition. //
98 | /////////////////////////////////////////////////////////////////////////////////
99 |
100 | ISR(USI_START_vect)
101 | {
102 | USI_I2C_Slave_State = USI_SLAVE_CHECK_ADDRESS;
103 |
104 | USI_SET_SDA_INPUT();
105 |
106 | // wait for SCL to go low to ensure the Start Condition has completed (the
107 | // start detector will hold SCL low ) - if a Stop Condition arises then leave
108 | // the interrupt to prevent waiting forever - don't use USISR to test for Stop
109 | // Condition as in Application Note AVR312 because the Stop Condition Flag is
110 | // going to be set from the last TWI sequence
111 | while((PIN_USI & (1 << PIN_USI_SCL)) && !((PIN_USI & (1 << PIN_USI_SDA))));
112 |
113 | if(!(PIN_USI & (1 << PIN_USI_SDA)))
114 | {
115 | // a Stop Condition did not occur
116 | USICR = USI_SLAVE_STOP_NOT_OCCUR_USICR;
117 | }
118 | else
119 | {
120 | // a Stop Condition did occur
121 | USICR = USI_SLAVE_STOP_DID_OCCUR_USICR;
122 | }
123 |
124 | USISR = USI_SLAVE_CLEAR_START_USISR;
125 | }
126 |
127 | /////////////////////////////////////////////////////////////////////////////////
128 | // ISR USI_OVERFLOW_vect - USI Overflow Interrupt //
129 | // //
130 | // This interrupt occurs when the USI counter overflows. By setting this //
131 | // counter to 8, the USI can be commanded to wait one byte length before //
132 | // causing another interrupt (and thus state change). To wait for an ACK, //
133 | // set the counter to 1 (actually -1, or 0x0E) it will wait one clock. //
134 | // This is used to set up a state table of I2C transmission states that fits //
135 | // the I2C protocol for proper transmission. //
136 | /////////////////////////////////////////////////////////////////////////////////
137 |
138 | ISR(USI_OVERFLOW_vect)
139 | {
140 | switch (USI_I2C_Slave_State)
141 | {
142 | /////////////////////////////////////////////////////////////////////////
143 | // Case USI_SLAVE_CHECK_ADDRESS //
144 | // //
145 | // The first state after the start condition, this state checks the //
146 | // received byte against the stored slave address as well as the //
147 | // global transmission address of 0x00. If there is a match, the R/W //
148 | // bit is checked to branch either to sending or receiving modes. //
149 | // If the address was not for this device, the USI system is //
150 | // re-initialized for start condition. //
151 | /////////////////////////////////////////////////////////////////////////
152 | case USI_SLAVE_CHECK_ADDRESS:
153 |
154 | if((USIDR == 0) || ((USIDR >> 1) == usi_i2c_slave_address))
155 | {
156 | if (USIDR & 0x01)
157 | {
158 | USI_I2C_Slave_State = USI_SLAVE_SEND_DATA;
159 | }
160 | else
161 | {
162 | USI_Slave_internal_address_set = 0;
163 | USI_I2C_Slave_State = USI_SLAVE_RECV_DATA_WAIT;
164 | }
165 |
166 | //Set USI to send ACK
167 | USIDR = 0;
168 | USI_SET_SDA_OUTPUT();
169 | USISR = USI_SLAVE_COUNT_ACK_USISR;
170 | }
171 | else
172 | {
173 | //Set USI to Start Condition Mode
174 | USICR = USI_SLAVE_SET_START_COND_USICR;
175 | USISR = USI_SLAVE_SET_START_COND_USISR;
176 | }
177 | break;
178 |
179 | /////////////////////////////////////////////////////////////////////////
180 | // Case USI_SLAVE_SEND_DATA_ACK_WAIT //
181 | // //
182 | // Wait 1 clock period for the master to ACK or NACK the sent data //
183 | // If master NACK's, it means that master doesn't want any more data. //
184 | /////////////////////////////////////////////////////////////////////////
185 | case USI_SLAVE_SEND_DATA_ACK_WAIT:
186 |
187 | //After sending, immediately shut off PORT = 1 to prevent driving
188 | //the line high (I2C should *NEVER* drive high, and could damage
189 | //connected devices if operating at different voltage levels)
190 | PORT_USI &= ~(1 << PORT_USI_SDA);
191 |
192 | USI_I2C_Slave_State = USI_SLAVE_SEND_DATA_ACK_CHECK;
193 | USI_SET_SDA_INPUT();
194 | USISR = USI_SLAVE_COUNT_ACK_USISR;
195 | break;
196 |
197 | /////////////////////////////////////////////////////////////////////////
198 | // Case USI_SLAVE_SEND_DATA_ACK_CHECK //
199 | // //
200 | // Check USIDR to see if master sent ACK or NACK. If NACK, set up //
201 | // a reset to START conditions, if ACK, fall through into SEND_DATA //
202 | // to continue sending data. //
203 | /////////////////////////////////////////////////////////////////////////
204 | case USI_SLAVE_SEND_DATA_ACK_CHECK:
205 |
206 | if(USIDR)
207 | {
208 | //The master sent a NACK, indicating that it will not accept
209 | //more data. Reset into START condition state
210 | USICR = USI_SLAVE_SET_START_COND_USICR;
211 | USISR = USI_SLAVE_SET_START_COND_USISR;
212 | return;
213 | }
214 | //else: fall through into SEND_DATA
215 |
216 | /////////////////////////////////////////////////////////////////////////
217 | // Case USI_SLAVE_SEND_DATA //
218 | // //
219 | // Set USIDR to the data to be sent, then set up SDA registers to //
220 | // enable data transmission in the next 8 clocks. Set to wait 8 //
221 | // clocks and proceed to wait for ACK. //
222 | /////////////////////////////////////////////////////////////////////////
223 | case USI_SLAVE_SEND_DATA:
224 |
225 | if(USI_Slave_internal_address <= USI_SLAVE_REGISTER_COUNT)
226 | {
227 | USIDR = *(USI_Slave_register_buffer[USI_Slave_internal_address]);
228 | }
229 | else
230 | {
231 | USIDR = 0x00;
232 | }
233 | USI_Slave_internal_address++;
234 |
235 | USI_I2C_Slave_State = USI_SLAVE_SEND_DATA_ACK_WAIT;
236 |
237 | //To send data, DDR for SDA must be 1 (Output) and PORT for SDA
238 | //must also be 1 (line drives low on USIDR MSB = 0 or PORT = 0)
239 | USI_SET_SDA_OUTPUT();
240 | PORT_USI |= (1 << PORT_USI_SDA);
241 | USISR = USI_SLAVE_COUNT_BYTE_USISR;
242 | break;
243 |
244 | /////////////////////////////////////////////////////////////////////////
245 | // Case USI_SLAVE_RECV_DATA_WAIT //
246 | // //
247 | // Prepares to wait 8 clocks to receive a data byte from the master. //
248 | /////////////////////////////////////////////////////////////////////////
249 | case USI_SLAVE_RECV_DATA_WAIT:
250 |
251 | USI_I2C_Slave_State = USI_SLAVE_RECV_DATA_ACK_SEND;
252 |
253 | USI_SET_SDA_INPUT();
254 | USISR = USI_SLAVE_COUNT_BYTE_USISR;
255 | break;
256 |
257 | /////////////////////////////////////////////////////////////////////////
258 | // Case USI_SLAVE_RECV_DATA_ACK_SEND //
259 | // //
260 | // After waiting for the master to finish transmission, this reads //
261 | // USIDR into either the i2c buffer or internal address, then sends //
262 | // an acknowledgement to the master. //
263 | /////////////////////////////////////////////////////////////////////////
264 | case USI_SLAVE_RECV_DATA_ACK_SEND:
265 |
266 | USI_I2C_Slave_State = USI_SLAVE_RECV_DATA_WAIT;
267 |
268 | if(USI_Slave_internal_address_set == 0)
269 | {
270 | USI_Slave_internal_address = USIDR;
271 | USI_Slave_internal_address_set = 1;
272 | }
273 | else if(USI_Slave_internal_address <= USI_SLAVE_REGISTER_COUNT)
274 | {
275 | *(USI_Slave_register_buffer[USI_Slave_internal_address]) = USIDR;
276 | }
277 |
278 | USIDR = 0;
279 | USI_SET_SDA_OUTPUT();
280 | USISR = USI_SLAVE_COUNT_ACK_USISR;
281 | break;
282 | }
283 | }
284 |
--------------------------------------------------------------------------------
/UnipolarStepperDriver/usi_i2c_slave.h:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------*\
2 | | USI I2C Slave Driver |
3 | | |
4 | | This library provides a robust, interrupt-driven I2C |
5 | | slave implementation built on the ATTiny Universal |
6 | | Serial Interface (USI) hardware. Slave operation is |
7 | | implemented as a register bank, where each 'register' |
8 | | is a pointer to an 8-bit variable in the main code. |
9 | | This was chosen to make I2C integration transparent |
10 | | to the mainline code and making I2C reads simple. |
11 | | This library also works well with the Linux I2C-Tools |
12 | | utilities i2cdetect, i2cget, i2cset, and i2cdump. |
13 | | |
14 | | Adam Honse (GitHub: CalcProgrammer1) - 7/29/2012 |
15 | | -calcprogrammer1@gmail.com |
16 | \*-----------------------------------------------------*/
17 | #ifndef USI_I2C_SLAVE_H
18 | #define USI_I2C_SLAVE_H
19 |
20 | #include
21 | #include
22 |
23 | //Microcontroller Dependent Definitions
24 | #if defined (__AVR_ATtiny24__) | \
25 | defined (__AVR_ATtiny44__) | \
26 | defined (__AVR_ATtiny84__)
27 | #define DDR_USI DDRA
28 | #define PORT_USI PORTA
29 | #define PIN_USI PINA
30 | #define PORT_USI_SDA PA6
31 | #define PORT_USI_SCL PA4
32 | #define PIN_USI_SDA PINA6
33 | #define PIN_USI_SCL PINA4
34 | #endif
35 |
36 | #if defined(__AVR_AT90Tiny2313__) | \
37 | defined(__AVR_ATtiny2313__)
38 | #define DDR_USI DDRB
39 | #define PORT_USI PORTB
40 | #define PIN_USI PINB
41 | #define PORT_USI_SDA PB5
42 | #define PORT_USI_SCL PB7
43 | #define PIN_USI_SDA PINB5
44 | #define PIN_USI_SCL PINB7
45 | #endif
46 |
47 | //USI I2C Initialize
48 | // address - If slave, this parameter is the slave address
49 | void USI_I2C_Init(char address);
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------