Dheeraj M Pai
/
October_22_1_28AM
Partially made code for adf7023
Revision 2:599022fe2f99, committed 2016-03-17
- Comitter:
- dheerajmpai23
- Date:
- Thu Mar 17 11:35:11 2016 +0000
- Parent:
- 1:434b2062426b
- Commit message:
- ADF_TEST_CODE;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Oct 21 20:26:08 2015 +0000 +++ b/main.cpp Thu Mar 17 11:35:11 2016 +0000 @@ -7,7 +7,8 @@ #include <bitset> #define ENDL "\r" << endl; -#define MISO_PIN PTA17 +//#define MISO_PIN PTA17 +#define MISO_PIN PTE3 #define THRS 20 #define STATE_ERR_THRS 20 #define PHY_OFF_EXEC_TIME 300 @@ -16,14 +17,14 @@ /******DEFINING OMMANDS*********/ #define CMD_HW_RESET 0xC8 -SPI adf(PTA16, MISO_PIN, PTA15); +SPI adf(PTE1, MISO_PIN, PTE2); //MOSI, MISO, CLOCK -DigitalOut CS(D10); +DigitalOut CS(PTA15); //DigitalOut CS(PTD4);//D10==PTD4 Serial PC(USBTX, USBRX); DigitalOut ledr(LED1); DigitalOut led2(LED2); -InterruptIn IRQ(D8); +InterruptIn IRQ(PTA14); //InterruptIn IRQ(PTA13);//D8==PTA13 Ticker ticker; //Timer t; @@ -59,13 +60,13 @@ CS=0; adf.write(0x19); adf.write(0x00); - adf.write(0x60); - adf.write(0x00); + adf.write(0x60); //INterrupt Mask + adf.write(0x00); //Address 0x101 adf.write(0x00); adf.write(0x00); adf.write(0x00); - adf.write(0x00); + adf.write(0x00); //105 adf.write(0x00); adf.write(0x33); @@ -75,70 +76,70 @@ adf.write(0xC2); adf.write(0x10); adf.write(0xC0); - adf.write(0x00); + adf.write(0x00);//10D adf.write(0x30); adf.write(0x31); adf.write(0x07); - adf.write(0x00); + adf.write(0x00);//111 adf.write(0x01); adf.write(0x00); adf.write(0x7F); - adf.write(0x00); + adf.write(0x00);//115 adf.write(0x0B); adf.write(0x37); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//119 adf.write(0x40); adf.write(0x0C); adf.write(0x00); - adf.write(0x05); + adf.write(0x05);//11D adf.write(0x00); adf.write(0x00); adf.write(0x18); - adf.write(0x12); + adf.write(0x12);//121 adf.write(0x34); adf.write(0x56); adf.write(0x10); - adf.write(0x10); + adf.write(0x10);//125 adf.write(0xC4); // Different adf.write(0x14); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//129 adf.write(0x00); adf.write(0x00); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//12D adf.write(0x00); adf.write(0x00); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//131 adf.write(0x00); adf.write(0x00); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//135 adf.write(0x00); adf.write(0x00); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//139 adf.write(0x04); adf.write(0x00); adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//13D adf.write(0x00); - adf.write(0x00); + adf.write(0x00);//13F CS=1; wait(1); @@ -158,19 +159,19 @@ CS=0; adf.write(0x08); // TRANSMIT_DATA LENGTH adf.write(0x14); - adf.write(0xFF); + adf.write(0x0F); CS=1; wait_ms(2); CS=0; adf.write(0x08); // TRANSMIT_DATA LENGTH adf.write(0x15); - adf.write(0xFF); + adf.write(0x0F); CS=1; wait_ms(2); CS=0; adf.write(0x09); - adf.write(0x24); // TX_BASE ADDRESS 0x20(starting Tx Byte) + adf.write(0x24); // TX_BASE ADDRESS 0x20(starting Tx Byte) 0x124 is the reg that stores the starting point adf.write(0x20); CS=1; wait_ms(2);