
21
PIC Code
#include <stdio.h>
#include <stdlib.h>
#include "usb.h"
#include <pic.h>
#define SCAN 1
#define TXON 2
#define TXOFF 3
#define GOOD 11
#define BAD 13
#define PORTBIT(adr, bit) ((unsigned)(&adr)*8+(bit))
static bit RXStatus @ PORTBIT(PORTA, 0);
static bit TXStatus @ PORTBIT(PORTA, 1);
static bit Done @ PORTBIT(PORTA, 2);
static bit Done1 @ PORTBIT(PORTA, 3);
static bit RX @ PORTBIT(PORTB, 0);
static bit TX @ PORTBIT(PORTB, 1);
static bit CE @ PORTBIT(PORTB, 2);
static bit CK @ PORTBIT(PORTB, 3);
static bit DA @ PORTBIT(PORTB, 4);
static bit EN @ PORTBIT(PORTB, 5);
static bit CLK @ PORTBIT(PORTB, 6);
static bit DIN @ PORTBIT(PORTB, 7);
static bit C_bit @ PORTBIT(STATUS, 0);
unsigned int hibyte;
unsigned int lobyte;
void setup_tx_pll(void)
{
CLK = 0;
DIN = 0;
Comentários a estes Manuais