ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
28 ноября
349781 Топик полностью
sav_ua (28.08.2012 17:15, просмотров: 88) ответил sag1979 на Требуется хелп по SiLabs. Не могу сконфигурировать пин. Там регистров то....но ёк. С8051F963 Нужен P2.0. Он предназначен для SPI1, но я к нему немогу достучаться.....Help,
Как то так 
/////////////////////////////////////
//  Generated Initialization File  //
/////////////////////////////////////

#include "compiler_defs.h"
#include "C8051F960_defs.h"

// Peripheral specific initialization functions,
// Called from the Init_Device() function
void Port_IO_Init()
{
    // P0.0  -  Unassigned,  Open-Drain, Digital
    // P0.1  -  Unassigned,  Open-Drain, Digital
    // P0.2  -  Unassigned,  Open-Drain, Digital
    // P0.3  -  Unassigned,  Open-Drain, Digital
    // P0.4  -  Unassigned,  Open-Drain, Digital
    // P0.5  -  Unassigned,  Open-Drain, Digital
    // P0.6  -  Unassigned,  Open-Drain, Digital
    // P0.7  -  Unassigned,  Open-Drain, Digital
    // P1.0  -  SCK  (SPI1), Open-Drain, Digital
    // P1.1  -  MISO (SPI1), Open-Drain, Digital
    // P1.2  -  MOSI (SPI1), Open-Drain, Digital
    // P1.3  -  NSS  (SPI1), Open-Drain, Digital
    // P1.4  -  Unassigned,  Open-Drain, Digital
    // P1.5  -  Unassigned,  Open-Drain, Digital
    // P1.6  -  Unassigned,  Open-Drain, Digital
    // P1.7  -  Unassigned,  Open-Drain, Digital

    // P2.0  -  Unassigned,  Push-Pull,  Digital
    // P2.1  -  Unassigned,  Open-Drain, Digital
    // P2.2  -  Unassigned,  Push-Pull,  Digital
    // P2.3  -  Unassigned,  Push-Pull,  Digital
    // P2.4  -  Unassigned,  Open-Drain, Digital
    // P2.5  -  Unassigned,  Open-Drain, Digital
    // P2.6  -  Unassigned,  Open-Drain, Digital
    // P2.7  -  Unassigned,  Open-Drain, Digital

    SFRPAGE   = LEGACY_PAGE ;
    P2MDOUT   = 0x0D;
    XBR1      = 0x40;
    XBR2      = 0x40;
}

// Initialization function for device,
// Call Init_Device() from your main program
void Init_Device(void)
{
    Port_IO_Init();
}