From da06b7f9f0f529024f35d423e1b4d1d2e563fa1e Mon Sep 17 00:00:00 2001 From: Atsushi Saitoh Date: Sun, 1 Apr 2012 20:05:00 +0900 Subject: added boot loader for LPC1114FN28/102 (28pin DIP) --- .DS_Store | Bin 12292 -> 12292 bytes Bootloader_DIP28_.axf | Bin 0 -> 74067 bytes Bootloader_DIP28_.hex | 126 ++++++++++++++++++++++++++++++++++ Release/eXodusino_Release_mem.ld | 6 +- Release/exodusino.axf | Bin 57872 -> 57904 bytes Release/exodusino.map | 2 + Release/exodusino_sample1_DIP_28_.bin | Bin 0 -> 13724 bytes src/.DS_Store | Bin 6148 -> 6148 bytes src/user_application.cpp | 122 ++------------------------------ 9 files changed, 138 insertions(+), 118 deletions(-) create mode 100755 Bootloader_DIP28_.axf create mode 100755 Bootloader_DIP28_.hex create mode 100755 Release/exodusino_sample1_DIP_28_.bin diff --git a/.DS_Store b/.DS_Store index 134b915..8e96b22 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Bootloader_DIP28_.axf b/Bootloader_DIP28_.axf new file mode 100755 index 0000000..8b85cfb Binary files /dev/null and b/Bootloader_DIP28_.axf differ diff --git a/Bootloader_DIP28_.hex b/Bootloader_DIP28_.hex new file mode 100755 index 0000000..29b1c39 --- /dev/null +++ b/Bootloader_DIP28_.hex @@ -0,0 +1,126 @@ +:10000000D00F0010850100001D040000290400002D +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000003504000097 +:100030000000000000000000410400004D0400002A +:10004000590400005904000059040000590400003C +:10005000590400005904000059040000590400002C +:10006000590400005904000059040000590400001C +:100070005904000059040000590400006504000000 +:10008000710400007D040000890400009504000054 +:10009000A1040000AD040000B9040000C504000084 +:1000A000D1040000DD040000E9040000F5040000B4 +:1000B000010500000D0500001905000025050000E0 +:1000C00000B5031C89B00C20994208D33222019359 +:1000D00002916846009205A9024B9847059809B01D +:1000E00000BDC046F11FFF1F00B589B03323009348 +:1000F000084B0291FA21019089001868039200F0E0 +:10010000C9FA05A90490044B68469847059809B0B8 +:1001100000BDC04604000010F11FFF1F00B5031C06 +:1001200089B00C2099420FD30193084B0291FA2118 +:10013000342218688900009200F0ACFA05A90390F7 +:10014000034B68469847059809B000BD04000010AD +:10015000F11FFF1F10B588B01C1C382300930190BD +:1001600002916846039205A9054B984705980A280D +:1001700003D1002C01D0069B236008B010BDC046FF +:10018000F11FFF1F08B50B4A0B4B03E0117801323A +:100190001970013309498B42F8D3094B02E0002260 +:1001A0001A700133074A9342F9D300F02DFA00F098 +:1001B00069FAFEE7B0070000000000100800001018 +:1001C000080000100800001010B5031C00200FE00C +:1001D0001A78013312025040082204B24000002C69 +:1001E00001DA064C6040013AD2B280B2002AF4D162 +:1001F000013909B20029EBDA10BDC0462110000018 +:1002000000B5034A034BDA60BFF34F8FFEE7C046E9 +:100210000400FA0500ED00E070B5051C061E1DD0B7 +:1002200001200721FFF74CFF0025A84216D10C4CF6 +:1002300080222068311C5200FFF756FFA8420DD1E2 +:1002400080222068311C52002B1CFFF783FFA8423C +:1002500004D1236801350133FF332360281C70BDAE +:100260000000001070B5454C4549A5445F228CA89C +:1002700000F00CFA7822ADAB1A80ACAB093A1A80C8 +:100280004049523AA4A800F001FA9620800100F0FB +:100290004FF901200721FFF713FF002869D1013032 +:1002A0000721FFF73BFF002863D18CA85F2100F0F6 +:1002B0009BF9354C6C44201C00F088F90028F8D0DC +:1002C000227801AB1A70012400251CE0337801A8C4 +:1002D0000355802301345B0000259C4213D1FFF7B6 +:1002E0009BFFA84201D1ADA800E0ACA8022100F01C +:1002F0007BF9002301AA0024D45480220133520048 +:100300009342F7D1251C204E6E44301C00F05EF95C +:100310000028DBD11D4B01359D42F4DD01A8FFF71C +:100320007BFF002801D1ADA800E0ACA8022100F0BD +:100330005BF9802040011649FFF746FFFE234CAAD7 +:10034000DB0102CB02C2802109028B42F9D18B90E2 +:100350000720011CFFF7B4FE002806D1FE308022E2 +:10036000C0014CA95200FFF7BFFEA4A81D2100F058 +:100370003BF9AE239B009D4470BDC04648FDFFFF86 +:100380003407000093070000B7020000FEFF0F00D3 +:10039000FC6F000037B5A0228023D2051B02D15884 +:1003A0000220184C8143D1502288174B9A4217D013 +:1003B0007E3040011549FFF707FF238883420FD1A4 +:1003C0001BE000246D460735281C00F0FFF80028CC +:1003D000F7D10F4B01349C42F4DD2B787A2B04D1FA +:1003E000FFF740FFFFF70CFF05E00A48006885466D +:1003F00009480068874600203EBD9620800100F035 +:1004000097F8DEE7FC7F0000FFFF0000FC6F0000B4 +:10041000FEFF0F00001000000410000001480068FB +:100420008746000008100000014800688746000069 +:100430000C10000001480068874600002C100000E6 +:100440000148006887460000381000000148006835 +:10045000874600003C100000014800688746000005 +:100460004010000001480068874600007C10000032 +:1004700001480068874600008010000001480068BD +:10048000874600008410000001480068874600008D +:100490008810000001480068874600008C100000AA +:1004A000014800688746000090100000014800687D +:1004B000874600009410000001480068874600004D +:1004C0009810000001480068874600009C1000005A +:1004D0000148006887460000A0100000014800683D +:1004E00087460000A410000001480068874600000D +:1004F000A81000000148006887460000AC1000000A +:100500000148006887460000B010000001480068FC +:1005100087460000B41000000148006887460000CC +:10052000B81000000148006887460000BC100000B9 +:10053000F8B5214B80229203DA67204B07251A6811 +:10054000071CAA431A6019680122114319605968EF +:100550001B4CA9435960596811435960194B8021BC +:10056000D86F49010143D96794331A608232E2603F +:100570001E68983B996F144B186800F08BF8311C7B +:1005800000F088F8391C000900F084F8030A636061 +:10059000FF231840FC3B2060E360A560636962694B +:1005A00060231340602BFAD101E0054B1B6863699F +:1005B000DA07FAD4F8BDC04604E100E0A4400440E4 +:1005C00000800040048004400400001010B5054A7B +:1005D000041C51690123081C184002D01268181C21 +:1005E000227010BD0080004010B507E00278054B76 +:1005F0001A605A695406FCD5013001390029F5D139 +:1006000010BDC0460080004010B51C4B8E229200E9 +:10061000995820208143995000221A62C046013225 +:10062000C82AFBD10021C73A19645A6459645A6434 +:10063000596C124AC807FBD5232191606B318900A0 +:1006400050588024A0435050D86801210B4A0842DA +:10065000FAD0032010670338516750675167596F0C +:1006600001221142FBD0054B05499A670433D96733 +:1006700090331A605A609A6010BDC04600800440F2 +:10068000FFFF010008B5FFF785FE08BD08B500F0C3 +:100690003BF808BD002931D00122D207030901E04F +:1006A000090112099942FBD9430801E049005208A7 +:1006B0009942FBD900E04908401A07D35241FAD3C6 +:1006C00001461046704749084018F7D29218FAD3ED +:1006D0004018014610467047CB0F00D04942021027 +:1006E00000D54042534008B5FFF7D4FF0CBC521070 +:1006F00000D34042002A00D549421847F446002062 +:1007000000F001F8604770478446830708D18B07E3 +:1007100006D1131F04D304C904C0043BFBD21A1D25 +:10072000524205D0891A801A8B5C83540132FBD166 +:100730006046704757656C636F6D6520746F206508 +:10074000586F647573696E6F210D0A687474703A1E +:100750002F2F656372616674732E672E68617465EE +:100760006E612E6E652E6A702F4C796E782D4579EC +:1007700045442F0D0A65586F64757320426F6F747E +:100780006C6F616465722053746172742E2E2E2E0C +:100790000D0A000D0A50726F6772616D20656E64FC +:1007A0002E205265626F6F74696E672E2E2E2E009A +:0807B00000100000006CDC02E7 +:040000030000018573 +:00000001FF diff --git a/Release/eXodusino_Release_mem.ld b/Release/eXodusino_Release_mem.ld index ac46572..8b14c4d 100755 --- a/Release/eXodusino_Release_mem.ld +++ b/Release/eXodusino_Release_mem.ld @@ -5,8 +5,10 @@ MEMORY { /* Define each memory region */ MFlash32 (rx) : ORIGIN = 0x1000, LENGTH = 0x7000 /* 28k */ - RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x1FE0 /* 8k less 32 bytes used for IAP */ + RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x1FE0 /* 8k less 32 bytes used for IAP(LPC1114/301) */ + //RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x0FE0 /* 8k less 32 bytes used for IAP(LPC1114FN28/102) */ } /* Define a symbol for the top of each memory region */ __top_MFlash32 = 0x1000 + 0x7000; - __top_RamLoc8 = 0x10000000 + 0x1FE0; + __top_RamLoc8 = 0x10000000 + 0x1FE0; /* LPC1114/301 */ + //__top_RamLoc8 = 0x10000000 + 0x0FE0; /* LPC1114FN28/102 */ diff --git a/Release/exodusino.axf b/Release/exodusino.axf index bd5e5de..7fb58db 100755 Binary files a/Release/exodusino.axf and b/Release/exodusino.axf differ diff --git a/Release/exodusino.map b/Release/exodusino.map index 164c31b..153de52 100755 --- a/Release/exodusino.map +++ b/Release/exodusino.map @@ -1715,6 +1715,7 @@ Memory Configuration Name Origin Length Attributes MFlash32 0x00001000 0x00007000 xr RamLoc8 0x10000000 0x00001fe0 xrw +//RamLoc8 0x10000000 0x00000fe0 xrw *default* 0x00000000 0xffffffff Linker script and memory map @@ -1756,6 +1757,7 @@ LOAD c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4 END GROUP 0x00008000 __top_MFlash32 = 0x8000 0x10001fe0 __top_RamLoc8 = 0x10001fe0 + 0x10000fe0 //__top_RamLoc8 = 0x10000fe0 .text 0x00001000 0x377c FILL mask 0xff diff --git a/Release/exodusino_sample1_DIP_28_.bin b/Release/exodusino_sample1_DIP_28_.bin new file mode 100755 index 0000000..e8b8fca Binary files /dev/null and b/Release/exodusino_sample1_DIP_28_.bin differ diff --git a/src/.DS_Store b/src/.DS_Store index 842f62f..75f221b 100755 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/user_application.cpp b/src/user_application.cpp index d2a4cda..9104559 100755 --- a/src/user_application.cpp +++ b/src/user_application.cpp @@ -1,125 +1,15 @@ #include -#include -#include - -#define LRCLK 6 // LRCLK(BU9480F) -> D6(eXodusino) -#define AudioBufRow 256 // length of proc_r -volatile uint16_t empty_c = 0; // Column -volatile uint16_t proc_r = 0; // Row -uint16_t AudioBuf[2][AudioBufRow]; //AudioBuf[empty_c][proc_r] -bool dac_semp; // オーディオバッファ書き込み完了フラグ true:完了, false:まだ - - -uint16_t br; -FRESULT rc; - -void readSound(void) -{ - volatile int16_t i=0,j=0; - while(1){ - if(i != empty_c) - { - if(j >= AudioBufRow - 1) - { - i = empty_c; // DACが使用してない(使い終わった)バッファを選択 - j = 0; - } - } - - if (j < AudioBufRow - 1) - { - rc = pf_read(AudioBuf[i], sizeof(uint16_t)*256, &br); // Read a chunk of file - if (rc || !br)break; - - j = j + 256; - - } - if(j >= AudioBufRow - 1) - { // 音声バッファは満タン?(DACがリードしてもOK?) - dac_semp = true; - } - } -} - - -void playSound(void) -{ - static uint16_t i,j; // AudioBuf[j][i] - uint16_t k; - if(i >= AudioBufRow - 1) - { - if(dac_semp) // empty_cカラムは書き込み完了?(=true?) - { - i = 0; - empty_c =(empty_c == 1)?0:1; // DACが使い終えたバッファをempty_cとする - j = (empty_c == 1)?0:1; // decode()関数がデータを貯めているバッファに切り替え - dac_semp = false; // empty_cは空なのでfalse - - }else - { // 書き込み完了してない? - return; - } - } - //DACへデータ送信 - k =(AudioBuf[j][i++]); - digitalWrite(LRCLK,HIGH); - SPI1.transfer(k); - - k =(AudioBuf[j][i++]); - digitalWrite(LRCLK,LOW); - SPI1.transfer(k); - - return; -} void setup() { - // XBeeの初期化 - Serial.begin(9600); - - //BU9480Fの初期化 - pinMode(LRCLK,OUTPUT); - SPI1.setBitLength(16); - SPI1.setClockDivider(SPI_CLOCK_DIV2); - SPI1.begin(); - - // SDCard初期化のtry&catch - if (!SDFile.begin()) - { - Serial.println("Cannot detect SDCard") ; - return ; - } - - Serial.println("card initialized.") ; - rc = SDFile.open("test.wav") ; - - if (rc) - { - // ファイルオープン失敗 - Serial.println("Failed to open...") ; - SDFile.close() ; - while(1); // 動作停止 - } - + Serial.begin(9600); // XBeeの初期化 + Serial.println("Start"); } -void loop(void) -{ - Serial.println("Start..."); - attachMicroseconds(playSound,20000); - detachMicroseconds(); - delayMicroseconds(1000000); - Serial.println("play start"); - // 45マイクロ秒ごと=22.05kHzごとにplaySound()をコールする - attachMicroseconds(playSound,45); - readSound(); - - SDFile.close() ; // ファイルをクローズ - detachMicroseconds(); // 割り込みを停止 - Serial.println(""); //改行 - Serial.println("play end."); - while(1); +void loop() +{ + delay(1000); + Serial.println(millis()/1000,DEC); } - -- cgit v1.2.3