Skip to content

Commit

Permalink
6/7/2020 release - see README.md for details
Browse files Browse the repository at this point in the history
  • Loading branch information
lorne smith committed Jun 8, 2020
1 parent dcc6794 commit 4a0f70a
Show file tree
Hide file tree
Showing 679 changed files with 41,635 additions and 4,151 deletions.
177 changes: 177 additions & 0 deletions Documentation/MAX78000.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MAX78000 Documentation</title>
<style>
a:hover, a:focus {
color: #6e2585;
}
a:active, a:hover {
outline: 0;
}
a {
color: #00b2a9;
text-decoration: none;
}
body {
font-family: Arial,Helvetica,sans-serif;
color: #6c6f70;
}
h1 {
font-size: 150%;
color: #000;
}
h2 {
font-size: 125%;
color: #6e2585;
}
</style>
</head>

<body>
<h1>MAX78000 Documentation</h1>
<hr>

Please visit Maxim's MAX78000 GitHub repository for:
<ol>
<li><a href='https://github.com/MaximIntegratedAI'>The latest versions of all files</a></li>
<li><a href='https://github.com/MaximIntegratedAI/MaximAI_Documentation/blob/master/MAX78000_Evaluation_Kit/README.md'>Instructions for getting started with the evaluation kit</a></li>
</ol>

Additional information can be found in the following links.

<h2>SDK</h2>
<ul>
<li id='periph'></li>
<li>Toolchain</li>
<ul>
<li id='eclipse'></li>
<li id='gnu-arm'></li>
<li id='gnu-riscv'></li>
<li id='mingw'></li>
<li id='openocd'></li>
<li id='sbt'></li>
<li id='bmp-converter'></li>
<li id='free-rtos'></li>
</ul>
</ul>
<hr>

<h2>Example Applications</h2>
The following examples can be found in the <a href='../Examples/MAX78000'>Examples/MAX78000</a> directory of the SDK installation:
<ul>
<li><a href='../Examples/MAX78000/ADC/README.md'>ADC</a> - Analog-to-Digital Converter</li>
<li><a href='../Examples/MAX78000/AES/README.md'>AES</a> - Advanced Encryption Standard</li>
<li>CNN - Convolutional Neural Network</li>
<ul>
<li><a href='../Examples/MAX78000/CNN/cats-vs-dogs-chw/README.md'>cats-vs-dogs-chw</a> - Image Classification using 2 Choices</li>
<li><a href='../Examples/MAX78000/CNN/cifar-10/README.md'>cifar-10</a> - Object Classification using 10 Choices</li>
<li><a href='../Examples/MAX78000/CNN/cifar-100/README.md'>cifar-100</a> - Object Classification using 100 Choices</li>
<li><a href='../Examples/MAX78000/CNN/kws20/README.md'>kws20</a> - Audio Keyword Spotting</li>
<li><a href='../Examples/MAX78000/CNN/mnist/README.md'>mnist</a> - Handwritten Digit Recognition</li>
<li><a href='../Examples/MAX78000/CNN/mnist-riscv/README.md'>mnist-riscv</a> - Handwritten Digit Recognition (runs on RISC-V core)</li>
</ul>
<li><a href='../Examples/MAX78000/CRC/README.md'>CRC</a> - Cyclic Redundancy Check</li>
<li><a href='../Examples/MAX78000/DMA/README.md'>DMA</a> - Direct Memory Access</li>
<li><a href='../Examples/MAX78000/ECC/README.md'>ECC</a> - Error Correction Code</li>
<li><a href='../Examples/MAX78000/Flash/README.md'>Flash</a> - Flash Memory</li>
<li><a href='../Examples/MAX78000/GPIO/README.md'>GPIO</a> - General Purpose Input/Output</li>
<li><a href='../Examples/MAX78000/Hello_World/README.md'>Hello_World</a></li>
<li><a href='../Examples/MAX78000/ICC/README.md'>ICC</a> - Instruction Cache Controller</li>
<li><a href='../Examples/MAX78000/Pulse_Train/README.md'>Pulse_Train</a></li>
<li><a href='../Examples/MAX78000/RTC/README.md'>RTC</a> - Real Time Clock</li>
<li><a href='../Examples/MAX78000/SPI/README.md'>SPI</a> - Serial Peripheral Interface</li>
<li><a href='../Examples/MAX78000/TFT_Demo/README.md'>TFT_Demo</a> - Thin-Film Transistor Display</li>
<li><a href='../Examples/MAX78000/TMR/README.md'>TMR</a> - General Purpose Timer</li>
<li><a href='../Examples/MAX78000/TRNG/README.md'>TRNG</a> - True Random Number Generator</li>
<li><a href='../Examples/MAX78000/UART/README.md'>UART</a> - Universal Asynchronous Receive/Transmitter</li>
<li><a href='../Examples/MAX78000/Watchdog/README.md'>Watchdog</a></li>
</ul>
<hr>

