Changeset 0262b6e in avrstuff


Ignore:
Timestamp:
Sep 4, 2012, 6:44:04 PM (12 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
87456c1
Parents:
41d46ae
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.

git-svn-id: svn://pulkomandy.tk/avrstuff@69 c6672c3c-f6b6-47f9-9001-1fd6b12fecbe

File:
1 edited

Legend:

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

    r41d46ae r0262b6e  
    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.