Discover the simplicity and charm of early computing with 8800 Retro Click, an innovative tribute to the legendary Altair 8800
A
A
Hardware Overview
How does it work?
8800 Retro Click is based on the AS1115, a compact dot-matrix 8x8 LED driver from AMS-AG. It includes a 4-bit PWM for each segment and only one resistor for LED current adjustment (LED brightness). The AS1115 comprises an integrated BCD code-B/HEX decoder, multiplex scan circuitry, segment and display drivers, and 64-bit memory. Internal memory stores the shift register settings, eliminating the need for continuous device reprogramming. This board is ideal for seven-segment or dot matrix user interface displays and other white goods or personal electronic applications. The LED columns have common cathodes connected to the digit-drive lines,
where each of the 64 LEDs can be addressed separately. On initial Power-Up, the AS1115 registers are reset to their default values, the display is blanked, and the device goes into Shutdown mode. At this time, all registers should be programmed for Normal operation. The AS1115 features a low Shutdown current of typically 200nA and an operational current of typically 350μA. 8800 Retro Click communicates with MCU using a standard I2C 2-Wire interface, with a clock frequency of up to 1MHz in the Fast Mode Plus. In addition, the AS1115 can read back 16 buttons and offers a detailed short/open LED error diagnostic. Therefore, to get a valid readback of buttons, it is
recommended to read out the keyscan registers immediately after the IRQ interrupt pin, available on the INT pin of the mikroBUS™ socket, is triggered. In addition to the number-digits programming, this Click board™ can also be reset by software. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive
mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI
GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
48
RAM (Bytes)
8196
You complete me!
Accessories
Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output via Debug Mode
1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.
2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.
Software Support
Library Description
This library contains API for 8800 Retro Click driver.
Key functions:
c8800retro_display_char
- This function displays a single character from the predefined charset (IBM BIOS 8x8 font array)c8800retro_get_keypad
- This function reads KEYA and KEYB registers and stores the register's inverted value to the keypad variablec8800retro_display_string
- This function scrolls a desired string on LEDs.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file main.c
* @brief 8800Retro Click example
*
* # Description
* This example demonstrates the use of 8800 Retro click board.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and issues the click default configuration,
* then asks the user to select the demo example using the on-board KeyPad.
*
* ## Application Task
* There are 4 different demo examples: KeyPad 4x4, Full charset, Text, and Image.
* This function will run the previously selected demo example in the loop.
* The user can always switch the example by pressing the button D4 three times in a row.
* In order to run the demo examples successfully, please follow the instructions logged
* on the USB UART.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "c8800retro.h"
/**
* @brief 8800 Retro Click demo example values.
* @details Enum values for demo examples selection.
*/
typedef enum
{
DEMO_KEYPAD4x4,
DEMO_FULL_CHARSET,
DEMO_TEXT,
DEMO_IMAGE,
} c8800retro_demo_example_t;
static c8800retro_t c8800retro;
static log_t logger;
static c8800retro_demo_example_t demo_example = DEMO_KEYPAD4x4;
uint8_t c8800retro_demo_string[ 9 ] = { ' ', 'M', 'i', 'k', 'r', 'o', 'E', ' ', 0 };
uint8_t c8800retro_demo_logo_mikroe[ 8 ] = { 0x7F, 0xFF, 0xC0, 0xFF, 0xFF, 0xC0, 0xFF, 0x7F };
/**
* @brief 8800 Retro select demo example function.
* @details This function asks the user to select the demo example via desired buttons.
* @param[in] ctx : Click context object.
* See #c8800retro_t object definition for detailed explanation.
* @return @li @c 0 - Success,
* @li @c -1 - Error.
*
* See #err_t definition for detailed explanation.
* @note Follow the procedure written on the USB UART to select the desired demo example.
*/
static err_t c8800retro_select_demo_example( c8800retro_t *ctx );
/**
* @brief 8800 Retro demo KeyPad 4x4 example function.
* @details This function executes the KeyPad 4x4 demo example.
* @param[in] ctx : Click context object.
* See #c8800retro_t object definition for detailed explanation.
* @return @li @c 0 - Success,
* @li @c -1 - Error.
*
* See #err_t definition for detailed explanation.
* @note Follow the procedure written on the USB UART to jump out the function.
*/
static err_t c8800retro_demo_keypad4x4( c8800retro_t *ctx );
/**
* @brief 8800 Retro demo Full charset example function.
* @details This function executes the Full charset demo example.
* @param[in] ctx : Click context object.
* See #c8800retro_t object definition for detailed explanation.
* @return @li @c 0 - Success,
* @li @c -1 - Error.
*
* See #err_t definition for detailed explanation.
* @note Follow the procedure written on the USB UART to jump out the function.
*/
static err_t c8800retro_demo_full_charset( c8800retro_t *ctx );
/**
* @brief 8800 Retro demo text example function.
* @details This function executes the Text demo example.
* @param[in] ctx : Click context object.
* See #c8800retro_t object definition for detailed explanation.
* @param[in] scroll_mode : @li @c 0 - Horizontal left.
* @li @c 1 - Horizontal right.
* @li @c 2 - Vertical up.
* @li @c 3 - Vertical down.
* @param[in] scroll_speed_ms : Scroll speed in miliseconds.
* @param[in] text : Text string (up to 32 characters).
* @return @li @c 0 - Success,
* @li @c -1 - Error.
*
* See #err_t definition for detailed explanation.
* @note Follow the procedure written on the USB UART to jump out the function.
*/
static err_t c8800retro_demo_text( c8800retro_t *ctx, uint8_t scroll_mode, uint16_t scroll_speed_ms, uint8_t *text );
/**
* @brief 8800 Retro demo image example function.
* @details This function executes the Image demo example.
* @param[in] ctx : Click context object.
* See #c8800retro_t object definition for detailed explanation.
* @param[in] p_image : Pointer to image buffer (array of 8 bytes).
* @return @li @c 0 - Success,
* @li @c -1 - Error.
*
* See #err_t definition for detailed explanation.
* @note Follow the procedure written on the USB UART to jump out the function.
*/
static err_t c8800retro_demo_image( c8800retro_t *ctx, uint8_t *p_image );
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
c8800retro_cfg_t c8800retro_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
c8800retro_cfg_setup( &c8800retro_cfg );
C8800RETRO_MAP_MIKROBUS( c8800retro_cfg, MIKROBUS_1 );
err_t init_flag = c8800retro_init( &c8800retro, &c8800retro_cfg );
if ( I2C_MASTER_ERROR == init_flag )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
c8800retro_default_cfg( &c8800retro );
c8800retro_select_demo_example( &c8800retro );
}
void application_task ( void )
{
switch ( demo_example )
{
case DEMO_KEYPAD4x4:
{
c8800retro_demo_keypad4x4 ( &c8800retro );
break;
}
case DEMO_FULL_CHARSET:
{
c8800retro_demo_full_charset ( &c8800retro );
break;
}
case DEMO_TEXT:
{
c8800retro_demo_text ( &c8800retro, C8800RETRO_SCROLL_HORIZONTAL_LEFT,
C8800RETRO_SCROLL_SPEED_MEDIUM,
c8800retro_demo_string );
break;
}
case DEMO_IMAGE:
{
c8800retro_demo_image ( &c8800retro, c8800retro_demo_logo_mikroe );
break;
}
default:
{
break;
}
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
static err_t c8800retro_select_demo_example( c8800retro_t *ctx )
{
err_t error_flag = c8800retro_clear_display( ctx );
error_flag |= c8800retro_clear_interrupt( ctx );
for ( ; ; )
{
uint16_t keypad = C8800RETRO_KEY_NONE;
log_printf( &logger, "\r\n Press one of the following buttons to select the demo example: \r\n" );
log_printf( &logger, " A1: KeyPad 4x4 \r\n" );
log_printf( &logger, " A2: Full charset \r\n" );
log_printf( &logger, " A3: Text \r\n" );
log_printf( &logger, " A4: Image \r\n" );
// Pressed button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_get_keypad( ctx, &keypad );
while( !c8800retro_get_int_pin( ctx ) );
// Released button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_clear_interrupt( ctx );
while( !c8800retro_get_int_pin( ctx ) );
switch ( keypad )
{
case C8800RETRO_KEY_A1:
{
demo_example = DEMO_KEYPAD4x4;
return error_flag;
}
case C8800RETRO_KEY_A2:
{
demo_example = DEMO_FULL_CHARSET;
return error_flag;
}
case C8800RETRO_KEY_A3:
{
demo_example = DEMO_TEXT;
return error_flag;
}
case C8800RETRO_KEY_A4:
{
demo_example = DEMO_IMAGE;
return error_flag;
}
default:
{
log_printf( &logger, " Wrong button! \r\n" );
break;
}
}
}
}
static err_t c8800retro_demo_keypad4x4( c8800retro_t *ctx )
{
log_printf( &logger, "\r\n ---- KeyPad 4x4 demo example ---- \r\n" );
log_printf( &logger, " Keypad layout: \r\n" );
log_printf( &logger, " 1 2 3 A \r\n" );
log_printf( &logger, " 4 5 6 B \r\n" );
log_printf( &logger, " 7 8 9 C \r\n" );
log_printf( &logger, " * 0 # D \r\n" );
log_printf( &logger, " Press the button D4 three times to switch the example \r\n " );
uint8_t d4_cnt = 0;
err_t error_flag = c8800retro_clear_display( ctx );
error_flag |= c8800retro_clear_interrupt( ctx );
for ( ; ; )
{
uint16_t keypad = C8800RETRO_KEY_NONE;
// Pressed button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_get_keypad( ctx, &keypad );
while( !c8800retro_get_int_pin( ctx ) );
// Released button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_clear_interrupt( ctx );
while( !c8800retro_get_int_pin( ctx ) );
if ( keypad & C8800RETRO_KEY_D4 )
{
d4_cnt++;
}
else
{
d4_cnt = 0;
}
switch ( keypad )
{
case C8800RETRO_KEY_A1:
{
error_flag |= c8800retro_display_char( ctx, '1' );
log_printf( &logger, "1" );
break;
}
case C8800RETRO_KEY_A2:
{
error_flag |= c8800retro_display_char( ctx, '2' );
log_printf( &logger, "2" );
break;
}
case C8800RETRO_KEY_A3:
{
error_flag |= c8800retro_display_char( ctx, '3' );
log_printf( &logger, "3" );
break;
}
case C8800RETRO_KEY_A4:
{
error_flag |= c8800retro_display_char( ctx, 'A' );
log_printf( &logger, "A" );
break;
}
case C8800RETRO_KEY_B1:
{
error_flag |= c8800retro_display_char( ctx, '4' );
log_printf( &logger, "4" );
break;
}
case C8800RETRO_KEY_B2:
{
error_flag |= c8800retro_display_char( ctx, '5' );
log_printf( &logger, "5" );
break;
}
case C8800RETRO_KEY_B3:
{
error_flag |= c8800retro_display_char( ctx, '6' );
log_printf( &logger, "6" );
break;
}
case C8800RETRO_KEY_B4:
{
error_flag |= c8800retro_display_char( ctx, 'B' );
log_printf( &logger, "B" );
break;
}
case C8800RETRO_KEY_C1:
{
error_flag |= c8800retro_display_char( ctx, '7' );
log_printf( &logger, "7" );
break;
}
case C8800RETRO_KEY_C2:
{
error_flag |= c8800retro_display_char( ctx, '8' );
log_printf( &logger, "8" );
break;
}
case C8800RETRO_KEY_C3:
{
error_flag |= c8800retro_display_char( ctx, '9' );
log_printf( &logger, "9" );
break;
}
case C8800RETRO_KEY_C4:
{
error_flag |= c8800retro_display_char( ctx, 'C' );
log_printf( &logger, "C" );
break;
}
case C8800RETRO_KEY_D1:
{
error_flag |= c8800retro_display_char( ctx, '*' );
log_printf( &logger, "*" );
break;
}
case C8800RETRO_KEY_D2:
{
error_flag |= c8800retro_display_char( ctx, '0' );
log_printf( &logger, "0" );
break;
}
case C8800RETRO_KEY_D3:
{
error_flag |= c8800retro_display_char( ctx, '#' );
log_printf( &logger, "#" );
break;
}
case C8800RETRO_KEY_D4:
{
error_flag |= c8800retro_display_char( ctx, 'D' );
log_printf( &logger, "D" );
break;
}
default:
{
break;
}
}
if ( d4_cnt == 3 )
{
error_flag |= c8800retro_select_demo_example( ctx );
return error_flag;
}
}
return error_flag;
}
static err_t c8800retro_demo_full_charset( c8800retro_t *ctx )
{
log_printf( &logger, "\r\n ---- Full charset demo example ---- \r\n" );
log_printf( &logger, " Press the button D4 three times to switch the example \r\n" );
err_t error_flag = c8800retro_clear_display( ctx );
error_flag |= c8800retro_clear_interrupt( ctx );
for ( ; ; )
{
for ( uint8_t cnt = 0; cnt <= 255; cnt++ )
{
if ( cnt == 128 )
{
cnt = 160;
}
error_flag |= c8800retro_display_char( ctx, cnt );
Delay_ms( 200 );
if ( !c8800retro_get_int_pin( ctx ) )
{
uint16_t keypad = C8800RETRO_KEY_NONE;
uint8_t d4_cnt = 0;
while ( d4_cnt < 3 )
{
// Pressed button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_get_keypad( ctx, &keypad );
while( !c8800retro_get_int_pin( ctx ) );
// Released button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_clear_interrupt( ctx );
while( !c8800retro_get_int_pin( ctx ) );
if ( ( keypad & C8800RETRO_KEY_D4 ) != C8800RETRO_KEY_D4 )
{
break;
}
d4_cnt++;
}
if ( d4_cnt == 3 )
{
error_flag |= c8800retro_select_demo_example( ctx );
return error_flag;
}
}
if ( C8800RETRO_ERROR == error_flag )
{
log_printf( &logger, "\r\n Error occured. \r\n" );
return error_flag;
}
}
}
}
static err_t c8800retro_demo_text( c8800retro_t *ctx, uint8_t scroll_mode, uint16_t scroll_speed_ms, uint8_t *text )
{
log_printf( &logger, "\r\n ---- Text demo example ---- \r\n" );
log_printf( &logger, " Once it finish scrolling, press the button D4 three times in the next" );
log_printf( &logger, " 3 seconds to switch the example \r\n" );
err_t error_flag = c8800retro_clear_display( ctx );
error_flag |= c8800retro_clear_interrupt( ctx );
for ( ; ; )
{
uint16_t timeout = 3000;
log_printf( &logger, "\r\n Text scrolling has started. \r\n" );
error_flag |= c8800retro_display_string( ctx, scroll_mode, scroll_speed_ms, text );
error_flag |= c8800retro_clear_interrupt( ctx );
log_printf( &logger, "\r\n Text scrolling has finished. Press the button D4 three times in the next" );
log_printf( &logger, " 3 seconds to switch the example. Otherwise, scrolling will start over. \r\n" );
while ( timeout-- > 0 )
{
if ( !c8800retro_get_int_pin( ctx ) )
{
uint16_t keypad = C8800RETRO_KEY_NONE;
uint8_t d4_cnt = 0;
while ( d4_cnt < 3 )
{
// Pressed button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_get_keypad( ctx, &keypad );
while( !c8800retro_get_int_pin( ctx ) );
// Released button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_clear_interrupt( ctx );
while( !c8800retro_get_int_pin( ctx ) );
if ( ( keypad & C8800RETRO_KEY_D4 ) != C8800RETRO_KEY_D4 )
{
break;
}
d4_cnt++;
}
if ( d4_cnt == 3 )
{
error_flag |= c8800retro_select_demo_example( ctx );
return error_flag;
}
}
Delay_ms ( 1 );
}
if ( C8800RETRO_ERROR == error_flag )
{
log_printf( &logger, "\r\n Error occured. \r\n" );
return error_flag;
}
}
}
static err_t c8800retro_demo_image( c8800retro_t *ctx, uint8_t *p_image )
{
log_printf( &logger, "\r\n ---- Image demo example ---- \r\n" );
log_printf( &logger, " Press the button D4 three times to switch the example \r\n" );
err_t error_flag = c8800retro_clear_display( ctx );
error_flag |= c8800retro_clear_interrupt( ctx );
error_flag |= c8800retro_display_image( ctx, p_image );
for ( ; ; )
{
if ( !c8800retro_get_int_pin( ctx ) )
{
uint16_t keypad = C8800RETRO_KEY_NONE;
uint8_t d4_cnt = 0;
while ( d4_cnt < 3 )
{
// Pressed button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_get_keypad( ctx, &keypad );
while( !c8800retro_get_int_pin( ctx ) );
// Released button
while( c8800retro_get_int_pin( ctx ) );
error_flag |= c8800retro_clear_interrupt( ctx );
while( !c8800retro_get_int_pin( ctx ) );
if ( ( keypad & C8800RETRO_KEY_D4 ) != C8800RETRO_KEY_D4 )
{
break;
}
d4_cnt++;
}
if ( d4_cnt == 3 )
{
error_flag |= c8800retro_select_demo_example( ctx );
return error_flag;
}
}
if ( C8800RETRO_ERROR == error_flag )
{
log_printf( &logger, "\r\n Error occured. \r\n" );
return error_flag;
}
}
}
// ------------------------------------------------------------------------ END