<h2>Device Information</h2>
Additional information about the MAX78000 can be found in these documents:
<ul>
<li><a href='https://github.com/MaximIntegratedAI/MaximAI_Documentation/raw/master/MAX78000/MAX78000 PDS Rev4.pdf'>IC Datasheet</a></li>
<li><a href='https://github.com/MaximIntegratedAI/MaximAI_Documentation/raw/master/MAX78000/MAX78000 User Guide.pdf'>IC User Guide</a></li>
<li><a href='https://github.com/MaximIntegratedAI/MaximAI_Documentation/raw/master/MAX78000_Evaluation_Kit/MAX78000 REV A including mods.pdf'>Evaluation Kit Schematatic (Revision A)</a></li>
</ul>

<script type="text/javascript">

function addLink(testFile, url, passText, failText, dom)
{
var img = new Image();
img.onerror = function() {
dom.innerHTML += failText;
};
img.onload = function() {
dom.innerHTML += '<a href="' + url + '">' + passText + '</a>';
};
img.src = testFile;
console.log('Test');
console.log(img.currentSrc);
}

addLink('../Libraries/PeriphDrivers/Documentation/MAX78000/doc.png',
'../Libraries/PeriphDrivers/Documentation/MAX78000/index.html',
'Peripheral API',
'The periheral API documentation has not been installed.',
document.getElementById('periph')
);

addLink('../Tools/Eclipse/cdt/plugins/org.eclipse.platform_4.13.0.v20190916-1045/splash.bmp',
'../Tools/Eclipse/cdt/readme/readme_eclipse.html',
'Eclipse',
'Eclipse has not been installed.',
document.getElementById('eclipse')
);

addLink('../Tools/GNUTools/blank.bmp',
'https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm',
'GNU Tools for ARM',
'The GNU Tools for ARM have not been installed.',
document.getElementById('gnu-arm')
);

addLink('../Tools/xPack/blank.bmp',
'../Tools/xPack/riscv-none-embed-gcc/README.md',
'GNU Tools for RISC-V',
'The GNU Tools for RISC-V have not been installed.',
document.getElementById('gnu-riscv')
);

addLink('../Libraries/FreeRTOS/Documentation/blank.bmp',
'../Libraries/FreeRTOS/readme.txt',
'Free-RTOS',
'The Free-RTOS libraries have not been installed.',
document.getElementById('free-rtos')
);
addLink('../Tools/BitmapConverter/docs/blank.bmp',
'../Tools/BitmapConverter/docs/README.md',
'Bitmap Converter',
'The bitmap converter has not been installed.',
document.getElementById('bmp-converter')
);
addLink('../Tools/SBT/docs/blank.bmp',
'../Tools/SBT/docs/UG7236Rev0_MaximSDK_Secure_Boot_Tool_User_Guide_Preliminary.pdf',
'Secure Boot Tools',
'The secure boot tools have not been installed.',
document.getElementById('sbt')
);
addLink('../Tools/OpenOCD/blank.bmp',
'http://openocd.org/doc/html/index.html',
'OpenOCD',
'OpenOCD has not been installed.',
document.getElementById('openocd')
);
addLink('../Tools/MinGW/msys/1.0/opt/lib/tk8.6/images/logo64.gif',
'http://www.mingw.org/',
'MinGW',
'The MinGW package has not been installed.',
document.getElementById('mingw')
);
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion Examples/MAX78000/ADC/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/CMSIS/Device/Maxim/MAX78000/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/Boards/MAX78000/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/PeriphDrivers/Include/MAX78000&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/Boards/MAX78000/QN_EvKit_V1/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/Boards/MAX78000/EvKit_V1/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Tools/GNUTools/arm-none-eabi/include&quot;"/>
</option>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.tool.c.compiler.input.68945223" superClass="ilg.gnumcueclipse.managedbuild.cross.tool.c.compiler.input"/>
Expand Down
32 changes: 29 additions & 3 deletions Examples/MAX78000/ADC/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
## Description

TBD<!--TBD-->
Demonstrates the use of the ADC by continuously monitoring ADC input channel 0. Vary the voltage on the AIN0 input (0 to 0.9V) to observe different readings from the ADC.

High and low limits are set arbitrarily to demonstrate the detection of overvoltage and undervoltage conditions respectively. If the ADC reading exceeds 0x300, the example will report that the high limit has been reached. If the ADC reading falls below 0x25, the example will report the low limit has been reached.

