Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 7:016ffe2ef416
- Parent:
- 6:b9a883bb1d63
- Child:
- 8:cc4b26bd80b3
--- a/main.cpp Fri Apr 17 22:21:56 2015 +0000
+++ b/main.cpp Tue Apr 21 01:58:55 2015 +0000
@@ -170,7 +170,7 @@
//init spi
SPI_AFE_ADC_AND_DDS.format(16,2);
- SPI_AFE_ADC_AND_DDS.frequency(3000000);
+ SPI_AFE_ADC_AND_DDS.frequency(30000000);
//make sure SPI is setup to mode 2, MSB first
//init DDS
@@ -179,7 +179,7 @@
//fOut = fMCLK / 2^28 * FREQREG = 50e6 / 2^28 * FREQREG
//FREQREG = fOut * 2^28 / 50e6 = fOut * 5.36870912
//100K: 536870, 1 MHz: 5368709, 2 MHz: 10737418, 3 MHz: 16106127, 4 MHz: 21474836, 8 MHz: 42949673 MHz, 20 MHz: 107374182, Max: 0x3FFF
- setFrequencyWord(0, 536870); // 500K
+ setFrequencyWord(0, 16772); // 500K
setFrequencyWord(1, 0x3FFF);
selectFrequency(0);
@@ -188,7 +188,6 @@
setPhaseWord(1, 2048); // 180 degrees
//setPhaseWord(1, 1024); // 90 degrees
//setPhaseWord(1, 512); // 45 degrees
-
selectPhase(0);
@@ -201,12 +200,58 @@
SQUARE = 1;
+ int count = 0;
+ int data[11] = {1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1};
+
+ selectPhase(1);
+ wait_ms(1000);
+
+ //freq is 32kHz for some reason?
+
while(1){
- selectPhase(0);
- wait_us(16);
- selectPhase(1);
- wait_us(16);
- }
+
+
+ if (data[count]){
+
+ //manchester
+ //selectPhase(0);
+ //wait_us(15);
+ //selectPhase(1);
+ //wait_us(15);
+ //bpsk
+ selectPhase(0);
+ wait_us(31);
+
+
+ }else{
+
+ //manchester
+ //selectPhase(1);
+ //wait_us(15);
+ //selectPhase(0);
+ //wait_us(15);
+ //bpsk
+ selectPhase(1);
+ wait_us(31);
+
+ }
+
+ count++;
+ if (count > 10){
+ count = 0;
+
+ selectPhase(1);
+ wait_us(600);
+
+ }
+
+
+
+
+
+ }
+
+
/*
// FOR A SQUARE WAVE:
setSignOutput(SIGN_OUTPUT_MSB);