Rev 2810 Rev 2811
Line 1... Line 1...
1 /**** BootLoader for PIC16F887 1 /**** BootLoader for PIC16F887
2   2  
3 Ussage: 3 Ussage:
4 ascii-xfr -s -v -l 100 ./bltest.hex > /dev/ttyUSB$1 4 ascii-xfr -s -v -l 100 ./bltest.hex > /dev/ttyUSB0
-   5
-   6 ascii-xfr is part of 'minicom' package
5   7  
6 Add "uf\n\r" to the first line of .HEX . 8 Add "uf\n\r" to the first line of .HEX. or use this script:
-   9 echo uf > /dev/ttyUSB$1
-   10 ascii-xfr -s -v -l 100 ./bltest.hex > /dev/ttyUSB$1
-   11
-   12 Or add "uf\n\r" and add some dummy characters at end or begin of each line (for 100 ms delay) and use:
-   13 cp ./bltest.hex > /dev/ttyUSB0
-   14
-   15 For adding characters you can use this:
-   16 echo uf > /dev/ttyUSB0; sed 's/^/pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp/' ./bltest.hex > /dev/ttyUSB0
-   17
7 */ 18 */
8   19  
9 #define ID "$Id: bloader.c 2810 2013-03-10 06:57:44Z kakl $" 20 #define ID "$Id: bloader.c 2811 2013-03-10 07:43:30Z kakl $"
10   21  
11 #CASE // Case sensitive compiler 22 #CASE // Case sensitive compiler
12   23  
13 #define FLASH_BLOCK_SIZE getenv("FLASH_ERASE_SIZE")/2 // Minimal length of Flash Block Size 24 #define FLASH_BLOCK_SIZE getenv("FLASH_ERASE_SIZE")/2 // Minimal length of Flash Block Size
14 #define RESERVED_BLOCKS 53 // Number of reserved flash blocks for BootLoader 25 #define RESERVED_BLOCKS 53 // Number of reserved flash blocks for BootLoader