Any reading that exceeds the full-scale value of the ADC will have an '*' appended to the value.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.
- Apply an input voltage between 0 and 0.9V to pin 1 of the JH3 (ADC IN) header.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
ADC Example
0: 0x0001
0: 0x003f
0: 0x01ad
0: 0x028d
0: 0x0289
0: 0x006a
```
79 changes: 26 additions & 53 deletions Examples/MAX78000/ADC/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
******************************************************************************/
Expand All @@ -47,20 +47,19 @@

/* Change to #undef USE_INTERRUPTS for polling mode */
#define USE_INTERRUPTS
// #define DMA

/***** Globals *****/
#ifdef USE_INTERRUPTS
volatile unsigned int adc_done = 0;
#endif

volatile unsigned int dma_done = 0;
static uint16_t adc_val;

/***** Functions *****/

#ifdef USE_INTERRUPTS
void adc_complete_cb (void * req, int error) {
void adc_complete_cb(void* req, int error)
{
adc_done = 1;
return;
}
Expand All @@ -70,86 +69,60 @@ void ADC_IRQHandler(void)
}
#endif

#ifdef DMA
void DMA0_IRQHandler(void)
{
MXC_DMA_Handler();
MXC_DMA_ReleaseChannel(0);
dma_done = 1;
}

void DMA_Callback(int ch, int error)
{
// Read 32-bit value and truncate to 16-bit for output depending on data align bit
if ( (MXC_ADC->ctrl & MXC_F_ADC_CTRL_DATA_ALIGN) != 0) {
adc_val = (uint16_t) (adc_val >> 6); /* MSB justified */
}
}
#endif

int main(void)
{
// unsigned int overflow;

printf("ADC Example\n");

/* Initialize ADC */
if (MXC_ADC_Init() != E_NO_ERROR) {
printf("Error Bad Parameter\n");
while(1);

while (1);
}

/* Set up LIMIT0 to monitor high and low trip points */
MXC_ADC_SetMonitorChannel(MXC_ADC_MONITOR_0, MXC_ADC_CH_0);
MXC_ADC_SetMonitorHighThreshold(MXC_ADC_MONITOR_0, 0x300);
MXC_ADC_SetMonitorLowThreshold(MXC_ADC_MONITOR_0, 0x25);
MXC_ADC_EnableMonitor(MXC_ADC_MONITOR_0);

#ifdef USE_INTERRUPTS
NVIC_EnableIRQ(ADC_IRQn);
#endif

#ifdef DMA
MXC_DMA_ReleaseChannel(0);
NVIC_EnableIRQ(DMA0_IRQn);
#endif

while(1) {

while (1) {
/* Flash LED when starting ADC cycle */
LED_On(0);
MXC_TMR_Delay(MXC_TMR0, MSEC(10));
LED_Off(0);

/* Convert channel 0 */
#ifdef USE_INTERRUPTS
adc_done = 0;
MXC_ADC_StartConversionAsync(MXC_ADC_CH_0, adc_complete_cb);
while (!adc_done){};
#endif

#ifdef DMA
dma_done = 0;
MXC_ADC_StartConversionDMA(MXC_ADC_CH_0, &adc_val, DMA_Callback);
while(!dma_done);

printf("0: 0x%04x\n", adc_val);
adc_done = 0;
MXC_ADC_StartConversionAsync(MXC_ADC_CH_0, adc_complete_cb);

while (!adc_done) {};
#else
// MXC_ADC_StartConversion(MXC_ADC_CH_0);
MXC_ADC_StartConversion(MXC_ADC_CH_0);
#endif
static uint8_t overflow;
overflow = (MXC_ADC_GetData(&adc_val) == E_OVERFLOW ? 1 : 0);
/* Display results on OLED display, display asterisk if overflow */
printf("0: 0x%04x%s\n\n", adc_val, overflow ? "*" : " ");
#endif


/* Determine if programmable limits on AIN0 were exceeded */
if (MXC_ADC_GetFlags() & (MXC_F_ADC_INTR_LO_LIMIT_IF | MXC_F_ADC_INTR_HI_LIMIT_IF)) {
printf(" %s Limit on AIN0 ",(MXC_ADC_GetFlags() & MXC_F_ADC_INTR_LO_LIMIT_IF) ? "Low" : "High");
printf(" %s Limit on AIN0 ", (MXC_ADC_GetFlags() & MXC_F_ADC_INTR_LO_LIMIT_IF) ? "Low" : "High");
MXC_ADC_ClearFlags(MXC_F_ADC_INTR_LO_LIMIT_IF | MXC_F_ADC_INTR_HI_LIMIT_IF);
} else {
}
else {
printf(" ");
}

printf("\n");

/* Delay for 1/4 second before next reading */
MXC_TMR_Delay(MXC_TMR0, MSEC(250));
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX78000/AES/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/CMSIS/Device/Maxim/MAX78000/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/Boards/MAX78000/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/PeriphDrivers/Include/MAX78000&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/Boards/MAX78000/QN_EvKit_V1/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Libraries/Boards/MAX78000/EvKit_V1/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MAXIM_PATH}/Tools/GNUTools/arm-none-eabi/include&quot;"/>
</option>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.tool.c.compiler.input.68945223" superClass="ilg.gnumcueclipse.managedbuild.cross.tool.c.compiler.input"/>
Expand Down
Loading

0 comments on commit 4a0f70a

Please sign in to comment.