Changeset 69


Ignore:
Timestamp:
04/09/2012 18:44:04 (8 years ago)
Author:
pulkomandy
Message:

Move PIC init earlier in boot sequence since we don't control VCC line !
The pic starts at the same time as the AVR and we have to enter it in reset state as fast as possible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • V-USB_Dev/firmwares/herePic/main.c

    r67 r69  
    4545
    4646int main() {
     47        // Enter Low Voltage ICSP mode on the PIC
     48        PORTB &= ~(VPP|PGM|PGD|PGC); // Start with all pins low
     49        DDRB |= VPP|PGM|PGD|PGC;        // set them as outputs
     50        _delay_us(5); // Wait for some time
     51        PORTB |= PGM | VPP; // Enter low voltage programming mode
     52
    4753        // Init
    4854        wdt_enable(WDTO_2S);
     
    5157        usbInit();
    5258        sei();
    53 
    54         // Enter Low Voltage ICSP mode on the PIC
    55         PORTB &= ~(VPP|PGM|PGD|PGC); // Start with all pin low
    56         DDRB |= VPP|PGM|PGD|PGC;        // set them as outputs
    57         _delay_us(4); // Wait for some time
    58         PORTB |= PGM; // Enable low voltage programming
    59         PORTB |= VPP; // Enter programming mode
    6059
    6160        // Configure leds
Note: See TracChangeset for help on using the changeset viewer.