//Designs/Measuring_instruments/AWS01A/SW/PIC16F887/bootloader887/bloader.c
195,7 → 195,7
{
buffer[buffidx] = getc();
putc(buffer[buffidx]);
} while ( (buffer[buffidx++] != '\r') && (buffidx < BUFFER_LEN_LOD) );
} while ( (buffer[buffidx] != '\r') && (buffer[buffidx] != '\n') && (buffer[buffidx] != ' ') && (++buffidx < BUFFER_LEN_LOD) );
assert(buffidx == BUFFER_LEN_LOD, ERR_BUFFER_OVERRUN); // Error 1 - Buffer Overrun
//---WDT
202,7 → 202,7
restart_wdt();
 
checksum = 0; // Sum the bytes to find the check sum value
for (i=0; i<(buffidx-3); i+=2)
for (i=0; i<(buffidx-1); i+=2)
{
checksum += atoi_b16 (&buffer[i]);
//!!! printf(".%x",checksum);
236,7 → 236,7
data.i16[i]=read_program_eeprom(next_addr++);
// Loops through all of the data and stores it in data
// The last 2 bytes are the check sum, hence buffidx-4
for (i=8,dataidx=0; i < (buffidx-5); i += 2)
for (i=8,dataidx=0; i < (buffidx-3); i += 2)
data.i8[dataidx++]=atoi_b16(&buffer[i]);
 
if (addr == 0)
//Designs/Measuring_instruments/AWS01A/SW/PIC16F887/bootloader887/bloader.hex
56,13 → 56,13
:100380006430AE003A30AF002030B0006230B100CF
:100390006C30B2006F30B3006130B4006430B5002F
:1003A0006530B6007230B7002E30B8006330B90047
:1003B0002030BA003230BB003830BC003430BD00D1
:1003C0003830BE002030BF003230C0003030C100B5
:1003B0002030BA003230BB003830BC003930BD00CC
:1003C0003730BE002030BF003230C0003030C100B6
:1003D0003130C2003330C3002D30C4003030C5008E
:1003E0003330C6002D30C7003230C8003130C9006C
:1003F0002030CA003030CB003830CC003A30CD004D
:100400003130CE003630CF003A30D0003430D10019
:100410003930D2005A30D3002030D4006B30D500B0
:1003E0003430C6002D30C7003030C8003930C90065
:1003F0002030CA003230CB003130CC003A30CD0052
:100400003230CE003030CF003A30D0003230D10020
:100410003830D2005A30D3002030D4006B30D500B1
:100420006130D6006B30D7006C30D8002030D90056
:100430002430DA00DB01DF012C30DE0094200130B3
:1004400078022C3E840083130008243C031D322ACA
74,7 → 74,7
:1004A0005F188317840A0319850A402A0D300C1E31
:1004B000572A99000A300C1E5B2A990063300317F3
:1004C0008D0000308F0003100C300313AC00FA20B5
:1004D000103084000330AD001030AC004B210D30E3
:1004D000103084000330AD002030AC004B210D30D3
:1004E0000C1E702A99000A300C1E742A99006C3078
:1004F00003178D0000308F00031014300313AC007D
:10050000FA2010308400AD012030AC004B210D30BA
94,60 → 94,62
:1005E0000C1EF02A99006430AC002C308400831378
:1005F00000080319082B0230F800F701F70BFE2A58
:10060000F80BFD2A9730F700F70B042B800BFB2A21
:08061000B22A8A150A16F32C28
:0C39E0000A128A11B9290A168A1508007B
:103A00008C1E002D1808A7001A08F800A71C0A2D04
:103A10001812181608008316B10803191F2D6530F7
:103A200083120C1E112D9900303083163207B3001B
:103A300083120C1E192D99008A0100288316831207
:103A400008008316B601B7013708013C031C552D49
:103A50003508FA003408840083137A1883170008A5
:103A6000403C0318422D360EB800F030B80534083B
:103A7000840083133518831700083807BF3E0A3EB9
:103A8000B6004F2D360EB800F030B805340884006B
:103A900083133518831700083807D03EB60037085F
:103AA000B70AB40A0319B50A242D3608F8008312A0
:103AB00008000B08F8008B138316031755308D0090
:103AC000AA308D008C14000000008C18652D0C119C
:103AD0007808831203138B040800831603178C17CE
:103AE00083120D08033903198A2DF9000D08FC39DA
:103AF0008D0083160C1483128D00000000008316C5
:103B00000C1583120313592503178D0A03198F0A05
:103B1000F90B7D2D831603133008F9000310F90CFF
:103B20000F30831203170D05031DA02D83160C16ED
:103B30000C15831203135925831603170C128312D5
:103B400000088C00840A00088E00840A83160C1575
:103B500083120313592503178D0A03198F0AF90BD2
:103B6000B22DB52D83160313902D0D0807390319B7
:103B7000C92D043CF900FF308C008E0083160C1513
:103B800083120313592503178D0A03198F0AF90BA2
:103B9000BB2D03130800E001DF010B138B138B1BFC
:103BA000CE2D40300C1ED22D990021300C1ED62D6A
:103BB00099008C1ADD2D6400D92D0D300C1EDE2DE0
:103BC00099000A300C1EE22D9900002578083A3C35
:103BD0000319EC2D6400E52D3A300C1EED2D9900F3
:103BE000AB012C302B0784008313EC010408EB009D
:103BF0006C10831B6C1400256B08840083136C18F5
:103C00008317780880002C302B078400831300086A
:103C1000E90069080C1E0A2E99002B08AB0A2C3EFD
:103C20008400831300080D3C03191A2E2B082D3C29
:103C30000318F12D2B082E3C0319202E0030212EC5
:103C40000130E9008316B1000130B20083120B2568
:103C50006400DA01E80103302B0268020318442EE5
:08061000B22A8A150A16E32C38
:0C39C0000A128A11B9290A168A1508009B
:1039E0008C1EF02C1808A7001A08F800A71CFA2C47
:1039F0001812181608008316B10803190F2D653028
:103A000083120C1E012D9900303083163207B3004B
:103A100083120C1E092D99008A0100288316831237
:103A200008008316B601B7013708013C031C452D79
:103A30003508FA003408840083137A1883170008C5
:103A4000403C0318322D360EB800F030B80534086B
:103A5000840083133518831700083807BF3E0A3ED9
:103A6000B6003F2D360EB800F030B805340884009B
:103A700083133518831700083807D03EB60037087F
:103A8000B70AB40A0319B50A142D3608F8008312D0
:103A900008000B08F8008B138316031755308D00B0
:103AA000AA308D008C14000000008C18552D0C11CC
:103AB0007808831203138B040800831603178C17EE
:103AC00083120D08033903197A2DF9000D08FC390A
:103AD0008D0083160C1483128D00000000008316E5
:103AE0000C1583120313492503178D0A03198F0A36
:103AF000F90B6D2D831603133008F9000310F90C30
:103B00000F30831203170D05031D902D83160C161D
:103B10000C15831203134925831603170C12831205
:103B200000088C00840A00088E00840A83160C1595
:103B300083120313492503178D0A03198F0AF90B02
:103B4000A22DA52D83160313802D0D080739031907
:103B5000B92D043CF900FF308C008E0083160C1543
:103B600083120313492503178D0A03198F0AF90BD2
:103B7000AB2D03130800E001DF010B138B138B1B2C
:103B8000BE2D40300C1EC22D990021300C1EC62DBA
:103B900099008C1ACD2D6400C92D0D300C1ECE2D30
:103BA00099000A300C1ED22D9900F02478083A3C76
:103BB0000319DC2D6400D52D3A300C1EDD2D990043
:103BC000AB012C302B0784008313EC010408EB00BD
:103BD0006C10831B6C14F0246B08840083136C1826
:103BE0008317780880002C302B078400831300088B
:103BF000E90069080C1EFA2D99002C302B0784006F
:103C0000831300080D3C03191A2E2C302B07840057
:103C1000831300080A3C03191A2E2C302B0784004A
:103C200083130008203C03191A2EAB0A2B082D3CE5
:103C30000318E12D2B082E3C0319202E0030212ED5
:103C40000130E9008316B1000130B2008312FB2479
:103C50006400DA01E80101302B0268020318442EE7
:103C60002C306807E900EA010318EA0A6A0883169B
:103C7000B500831269088316B400831221257808E1
:103C7000B500831269088316B400831211257808F1
:103C8000DA070230E8072B2EDA08031D492E003030
:103C90004A2E0130E9008316B1000230B2008312CF
:103CA0000B258316B5012E30B40083122125780828
:103CB000E9008316B5013030B4008312212569086C
:103CA000FB248316B5012E30B40083121125780849
:103CB000E9008316B5013030B4008312112569087C
:103CC000DE007808DD008316B5013230B4008312BF
:103CD00021257808DC008316B5012C30B40083124E
:103CE00021257808DB005B08103C031C792E00308E
:103CD00011257808DC008316B5012C30B40083125E
:103CE00011257808DB005B08103C031C792E00309E
:103CF0007A2E0130E9008316B1000330B20083123E
:103D00000B255D08E1005E08E2000310E20CE10C07
:103D0000FB245D08E1005E08E2000310E20CE10C18
:103D10005C0B902E23300C1E8B2E99008A010028FC
:103D2000DC08031D952E0030962E0130E900831625
:103D3000B1000430B20083120B25E801E601E50171
:103D3000B1000430B2008312FB24E801E601E50182
:103D40006208E4006108E3006808073C031CD42E05
:103D50000310680DA03E840083136608FA0065080E
:103D6000F9006408F8006308F7000130E30703185E
154,23 → 156,23
:103D7000E40A0319E50A0319E60A7A08EE0077084F
:103D800003178D000313780803178F0083168C1711
:103D90000C140000000083120C088000840A0E0836
:103DA00080000313E80AA42E0830E800E70105307C
:103DA00080000313E80AA42E0830E800E70103307E
:103DB0002B0268020318002F6708E70AA03EF800EC
:103DC000FA010318FA0A7808E9007A08EA002C30A8
:103DD0006807EB00EC010318EC0A6C088316B500C9
:103DE00083126B088316B4008312212569088400AE
:103DE00083126B088316B4008312112569088400BE
:103DF00083136A188317780880000230E807D72EEB
:103E0000E108031D1F2FE208031D1F2F1C30E200D5
:103E1000F030E100620803178F00031361080317F5
:103E1000E030E100620803178F0003136108031705
:103E20008D00A03084008313103083160313B0007C
:103E300083126D2525300C1E1B2F9900492FE20897
:103E300083125D2525300C1E1B2F9900492FE208A7
:103E4000031D262F61080F3C0318452F62081C3CF8
:103E5000031C452F031D302F6108E03C031C452F38
:103E5000031C452F031D302F6108D03C031C452F48
:103E6000620803178F000313610803178D00A03049
:103E700084008313103083160313B00083126D2562
:103E700084008313103083160313B00083125D2572
:103E800024300C1E412F9900492F2E300C1E462F36
:103E900099000D300C1E4A2F99000A300C1E4E2F2F
:103EA00099006400E52D0800AC01AB012B0F5B2FDE
:103EA00099006400D52D0800AC01AB012B0F5B2FEE
:103EB0002C0F5B2F5F2FAB0A0319AC0A562F08009B
:103EC000840183131F308305713083168F000F0820
:103ED000031787110C3003139900A230980090301B
186,15 → 188,15
:103F70000108C73908388100831290010030F80029
:103F80009200003083169200831203178701880184
:103F9000890183160313970171308F000F08831274
:103FA000AA012A0FD42FF82F8C1EE82F002578089D
:103FB000753C031DE72F2A300C1EDC2F99000025CD
:103FC0007808663C031DE62F6400CB25E82FF82F08
:103FA000AA012A0FD42FF82F8C1EE82FF0247808AE
:103FB000753C031DE72F2A300C1EDC2F9900F024DE
:103FC0007808663C031DE62F6400BB25E82FF82F18
:103FD00075300C1EE92F990066300C1EED2F9900EC
:103FE0003F300C1EF12F990054276400AA0AD12FEC
:0C3FF00064001C308A00F0308200630086
:0C3FF00064001C308A00E0308200630096
:1000080000000000000000000000000000000000E8
:080018000000000000000000E0
:04400E00FD2CFF3F47
:00000001FF
;PIC16F887
;CRC=8712 CREATED="09-IV-13 22:40"
;CRC=F083 CREATED="10-IV-13 00:15"
//Designs/Measuring_instruments/AWS01A/SW/PIC16F887/common/bloader_defs.h
1,7 → 1,7
/*------------------- BOOT LOADER Common Definitions --------------------------------------------*/
 
#define FLASH_BLOCK_SIZE getenv("FLASH_ERASE_SIZE")/2 // Minimal length of Flash Block Size
#define RESERVED_BLOCKS 49 // Number of reserved flash blocks for BootLoader
#define RESERVED_BLOCKS 50 // Number of reserved flash blocks for BootLoader
#define LOADER_RESERVED (getenv("PROGRAM_MEMORY")-(RESERVED_BLOCKS*FLASH_BLOCK_SIZE)) // begining of BootLoader
 
 
//Designs/Measuring_instruments/AWS01A/SW/PIC16F887/test_interrupt/main.c
2,19 → 2,19
 
#include "main.h"
 
#define LED PIN_A5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
#define LED PIN_E0 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
 
#int_RDA
void RDA_isr(void)
{
getc();
printf("&");
printf("!");
}
 
#int_TIMER1
void TIMER1_isr(void)
{
printf("!");
printf("*");
}
 
void main()
//Designs/Measuring_instruments/AWS01A/SW/PIC16F887/test_interrupt/main.pjt
1,5 → 1,5
[PROJECT]
Target=C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main.hex
Target=main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
12,17 → 12,50
OptionString=
AdditionalOptionString=
[mru-list]
1=C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main.c
1=main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Units]
Link=0
Count=1
1=C:\Users\kakl\Documents\PIC\meteostanice\PIC16F887\test\main
1=main.c
[Opened Files]
1=main.c
2=main.h
2=
3=..\..\..\..\..\..\..\Program Files (x86)\PICC\Devices\16F887.h
4=..\common\dbloader.h
5=..\common\bloader_defs.h
6=
[Directories]
Include=C:\Program Files (x86)\PICC\devices\;C:\Program Files (x86)\PICC\drivers\;
Library=
LinkerScript=
[defines]
enabled=0
D1=
V1=
[fileformats]
forcecoff=0
debug=4
error=2
object=0
list=0
scratch=0
sta=1
tre=1
allerrors=1
allwarnings=1
stayupne=3
stayupoe=0
[Target Data]
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
[main.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=