need to know


stay informed


ooBug Schematics

 


Mood LED and Head Switch

To turn the Mood-Red-SW LED on, configure RA0.
LATA,#0 must be 1 to drive the LED.
TRISA,#0 must be 0 to output the 3.3V for the LED.
When TRISA,#0 is 1, then the I/O is an input and the analog port AN0 in can read the state of the button.

    BSet LATA,#0
    BClr TRISA,#0

To turn the Mood-Green LED on, configure RA1.
LATA,#1 must be 1 to drive the LED.
TRISA,#1 must be 0 to output the 3.3V for the LED.

    BSet LATA,#1
    BClr TRISA,#1


Light Sensor

The Light Sensors can be read from the Analog ports AN2 and AN3


Line Sensor

To turn the Line IR LEDs on, configure RA2.
RA2 should be configured with pull ups on via CN30.
TRISA,#2 must be 0.
LATA,#2 must be 0.

    BSet CNPU2,#CN30PUE ; Pull up on RA2.
    BClr LATA,#2
    BClr TRISA,#2

When IR LEDs are on, the reflective IR values can be read from AN7, AN6, AN9, AN10


Object Sensor / IRDA

To turn on left spot light, configure RB10.
RB10 should be configured with pull ups on.
TRISB,#10 must be 0.
LATB,#10 must be 0.

    BSet CNPU1,#CN14PUE ; Pull up on RB11.
    BClr LATB,#10
    BClr TRISB,#10

To turn on Right spot light, configure RB11.
RB11 should be configured with pull ups on via CN15.
TRISB,#11 must be 0.
LATB,#11 must be 0.

    BSet CNPU1,#CN15PUE ; Pull up on RB11.
    BClr LATB,#11
    BClr TRISB,#11

The forward IR brightness can be read from AN12.


Motor Driver

To turn on motor driver, configure RA4.
RA4 has an external Pull Down to keep the motors off at power-up.
TRISA,#4 must be 1.
LATA,#4 must be 0.

    BSet LATA,#4
    BClr TRISA,#4

To turn motors, configure RC5-7.
TRISC,#5-7 must be cleared.
LATC,#5-7 determines direction.
No pull-ups needed as long as the motor driver is off. (RA4)

    BSet LATC,#5
    BClr TRISC,#4
    BClr LATC,#4
    BClr TRISC,#5

    BSet LATC,#7
    BClr TRISC,#6
    BClr LATC,#6
    BClr TRISC,#7


Amplifier

AMPLIFIER:

To turn on the Amp, configure RA3.
RA3 has an external Pull Up to keep the amp off at power-up.
TRISA,#3 must be 0.
LATA,#3 must be 0.

    BClr LATA,#3
    BClr TRISA,#3

To output audio, RC3 is toggled at the desired frequency.  Optionally, RC3 can be driven by a PWM signal generated via the CCP module which will provide an analog value to the amplifier input.

LM4861 BRIDGE AMPLIFIER:

The LM4861 has two internal operational amplifiers in a configuration commonly referred to as “bridged”. Bridged mode operation provides a differential drive to the load, thus doubling the output.  Consequently, four times the output power is generated.

POWER DISSIPATION

Since the LM4861 has two operational amplifiers in one package, the internal power dissipation is 4 times that of a single-ended amplifier causing the amplifier to run hot. Even with this substantial increase in power dissipation, the LM4861 does not require a heatsink.

SHUTDOWN FUNCTION

In order to reduce power consumption while not in use, the amplifier can be turn off. This shutdown feature turns the amplifier off when a logic high is placed on RA3. Upon going into shutdown, the audio output is immediately disconnected from the speaker and a typical quiescent current of 0.6μA results.  A soft pull-up resistor is attached to RA3, which will cause the amplifier to be in shutdown mode unless the PIC 24 is deliberately driving RA3 low.

Health LED


To turn the Health LED on, configure RC2.
TRISC,#2 must be cleared.
LATC,#2 determines color; 1 for Yellow, 0 for Green.
Note: The Dual-Color capability of the Health LED relies on the Audio-Out PWM.

    BClr LATC,#2
    BClr TRISC,#2


Whisker Port


Encoder Port


Expansion Ports


Power


USB


ANALOG Ports

To read Button, LightLeft, LightRight, WiskerLeft,WiskerRight
Object Detect, Volt Meter, Line sense 1-4, read AtoD results.

    Clr AD1PCFG ; All inputs are scanned
    Setm AD1CSSL ; Include all channels in scan
    Mov #0x00E0,w0
    Mov W0,AD1CON1
    Mov #0x0F00,w0
    Mov W0,AD1CON3 ; Sample time = 15Tad,
    Mov #0x043C,w0
    Mov W0,AD1CON2
    BSet AD1CON1,#15 ; turn ADC ON
    BSet AD1CON1,#2 ; auto start sampling