Cypress Semiconductor CY8C21534 Especificaciones Pagina 55

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 69
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 54
Appendix 2
5(15)
Write_enable_Start();
Loading_LED_Start();
Counter8_WritePeriod(0x60);
Counter8_WriteCompareValue(0x30);
Counter8_Start();
UART_Start(UART_PARITY_NONE);
// Makes ready Write_enable for operation
// Makes ready Loading_LED for operation
// Sets period to 60 clocks
// Generates a 50% duty cycle
// Starts counter //
Enables UART
SPIM_Start(SPIM_SPIM_MODE_0 | SPIM_SPIM_MSB_FIRST); // Sets SD SPI parameters
SPIM2_Start(SPIM2_SPIM_MODE_0 | SPIM2_SPIM_MSB_FIRST);// Sets Debug SPI parameters
while(1)
{
// Waits for button press
if ((PRT2DR & 0x04) == 0x04)
{
file[4] = 0x31;
k = 1;
}
else if ((PRT2DR & 0x10) == 0x10)
{
file[4] = 0x32;
k = 1;
}
else if ((PRT2DR & 0x40) == 0x40)
{
file[4] = 0x33;
k = 1;
}
else if ((PRT0DR & 0x01) == 0x01)
{
file[4] = 0x34;
k = 1;
}
else if ((PRT0DR & 0x04) == 0x04)
{
file[4] = 0x35;
k = 1;
}
if(k == 1)
{
WiFly_pwr_Switch(1);
Write_enable_Switch(1);
Loading_LED_Switch(1);
// Button P2.2
// Changes file number to 1
// Button P2.4
// Changes file number to 2
// Button P2.6
// Changes file number to 3
// Button P0.0
// Changes file number to 4
// Button P0.2
// Changes file number to 5
// Turns on WiFly power
// Enables writing to SD card
// Turns on LED to show operational status
// Waits for incoming byte of 'O' to show WyFly has made a connection
while(UART_cReadChar() != 0x4F);
// Catches extra 'O' bytes that are sent by WiFly.
while(UART_bReadRxData() == 0x4F);
// Sends request for file
for(i=0; i<5; i++)
{
UART_PutChar(file[i]);
}
Vista de pagina 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 68 69

Comentarios a estos manuales

Sin comentarios