[an error occurred while processing this directive]
[an error occurred while processing this directive]
|
/*------------------------------------------------------------------------
MAIN.C
- description
- See README.TXT for project description and disclaimer.
!!! Put external pullup resistors on SDA1(Pin30) and SCL1(Pin31).
/*----------------------------------------------------------------------*/
#include "mb90550.h"
#define IICBUS_97KHZ 0x01
/*------------ prototypes -------------*/
void InitIICbus(void);
void main(void)
{
InitIICbus();
__set_il(7); /* set ILM, allow lowest interrupt priority */
__EI(); /* set PS:I, enable interrupt at all */
IDAR1 = 0x55; /* set data byte */
IBCR1_MSS = 1; /* master enable */
while(1)
{
while(!IBCR1_INT);
IDAR1 = 0xAA; /* set next data byte */
IBCR1_SCC = 1; /* start next transfer */
while(!IBCR1_INT);
IDAR1 = 0x55; /* set next data byte */
IBCR1_SCC = 1; /* start next transfer */
}
}
void InitIICbus(void)
{
PDR5 |= 0x3C;
IBCR1 = 0x00; /* CONTROL REG: all zero (disable interrupt) */
IADR1 = 0x20; /* Set Addr. to default */
ICCR1 = IICBUS_97KHZ;/* CLOCK SPEED */
/* enable interface */
ISEL_PSEL = 0; /* 0/1 -> select interface 1/2 (pin 30,31/pin 32/33) */
ICCR1_EN = 1; /* enable */
ICR14 = 0x01;
}
PS. Я же говорил, что "не знаю, но могу ответить" :)))
E-mail: info@telesys.ru