Pesquisar este blog

Carregando...

quinta-feira, 17 de dezembro de 2015

Mais Dispositivos I2C

Implementei junto ao programa de edição de memórias EEPROM com utilização da placa MCLAB2, a possibilidade de manipular mais dois interessantes circuitos integrados com comunicação I2C. Um deles é o PCF8574(A) da Philips que é um extensor de portas de E/S quase bidirecional, o que o torna muito útil quando se faltam portas para um microcontrolador. O outro é um sensor de campo magnético bem sensível o HMC5883L da Honeywell, muito usado em bússolas eletrônicas e com capacidade de medição de campos magnéticos em 3 eixos (x, y, z). 
Em resumo, o integrado PCF8574 possui 8 portas de E/S que podem ser escritas ou lidas através de comunicação serial I2C, além de possuir um pino de sinalização de interrupção e 3 linhas de endereçamento para identificar o ci se forem usados vários dispositivos no barramento I2C. Assim ele funciona como um conversor serial-paralelo e vice-e-versa. Como ele tem boa capacidade de corrente nas portas (25mA tanto suprindo como drenando) elas são capazes de acionar diversos dispositivos, como por exemplo, leds, muito facilmente. A velocidade para o clock do I2C deve ser de 100kHz. A diferença entre as versões 8574 e 8574A é apenas no endereçamento do dispositivo escravo.

A seguir a pinagem e o diagrama de blocos do PCF8574.


  
No diagrama de tempos do fluxo serial, demonstra qual deve ser o byte de controle enviado, sendo que para o PCF8574, o endereço escravo deve ter os 4 bits mais significativos como 0100 (e 0111 para o 8574A), seguido dos 3 bits de endereçamento de dispositivo e finalmente o bit0 significando escrita (0) ou leitura (1).  

Aqui o fluxo para escrita:


O fluxo para leitura:

Abaixo o esquema elétrico para a conexão do PIC 16F877 com o PCF8574:


No firmware, o PCF8574 passa a ser a opção de seleção número 11 no menu de seleção de dispositivos e o PCF8574A a opção 12. 
Pode-se fazer então a leitura das portas do PCF8574, ou a escrita das portas, onde se entra com o endereço do dispositivo no barramento I2C e em seguida o valor a ser escrito nas 8 portas.


O circuito integrado HMC5883L fornece a medição de campo magnético em 3 eixos, em dois registradores de 2 bytes cada, mas com 12 bits de valor, que representa uma resolução de 2 mili gauss e capacidade de medir até 8 gauss. Esse dispositivo usa tecnologia AMR (anisotropic magneto resistive). Como ele é um ci em encapsulamento smd, geralmente é mais prático utilizá-los através de pequenos módulos, em que há apenas acesso a 5 pinos (alimentação e barramento I2C).
A seguir o diagrama de blocos e interligação com o microcontrolador:


E o esquema completo:


No firmware, o HMC5883L passa a ser a opção 13 no menu de dispositivos. Como a utilização dele é apenas de leitura, na opção de leitura o display passa a apresentar de pronto os valores medidos nos 3 eixos, com polaridade N (negativo) e P (positivo).
A saída se dá pelo botão número 4.

Forneço aqui os códigos hexadecimais a serem gravados no PIC:

:10000000B2018C29B216B21EB212B2190B28B21567
:100010004420031832280830A3005920A20DA30B56
:100020000D28B21E3D2063205F20B21A32203720F7
:10003000220803108729B216B21EB21232192528DF
:10004000FE39B300321503108729321A2D28A60075
:10005000321644200318322826084C200318322870
:10006000B21E87293D20632032113212B2113608A8
:100070008400340884178004432836088400340937
:100080008005841780058729372063208B213D2038
:100090005F203308B2190138A2000830A300A20D76
:1000A00003183720031C3D2063205F20A30B4F283B
:1000B000372063203608840034080005FF3E3708E7
:1000C0008400350940283708840035083A28040898
:1000D000A70089100910091083168910091009104A
:1000E000880183122708B21890283A30A100FC300A
:1000F00012213330A600A3201030A1006830122155
:10010000A32064301121A32038308F200C308F20A1
:1001100001308F2006308F20B21427089028321427
:10012000A600321C9E280910033C031CA328A32010
:100130000730A100D0301221031408003214FE3C15
:100140000319872909148914260888003210891098
:100150003230112103140800B31329080319B3170F
:100160001030A8000301A40DA50D03180130EC20E8
:100170002808031DB2280800B31329080319B31770
:100180000430A800250EC9202508C920240EC92046
:1001900024080F39F63E0318073E0A3EEC28B31335
:1001A00029080319B3170530A8002730A300103021
:1001B000E5200330A300E830E520A3016430E5200A
:1001C000A3010A30E5202408EC28A2002508A1009C
:1001D0002408A00050212008A000A8030319B3138D
:1001E00029080319F6282802031808002008031D0F
:1001F000B313B31B0800303E822983178001840AA1
:10020000FF3E031DFE288729A301A200FF30A2079D
:10021000031CA307031C87290330A100DF30122130
:100220000629A101E83EA000A109FC30031C1B29FE
:10023000A00703181829A0076400A10F1829201887
:100240002129A01C2529000025290800A101A301BE
:10025000A20001303529A20006303529A101A301F1
:10026000A20004303529A2000530A800230821028D
:10027000031D3C2922082002043003180130031911
:1002800002302805031DFF3087290038031DFF3089
:100290000405031DFF3087290404031DFF3087294F
:1002A000A501A4011030A600210DA40DA50D220862
:1002B000A4022308031C230FA502031866292208A1
:1002C000A40723080318230FA5070310A00DA10DF1
:1002D000A60B5429200887291030A800A101A001ED
:1002E000A70CA60C031C7A292208A00723080318D0
:1002F000230FA107A10CA00CA50CA40CA80B70291E
:1003000024088729840031088A003008820083137A
:1003100003138312640008008316DF3085000F305A
:100320008600913087008801890106309F000730E0
:100330009C00831207112030840060308A01FE2067
:10034000A030840050308A01FE20103084006030DC
:100350008A01FD209030840060308A01FD20FE304B
:100360008A01682001308A01682050308A016820A3
:100370006C308A01682061308A01682063308A010C
:10038000682061308A01682020308A0168204D3061
:100390008A01682043308A0168204C308A01682035
:1003A00041308A01682042308A01682032308A0157
:1003B000682020308A01682020308A01682020309F
:1003C0008A01682020308A016820FE308A01682076
:1003D000C0308A0168204C308A01682065308A016B
:1003E00068202F308A01682067308A0168207230C7
:1003F0008A01682061308A01682076308A0168208D
:1004000061308A01682020308A01682049308A01E1
:10041000682032308A01682043308A016820203009
:100420008A01682020308A01682020308A016820F3
:10043000FE308A0168200F308A0168200330A30053
:10044000E8308A010521FE308A01682001308A01E6
:10045000682031308A0168202D308A01682073308D
:100460008A01682065308A0168206C308A01682022
:1004700020308A01682064308A01682065308A0152
:10048000682076308A01682020308A016820323066
:100490008A0168202D308A01682072308A01682024
:1004A00065308A01682061308A01682064308A01E1
:1004B0006820FE308A016820C0308A01682033300D
:1004C0008A0168202D308A01682077308A016820EF
:1004D00072308A01682069308A01682074308A018C
:1004E000682065308A01682020308A016820343015
:1004F0008A0168202D308A01682065308A016820D1
:1005000072308A01682061308A01682073308A0164
:10051000682065308A01682064008A110A12061872
:10052000992AFA308A0104210130CE008A110A1278
:10053000BC2A64008A110A128618A42AFA308A0199
:1005400004218A150A121A2B64008A110A1206194C
:10055000AF2AFA308A0104218A150A12162F640084
:100560008A110A128619BA2AFA308A0104218A11DC
:100570000A16C32A8A018C2AFE308A0168200130BB
:100580008A01682053308A01682065308A0168201A
:100590006C308A01682065308A01682063308A01E6
:1005A000682074308A01682020308A016820643015
:1005B0008A01682065308A01682076308A016820C7
:1005C00069308A01682063308A01682065308A01B9
:1005D00068203A308A01682020308A016820203063
:1005E0008A016820FE308A016820C0308A016820B4
:1005F0003D308A0168208A110A12342364008A116E
:100600000A120618122BFA308A010421CE03640064
:100610004E08003C8A110A12031D102B0D30CE002B
:100620008A01F22A64008A110A128618262BFA30EF
:100630008A010421CE0A64004E080E3C8A110A1277
:10064000031D242B0130CE008A01F22A64008A1196
:100650000A128619322B0130A3005E308A0105216F
:100660008A01AF298A01FE2A64004E08013C8A11E2
:100670000A12031D642BFE308A016820C0308A01F3
:1006800068203D308A01682032308A016820343089
:100690008A0168204C308A01682043308A01682032
:1006A00030308A01682031308A01682020308A0188
:1006B000682020308A01682020308A016820A0301C
:1006C000CB007F30BA00BB0164004E08023C8A11A7
:1006D0000A12031D942BFE308A016820C0308A0163
:1006E00068203D308A01682032308A016820343029
:1006F0008A0168204C308A01682043308A016820D2
:1007000030308A01682032308A01682020308A0126
:10071000682020308A01682020308A016820A030BB
:10072000CB00FF30BA00BB0164004E08033C8A11C5
:100730000A12031DC52BFE308A016820C0308A01D1
:1007400068203D308A01682032308A0168203430C8
:100750008A0168204C308A01682043308A01682071
:1007600030308A01682034308A01682020308A01C4
:10077000682020308A01682020308A016820A0305B
:10078000CB00FF30BA000130BB0064004E08043CCF
:100790008A110A12031DF62BFE308A016820C03030
:1007A0008A0168203D308A01682032308A01682041
:1007B00034308A0168204C308A01682043308A0135
:1007C000682030308A01682038308A016820203063
:1007D0008A01682020308A01682020308A01682040
:1007E000A030CB00FF30BA000330BB0064004E08DD
:1007F000053C8A110A12031D272CFE308A0168204D
:10080000C0308A0168203D308A01682032308A0178
:10081000682034308A0168204C308A0168204330D7
:100820008A01682031308A01682036308A016820C8
:1008300020308A01682020308A01682020308A0117
:100840006820A030CB00FF30BA000730BB00640046
:100850004E08063C8A110A12031D582CFE308A01EC
:100860006820C0308A0168203D308A01682032301B
:100870008A01682034308A0168204C308A0168205F
:1008800043308A01682033308A01682032308A017F
:10089000682020308A01682020308A0168202030BA
:1008A0008A016820A030CB00FF30BA000F30BB00B7
:1008B00064004E08073C8A110A12031D892CA030DF
:1008C000CB00FE308A016820C0308A0168203D30AC
:1008D0008A01682032308A01682034308A01682019
:1008E0004C308A01682043308A01682036308A0102
:1008F000682034308A01682020308A016820203046
:100900008A01682020308A016820FF30BA001F3039
:10091000BB0064004E08083C8A110A12031DB82C63
:10092000FE308A016820C0308A0168203D308A018B
:10093000682032308A01682034308A0168204C30C7
:100940008A01682043308A01682031308A0168209A
:1009500032308A01682038308A01682020308A01CC
:10096000682020308A016820FF30BA003F30BB0089
:1009700064004E08093C8A110A12031DE72CFE3060
:100980008A016820C0308A0168203D308A016820D1
:1009900032308A01682034308A0168204C308A0164
:1009A000682043308A01682032308A01682035305F
:1009B0008A01682036308A01682020308A01682048
:1009C00020308A016820FF30BA007F30BB0064000D
:1009D0004E080A3C8A110A12031D162DFE308A01A8
:1009E0006820C0308A0168203D308A01682032309A
:1009F0008A01682034308A0168204C308A016820DE
:100A000043308A01682035308A01682031308A01FC
:100A1000682032308A01682020308A016820203026
:100A20008A016820FF30BA00FF30BB0064004E0826
:100A30000B3C8A110A12031D432DFE308A016820E7
:100A4000C0308A0168203D308A01682050308A0118
:100A5000682043308A01682046308A016820383097
:100A60008A01682035308A01682037308A01682081
:100A700034308A01682020308A01682020308A01C1
:100A800068204030CB0064004E080C3C8A110A12EA
:100A9000031D702DFE308A016820C0308A01682055
:100AA0003D308A01682050308A01682043308A0135
:100AB000682046308A01682038308A016820353045
:100AC0008A01682037308A01682034308A01682022
:100AD00041308A01682020308A0168207030CB00C4
:100AE00064004E080D3C8A110A12031D9B2DFE3036
:100AF0008A016820C0308A0168203D308A01682060
:100B000048308A0168204D308A01682043308A01CC
:100B1000682035308A01682038308A0168203830F2
:100B20008A01682033308A0168204C308A016820AD
:100B300020308A0168200800FE308A0168200F30CA
:100B40008A016820FE308A01682001308A0168200D
:100B500045308A0168206E308A01682074308A012D
:100B6000682065308A01682072308A016820203050
:100B70008A01682061308A01682064308A01682017
:100B800064308A01682072308A01682065308A01E9
:100B9000682073308A01682073308A0168203A30F7
:100BA0008A01682020308A01682020308A0168206C
:100BB00064000B304E028A110A120318E22D8A11CA
:100BC0000A12592ECA01FE308A016820C0308A01FB
:100BD00068203D308A016820A9014A08A400A501C7
:100BE0006730B000B1018A01CF20FE308A01682051
:100BF000C1308A01682064008A110A120618252E65
:100C0000FA308A010421CA0364004A08FF3C8A11B1
:100C10000A12031D0D2E0730CA00FE308A0168201B
:100C2000C0308A0168203D308A016820A9014A0845
:100C3000A400A5016730B000B1018A01CF20FE30C9
:100C40008A016820C1308A01682064008A110A1272
:100C500086184E2EFA308A010421CA0A64004A0816
:100C6000083C8A110A12031D362ECA01FE308A0181
:100C70006820C0308A0168203D308A016820A901BF
:100C80004A08A400A5016730B000B1018A01CF2055
:100C9000FE308A016820C1308A01682064008A1110
:100CA0000A128619572EFA308A01042108008A0197
:100CB000FB2DA6011030A7005408A200A3018A0151
:100CC0006C21BC002508BD00A6010130A700530817
:100CD000A200A3018A016C21BE002508BF003C08C8
:100CE000BE073D080318013EBF071030A600A7014C
:100CF0005208A200A3018A016C21C0002508C1008E
:100D00003E08C0073F080318013EC10751084007CD
:100D1000B80041080318013EB900FE308A0168207E
:100D2000C0308A0168203D308A0168200430A90063
:100D30003808A4003908A5006730B000B1018A0165
:100D4000BC2020308A0168200530A9003808A400A2
:100D50003908A5006730B000B1018A01CF20FE300C
:100D60008A016820C1308A01682064008A110A1251
:100D70000618232FFA308A010421D4036400540892
:100D8000FF3C8A110A12031DC72E0F30D400A601A2
:100D90001030A7005408A200A3018A016C21BC00F6
:100DA0002508BD00A6010130A7005308A200A30139
:100DB0008A016C21BE002508BF003C08BE073D0823
:100DC0000318013EBF071030A600A7015208A20079
:100DD000A3018A016C21C0002508C1003E08C0079C
:100DE0003F080318013EC10751084007B8004108F9
:100DF0000318013EB900FE308A016820C0308A0124
:100E000068203D308A0168200430A9003808A40019
:100E10003908A5006730B000B1018A01BC2020303C
:100E20008A0168200530A9003808A4003908A50007
:100E30006730B000B1018A01CF20FE308A016820FE
:100E4000C1308A01682064008A110A128618902F26
:100E5000FA308A010421D40A64005408103C8A1133
:100E60000A12031D342FD401A6011030A700540824
:100E7000A200A3018A016C21BC002508BD00A601C7
:100E80000130A7005308A200A3018A016C21BE0013
:100E90002508BF003C08BE073D080318013EBF07F8
:100EA0001030A600A7015208A200A3018A016C21FC
:100EB000C0002508C1003E08C0073F080318013ED6
:100EC000C10751084007B80041080318013EB900A6
:100ED000FE308A016820C0308A0168203D308A01D6
:100EE00068200430A9003808A4003908A50067303C
:100EF000B000B1018A01BC2020308A016820053091
:100F0000A9003808A4003908A5006730B000B10175
:100F10008A01CF20FE308A016820C1308A01682012
:100F200064008A110A120619A12FFA308A010421DD
:100F3000FE308A01682014308A0168208A110A1262
:100F4000A32F8A01B52E64008A150A1206181128EB
:100F5000FA308A010421D30364005308FF3C8A114C
:100F60000A12031DB52F0F30D300A6011030A700C1
:100F70005408A200A3018A016C21BC002508BD0011
:100F8000A6010130A7005308A200A3018A016C2129
:100F9000BE002508BF003C08BE073D080318013EFF
:100FA000BF071030A600A7015208A200A3018A01C2
:100FB0006C21C0002508C1003E08C0073F08031887
:100FC000013EC10751084007B80041080318013E1F
:100FD000B900FE308A016820C0308A0168203D30A7
:100FE0008A0168200430A9003808A4003908A50047
:100FF0006730B000B1018A01BC2020308A0168202E
:101000000530A9003808A4003908A5006730B000F1
:10101000B1018A01CF20FE308A016820C2308A01E6
:10102000682064008A150A1286187E28FA308A0120
:101030000421D30A64005308103C8A150A12031DC8
:101040002228D301A6011030A7005408A200A30152
:101050008A016C21BC002508BD00A6010130A70053
:101060005308A200A3018A016C21BE002508BF001D
:101070003C08BE073D080318013EBF071030A6001C
:10108000A7015208A200A3018A016C21C000250813
:10109000C1003E08C0073F080318013EC1075108C0
:1010A0004007B80041080318013EB900FE308A012C
:1010B0006820C0308A0168203D308A0168200430F1
:1010C000A9003808A4003908A5006730B000B101B4
:1010D0008A01BC2020308A0168200530A900380828
:1010E000A4003908A5006730B000B1018A01CF2003
:1010F000FE308A016820C2308A01682064008A15A7
:101100000A1206198F28FA308A010421FE308A015A
:10111000682014308A0168208A150A1291288A01F1
:10112000A32F64008A150A120618FF28FA308A01D4
:101130000421D20364005208FF3C8A150A12031DE1
:10114000A3280F30D200A6011030A7005408A20037
:10115000A3018A016C21BC002508BD00A601013055
:10116000A7005308A200A3018A016C21BE00250834
:10117000BF003C08BE073D080318013EBF07103002
:10118000A600A7015208A200A3018A016C21C00099
:101190002508C1003E08C0073F080318013EC107EB
:1011A00051084007B80041080318013EB900FE305D
:1011B0008A016820C0308A0168203D308A01682099
:1011C0000430A9003808A4003908A5006730B00031
:1011D000B1018A01BC2020308A0168200530A900B5
:1011E0003808A4003908A5006730B000B1018A01B1
:1011F000CF20FE308A016820C3308A016820640055
:101200008A150A1286186C29FA308A010421D20A3A
:1012100064005208103C8A150A12031D1029D201DD
:10122000A6011030A7005408A200A3018A016C2176
:10123000BC002508BD00A6010130A7005308A2008C
:10124000A3018A016C21BE002508BF003C08BE072F
:101250003D080318013EBF071030A600A701520841
:10126000A200A3018A016C21C0002508C1003E082C
:10127000C0073F080318013EC10751084007B800E6
:1012800041080318013EB900FE308A016820C030D1
:101290008A0168203D308A0168200430A90038089E
:1012A000A4003908A5006730B000B1018A01BC2054
:1012B00020308A0168200530A9003808A4003908C8
:1012C000A5006730B000B1018A01CF20FE308A014D
:1012D0006820C3308A01682064008A150A12061942
:1012E0007D29FA308A010421FE308A0168201430F9
:1012F0008A0168208A150A1280298A150A12912803
:1013000064008A150A120618EE29FA308A010421AF
:10131000D10364005108FF3C8A150A12031D92296B
:101320000F30D100A6011030A7005408A200A3017D
:101330008A016C21BC002508BD00A6010130A70070
:101340005308A200A3018A016C21BE002508BF003A
:101350003C08BE073D080318013EBF071030A60039
:10136000A7015208A200A3018A016C21C000250830
:10137000C1003E08C0073F080318013EC1075108DD
:101380004007B80041080318013EB900FE308A0149
:101390006820C0308A0168203D308A01682004300E
:1013A000A9003808A4003908A5006730B000B101D1
:1013B0008A01BC2020308A0168200530A900380845
:1013C000A4003908A5006730B000B1018A01CF2020
:1013D000FE308A016820C4308A01682064008A15C2
:1013E0000A1286185B2AFA308A010421D10A6400A5
:1013F0005108103C8A150A12031DFF29D101A601CC
:101400001030A7005408A200A3018A016C21BC007F
:101410002508BD00A6010130A7005308A200A301C2
:101420008A016C21BE002508BF003C08BE073D08AC
:101430000318013EBF071030A600A7015208A20002
:10144000A3018A016C21C0002508C1003E08C00725
:101450003F080318013EC10751084007B800410882
:101460000318013EB900FE308A016820C0308A01AD
:1014700068203D308A0168200430A9003808A400A3
:101480003908A5006730B000B1018A01BC202030C6
:101490008A0168200530A9003808A4003908A50091
:1014A0006730B000B1018A01CF20FE308A01682088
:1014B000C4308A01682064008A150A1206196C2A51
:1014C000FA308A010421FE308A01682014308A0132
:1014D00068208A150A126F2A8A150A128029A60125
:1014E0001030A7005408A200A3018A016C21BC009F
:1014F0002508BD00A6010130A7005308A200A301E2
:101500008A016C21BE002508BF003C08BE073D08CB
:101510000318013EBF071030A600A7015208A20021
:10152000A3018A016C21C0002508C1003E08C00744
:101530003F080318013EC10751084007B8004108A1
:101540000318013EB9003808A0003908A1003B0883
:10155000A3003A088A012B218A150A12031D192BB0
:10156000FE308A01682001308A01682049308A01F2
:1015700068206E308A01682076308A0168206130E8
:101580008A0168206C308A01682069308A016820ED
:1015900064308A01682020308A01682061308A0125
:1015A000682064308A01682064308A0168207230C3
:1015B0008A01682065308A01682073308A016820BA
:1015C00073308A01682020308A016820FE308A0149
:1015D0006820C0308A0168204D308A01682061305F
:1015E0008A01682078308A01682020308A016820CA
:1015F00061308A01682064308A01682064308A0181
:10160000682072308A0168203D308A0168200530E8
:10161000A9003A08A4003B08A5006730B000B1015A
:101620008A01CF200B30A300B8308A0105218A013E
:101630009C2D080064000B304E028A150A12031814
:10164000242B8A150A12C52B64004E080D3C8A15FE
:101650000A12031D2E2B8A150A12022D8A019C25BF
:101660004B144A18CB144A1CCB10CA184B15CA1C71
:101670004B114A19CB154A1DCB110730B60010305B
:10168000B4000730B7000830B5004B088A011D20B0
:101690008A010220CD00FE308A01682001308A01D3
:1016A000682044308A01682061308A0168207430E3
:1016B0008A01682061308A01682020308A01682010
:1016C00066308A01682072308A0168206F308A0192
:1016D00068206D308A01682020308A0168207030CF
:1016E0008A0168206F308A01682072308A01682080
:1016F00074308A01682073308A0168203A308A0188
:101700006820FE308A016820C0308A016820643079
:101710008A01682061308A01682074308A0168205B
:1017200061308A0168203D308A0168200230A900BA
:101730004D08A400A5016730B000B1018A01BC20AA
:1017400020308A0168200830A9004D08A400A501B6
:101750006730B000B1018A01AC2064008A150A121A
:101760008619B72BFA308A0104218A01AF29640057
:101770008A150A120619C22BFA308A0104218A1529
:101780000A12302B8A150A12AD2B8A019C254B14A4
:10179000FE308A01682001308A01682061308A01A8
:1017A000682064308A01682064308A0168207230C1
:1017B0008A0168203D308A0168200430A900380879
:1017C000A4003908A5006730B000B1018A01BC202F
:1017D00020308A0168200530A9003808A4003908A3
:1017E000A5006730B000B1018A01CF20640003304A
:1017F0004E028A150A1203180E2C0730B60010305C
:10180000B4000730B7000830B5004B088A011D202E
:1018100038088A011D208A010220D6004E08033CA8
:10182000031DFF30FF3ABC004E08043C031DFF308F
:10183000FF3ABE003C0884003E088A014C21BE00ED
:10184000BF004E08053C031DFF30FF3AC0003E08B4
:101850003F04840040088A014C21C000C10064009C
:10186000400841048A150A120319532C3918CB1465
:10187000391CCB10B9184B15B91C4B113919CB15A4
:10188000391DCB110730B6001030B4000730B70057
:101890000830B5004B088A011D2038088A011D2038
:1018A0008A010220D6004E08A00005308A012621B8
:1018B000BC004E08A0000B308A012E21BE003C085F
:1018C00084003E088A014521BE00BF0064003E0836
:1018D0003F048A150A120319812C0730B600103014
:1018E000B4000730B7000830B5004B088A011D204E
:1018F00039088A011D2038088A011D208A0102202A
:10190000D600FE308A016820C0308A016820643029
:101910008A01682061308A01682074308A01682059
:1019200061308A0168203D308A0168200230A900B8
:101930005608A400A5016730B000B1018A01BC209F
:1019400020308A0168200330A9005608A400A501B0
:101950006730B000B1018A01CF2064008A150A12F5
:101960000618D62CFA308A0104210130B802003062
:10197000031C013EB902FF30A000FF30A10039086E
:10198000A30038088A0133218A150A12031DD32CBB
:1019900064000A304E028A150A120318D32C3A0842
:1019A000B8003B08B9008A150A12C72B64008A15D3
:1019B0000A128618F32CFA308A010421B80A031996
:1019C000B90A3808A0003908A1003B08A3003A086A
:1019D0008A012B218A150A12031DF02CB801B901C6
:1019E0008A150A12C72B64008A150A128619FF2C61
:1019F0000130A3005E308A0105218A01AF298A15D2
:101A00000A12AD2C0A308A010421B801B90107304D
:101A1000B6001030B4000730B7000830B5003C30D5
:101A20008A011D2038088A011D2070308A011B2080
:101A300064308A0104210130B800B9010730B600D2
:101A40001030B4000730B7000830B5003C308A01D0
:101A50001D2038088A011D20E0308A011B206430D7
:101A60008A0104210230B800B9010730B6001030F5
:101A7000B4000730B7000830B5003C308A011D20A3
:101A800038088A011D2000308A011B20FE308A019F
:101A9000682001308A0168204D308A016820653055
:101AA0008A01682064308A01682069308A016820D0
:101AB00064308A0168206F308A01682072308A01A0
:101AC000682020308A0168204D308A01682061300A
:101AD0008A01682067308A0168206E308A01682098
:101AE00065308A01682074308A01682069308A0173
:101AF000682063308A0168200130A300F4308A0135
:101B000005210330B800B9010730B6001030B40029
:101B10000730B7000830B5003D308A011D20380875
:101B20008A011D208A010220C30014308A01042189
:101B30000430B800B9010730B6001030B4000730E7
:101B4000B7000830B5003D308A011D2038088A01F1
:101B50001D208A010220C20014308A0104210530B0
:101B6000B800B9010730B6001030B4000730B70034
:101B70000830B5003D308A011D2038088A011D203B
:101B80008A010220C70014308A0104210630B800FF
:101B9000B9010730B6001030B4000730B700083084
:101BA000B5003D308A011D2038088A011D208A01B8
:101BB0000220C60014308A0104210730B800B901A0
:101BC0000730B6001030B4000730B7000830B50059
:101BD0003D308A011D2038088A011D208A0102201B
:101BE000C90014308A0104210830B800B901073057
:101BF000B6001030B4000730B7000830B5003D30F3
:101C00008A011D2038088A011D208A010220C8008F
:101C10004208A0004308A1007F30A300FF308A01E2
:101C20002B218A150A12031D212E4208003CC200F6
:101C30004308031C013E003CC30055148A150A12D8
:101C4000222E55104608A0004708A1007F30A300AF
:101C5000FF308A012B218A150A12031D3B2E4608EC
:101C6000003CC6004708031C013E003CC700D514D9
:101C70008A150A123C2ED5104808A0004908A10078
:101C80007F30A300FF308A012B218A150A12031D21
:101C9000552E4808003CC8004908031C013E003C82
:101CA000C90055158A150A12562E551164008A1559
:101CB0000A125519742EFE308A01682001308A01FB
:101CC00068205A308A0168203D308A016820A901C5
:101CD0004808A4004908A5006730B000B1018A0196
:101CE000CF2050308A01682064008A150A12551DE1
:101CF000922EFE308A01682001308A0168205A3015
:101D00008A0168203D308A016820A9014808A400A2
:101D10004908A5006730B000B1018A01CF204E30DC
:101D20008A01682064008A150A125518B02EFE3008
:101D30008A016820C0308A01682058308A016820F2
:101D40003D308A016820A9014208A4004308A5008B
:101D50006730B000B1018A01CF2050308A0168207D
:101D600064008A150A12551CCE2EFE308A016820A6
:101D7000C0308A01682058308A0168203D308A01CD
:101D80006820A9014208A4004308A5006730B000FC
:101D9000B1018A01CF204E308A01682064008A1583
:101DA0000A12D518E92E20308A01682059308A019C
:101DB00068203D308A016820A9014608A400470830
:101DC000A5006730B000B1018A01CF2050308A01F0
:101DD000682064008A150A12D51C042F20308A015D
:101DE000682059308A0168203D308A016820A901A5
:101DF0004608A4004708A5006730B000B1018A0179
:101E0000CF204E308A01682064008A150A12861994
:101E10000E2FFA308A0104218A01AF290130A30074
:101E20002C308A0105218A150A12812D8A019C25F0
:101E300064000B304E028A150A120318222F8A11F1
:101E40000A16672864004E080D3C8A150A12031D05
:101E50002B2F8A01AF294B104A18CB144A1CCB10E8
:101E6000CA184B15CA1C4B114A19CB154A1DCB1168
:101E7000FE308A01682001308A01682044308A01DE
:101E8000682061308A01682074308A0168206130DE
:101E90008A01682020308A01682074308A01682015
:101EA0006F308A01682020308A01682070308A01F2
:101EB00068206F308A01682072308A01682074308F
:101EC0008A01682073308A0168203A308A016820CC
:101ED00020308A01682020308A016820FE308A0183
:101EE0006820C0308A01682064308A01682061302F
:101EF0008A01682074308A01682061308A01682074
:101F00003D308A0168200230A9005608A400A501CE
:101F10006730B000B1018A01BC2020308A016820FE
:101F20000830A9005608A400A5016730B000B1012F
:101F30008A01AC2064008A150A120618AE2FFA3006
:101F40008A010421D00A64005008103C8A150A1244
:101F5000031DAB2FD0018A150A12F62764008A15DB
:101F60000A128618C22FFA308A010421CF0A6400AF
:101F70004F08103C8A150A12031DBF2FCF018A1586
:101F80000A12F62764008A150A128619CC2FFA3035
:101F90008A0104218A01AF2964008A150A120619F0
:101FA000F32FFA308A0104211030A600A70150084F
:101FB000A200A3018A016C21BC002508BD003C08D9
:101FC0004F07D6000730B6001030B4000730B70016
:101FD0000830B5004B088A011D2056088A011B20D5
:101FE0008A150A122B2F8A150A129A2F1030A60072
:101FF000A7015008A200A3018A016C21BC0025089A
:10200000BD003C084F07D600FE308A016820C03072
:102010008A01682064308A01682061308A01682062
:1020200074308A01682061308A0168203D308A015D
:1020300068200230A9005608A400A5016730B0004E
:10204000B1018A01BC2020308A0168200830A90033
:102050005608A400A5016730B000B1018A01AC2088
:10206000FE308A01682010308A016820FE308A0123
:10207000682010308A016820FE308A016820103004
:102080008A016820FE308A01682010308A016820A9
:10209000FE308A01682010308A016820FE308A01F3
:1020A000682010308A016820FE308A0168201030D4
:1020B0008A016820FE308A01682010308A01682079
:1020C000FE308A01682010308A0168200800143030
:1020D0008A0104214B14FE308A01682001308A01F4
:1020E000682061308A01682064308A016820643089
:1020F0008A01682072308A0168203D308A01682098
:102100000430A9003808A4003908A5006730B000E1
:10211000B1018A01BC2020308A0168200530A90065
:102120003808A4003908A5006730B000B1018A0161
:10213000CF20640003304E028A110A160318B1281A
:102140000730B6001030B4000730B7000830B500D3
:102150004B088A011D2038088A011D208A010220AF
:10216000D6004E08033C031DFF30FF3ABC004E086A
:10217000043C031DFF30FF3ABE003C0884003E08CB
:102180008A014C21BE00BF004E08053C031DFF30F4
:10219000FF3AC0003E083F04840040088A014C21F9
:1021A000C000C1006400400841048A110A160319E6
:1021B000F6283918CB14391CCB10B9184B15B91C9B
:1021C0004B113919CB15391DCB110730B600103022
:1021D000B4000730B7000830B5004B088A011D2055
:1021E00038088A011D208A010220D6004E08A0006E
:1021F00005308A012621BC004E08A0000B308A0160
:102200002E21BE003C0884003E088A014521BE0004
:10221000BF0064003E083F048A110A1603192429EE
:102220000730B6001030B4000730B7000830B500F2
:102230004B088A011D2039088A011D2038088A01AF
:102240001D208A010220D600FE308A016820C0309D
:102250008A01682064308A01682061308A01682020
:1022600074308A01682061308A0168203D308A011B
:1022700068200230A9005608A400A5016730B0000C
:10228000B1018A01BC2020308A0168200330A900F6
:102290005608A400A5016730B000B1018A01CF2023
:1022A000FE308A01682010308A016820FE308A01E1
:1022B000682010308A016820FE308A0168201030C2
:1022C0008A016820FE308A01682010308A01682067
:1022D0005608A000A1011030A200A3018A015021DC
:1022E000D0005008A600A7011030A200A3018A0167
:1022F0006C21BC002508BD003C085602CF006400DC
:102300008A110A1606189329FA308A010421D00A84
:1023100064005008103C8A110A16031D9029D00150
:102320008A110A16702264008A110A168618A729D3
:10233000FA308A010421CF0A64004F08103C8A1148
:102340000A16031DA429CF018A110A1670226400FF
:102350008A110A160619612A4B10FA308A010421E3
:102360001030A600A7015008A200A3018A016C2129
:10237000BC002508BD003C084F07D60064000330B0
:102380004E028A110A160318D6290730B6001030FB
:10239000B4000730B7000830B5004B088A011D2093
:1023A00038088A011D2056088A011B204E08033C6C
:1023B000031DFF30FF3ABC004E08043C031DFF30F4
:1023C000FF3ABE003C0884003E088A014C21BE0052
:1023D000BF004E08053C031DFF30FF3AC0003E0819
:1023E0003F04840040088A014C21C000C100640001
:1023F000400841048A110A1603191B2A3918CB1404
:10240000391CCB10B9184B15B91C4B113919CB1508
:10241000391DCB110730B6001030B4000730B700BB
:102420000830B5004B088A011D2038088A011D209C
:1024300056088A011B204E08A00005308A0126217B
:10244000BC004E08A0000B308A012E21BE003C08C3
:1024500084003E088A014521BE00BF0064003E089A
:102460003F048A110A160319492A0730B6001030B2
:10247000B4000730B7000830B5004B088A011D20B2
:1024800039088A011D2038088A011D2056088A0152
:102490001B20B80A0319B90A3808A0003908A1009E
:1024A0003B08A3003A088A0133218A110A16031D4A
:1024B0005B2AB801B90114308A0104218A110A1675
:1024C000672864008A110A1686196D2A0130A30054
:1024D0005E308A0105218A01AF298A110A167F29F7
:1024E0001030A600A7015008A200A3018A016C21A8
:1024F000BC002508BD003C084F07D600FE308A010D
:102500006820C0308A01682064308A016820613008
:102510008A01682074308A01682061308A0168204D
:102520003D308A0168200230A9005608A400A501A8
:102530006730B000B1018A01BC2020308A016820D8
:102540000330A9005608A400A5016730B000B1010E
:102550008A01CF20FE308A01682010308A0168206D
:10256000FE308A01682010308A016820FE308A011E
:10257000682010308A016820FE308A0168201030FF
:102580008A016820080064000B304E028A110A1686
:10259000031CCC2A8A01AF294B10FE308A01682027
:1025A00001308A01682045308A01682072308A0132
:1025B000682061308A01682073308A0168206930A0
:1025C0008A0168206E308A01682067308A0168209D
:1025D00020308A0168206D308A01682065308A01C8
:1025E00068206D308A0168206F308A01682072305F
:1025F0008A01682079308A01682020308A016820A9
:1026000020308A016820FE308A016820C0308A01AB
:10261000682043308A0168206F308A0168206E305C
:102620008A01682066308A01682069308A01682042
:1026300072308A0168206D308A01682020308A015A
:1026400068203F308A01682020308A0168204230AB
:102650008A01682075308A01682074308A016820F8
:1026600031308A01682020308A01682020308A01B8
:10267000682064008A110A160618442BFA308A0171
:1026800004218A110A16512B64008A110A16861831
:102690004E2BFA308A0104218A01AF298A110A16C9
:1026A000392BFE308A01682001308A0168204530CC
:1026B0008A01682072308A01682061308A016820AE
:1026C00073308A01682069308A0168206E308A017F
:1026D000682067308A01682020308A0168206D30C8
:1026E0008A01682065308A0168206D308A0168207F
:1026F0006F308A01682072308A01682079308A013F
:10270000682020308A01682020308A016820FE304D
:102710008A016820C0308A01682057308A01682009
:1027200061308A01682069308A01682074308A012A
:10273000682020308A01682020308A0168202030FB
:102740008A01682020308A01682020308A016820B0
:1027500020308A01682020308A01682020308A01D8
:10276000682020308A01682020308A0168202030CB
:102770008A01682020308A016820C401C50144080C
:10278000A0004508A1003B08A3003A088A012821BF
:102790008A110A16031D632CFF30D6006400033033
:1027A0004E028A110A160318E62B0730B6001030C5
:1027B000B4000730B7000830B5004B088A011D206F
:1027C00044088A011D2056088A011B204E08033C3C
:1027D000031DFF30FF3ABC004E08043C031DFF30D0
:1027E000FF3ABE003C0884003E088A014C21BE002E
:1027F000BF004E08053C031DFF30FF3AC0003E08F5
:102800003F04840040088A014C21C000C1006400DC
:10281000400841048A110A1603192B2C4518CB14C1
:10282000451CCB10C5184B15C51C4B114519CB15B4
:10283000451DCB110730B6001030B4000730B7008B
:102840000830B5004B088A011D2044088A011D206C
:1028500056088A011B204E08A00005308A01262157
:10286000BC004E08A0000B308A012E21BE003C089F
:1028700084003E088A014521BE00BF0064003E0876
:102880003F048A110A160319592C0730B60010307C
:10289000B4000730B7000830B5004B088A011D208E
:1028A00045088A011D2044088A011D2056088A0116
:1028B0001B2014308A010421C40A0319C50A8A1195
:1028C0000A16031DBF2BFE308A01682001308A01E1
:1028D00068204D308A01682065308A0168206D309B
:1028E0008A0168206F308A01682072308A0168206E
:1028F00079308A01682020308A01682065308A0199
:10290000682072308A01682061308A016820733043
:102910008A01682065308A01682064308A01682055
:1029200020308A01682020308A01682020308A0106
:102930006820FE308A016820C0308A01682050304B
:102940008A01682072308A01682065308A01682017
:1029500073308A01682073308A01682020308A0130
:10296000682042308A01682075308A0168207430FE
:102970008A01682074308A0168206F308A016820DB
:102980006E308A01682020308A01682034308A0144
:10299000682020308A01682020308A016820640085
:1029A0008A110A168619DB2C0130A30090308A01A7
:1029B00005218A01AF298A110A16CF2C63008A11DA
:0429C0000A16DE2CE9
:02400E00313F40
:00000001FF


segunda-feira, 14 de dezembro de 2015

Extensão do Decodificador BCD para display de 7 segmentos


Utilizei o mesmo PIC 16F676 para um decodificador para apresentar caracteres alfanuméricos em displays de led de 7 segmentos. Para tanto é necessário o uso de mais uma porta para entrar o código binário (agora não mais BCD) de 5 bits, o que permite 32 combinações. Dada a limitação dos displays de 7 segmentos, nem todos caracteres alfanuméricos são possíveis de ser reproduzidos, tais como o "k", "m", "w", "z", "x", e o "q" pra não confundir com o "9".



Segue a tabela com os códigos de entrada na PORT A:
PORT A  
4 3 2 1 0  Caractere
0 0 0 0 0   0
0 0 0 0 1   1
0 0 0 1 0   2
0 0 0 1 1   3
0 0 1 0 0   4
0 0 1 0 1   5
0 0 1 1 0   6
0 0 1 1 1   7
0 1 0 0 0   8
0 1 0 0 1   9
0 1 0 1 0   A
0 1 0 1 1   b
0 1 1 0 0   C 
0 1 1 0 1   d
0 1 1 1 0   E
0 1 1 1 1   F
1 0 0 0 0   g
1 0 0 0 1   H
1 0 0 1 0   i
1 0 0 1 1   J
1 0 1 0 0   L
1 0 1 0 1   n
1 0 1 1 0   o
1 0 1 1 1   P
1 1 0 0 0   r
1 1 0 0 1   t
1 1 0 1 0   u
1 1 0 1 1   y
1 1 1 0 0   -
1 1 1 0 1   =
1 1 1 1 0   [
1 1 1 1 1   ]

Com a utilização de mais um bit de entrada, a seleção de saídas para catodo comum ou anodo comum deixa de existir e o decodificador só funciona para catodo comum.

Os códigos Hexa estão a seguir:
:100000002E288001840AFF3E031D01282928A30110
:10001000A200FF30A207031CA307031C29280330FA
:10002000A100DF3015200928A101E83EA000A109A8
:10003000FC30031C1E28A00703181B28A00764001F
:10004000A10F1B2820182428A01C282800002828DD
:10005000080083130313831264000800073099001B
:1000600083161F30850087019101203084004030C5
:1000700083120120BC01640020303C02031849288F
:100080003C08B80058200130A300F4300820BC0F11
:100090003B280830B8001F300505B8006400380858
:1000A0003902031D54284B283808B90058204B2822
:1000B00038081F3C031C86285F20870086280030F4
:1000C0008A003808663E03188A0A82001F34033407
:1000D0002D342734333436343E3403343F34333410
:1000E0003B343E341C342F343C34383437343B34C6
:1000F00002340F341C342A342E34393428343C343E
:100100000E343734203424341C34073438081F3C70
:10011000031CB8289120013903198512031D851687
:10012000B82800308A003808983E03188A0A8200EE
:100130000134003401340134003401340134013419
:100140000134013401340034013400340134013409
:1001500001340034003400340034003400340134FD
:1001600000340034003400340034003401340134ED
:0601700008006300B9283D
:02400E00C43FAD
:00000001FF

E um pequeno vídeo de demonstração dos caracteres gerados:

video


domingo, 22 de novembro de 2015

Cálculo de resposta de Filtro RC simples


Um dos circuitos mais utilizados em áudio são as etapas de filtro RC, muito usadas como filtro passa-altas ou passa-baixas e como acoplamentos de estágios. A frequência de corte é calculada simplesmente utilizando-se a fórmula  Fc = 1 / (2 x p x R x C).
Entretanto às vezes é interessante sabermos a resposta do circuito a diversas frequências, plotando-se um gráfico de amplitude e fase do sinal de saída versus a frequência do sinal. Esses valores são encontrados através de cálculos com valores de impedância complexa, onde  o capacitor assume valores diferentes de acordo com a frequência.  Um capacitor assume uma reatância calculada através da fórmula Xc = 1 / (2 x p x F x C) que depois resulta num valor de impedância complexa  Zc = 1 / (j x 2 x p x F x C). O termo  2 x p x F pode assumir uma forma simplificada sendo chamado de velocidade angular, representada pelo símbolo w (ômega).
Assim, a impedância do capacitor é dada pela fórmula:  Zc = 1 / (jwC) que  multiplicada no numerador e denominador por  j, resulta em Zc = -j / (wC)
O filtro RC representa então uma impedância de uma associação em série de um resistor e um capacitor, com valor igual a  Zt = R - j / (wC).
Para se calcular a resposta do filtro, pegamos a tensão e fase sobre o resistor (para filtros passa-altas) ou a tensão e fase sobre o capacitor (para filtros passa-baixas).
Se quisermos calcular esses valores para diversas frequências, esse cálculo se torna trabalhoso e demorado e muito repetitivo, o que se sujeita a muitos erros.
Para facilitar essa tarefa, muitas calculadoras possuem o recurso de serem programáveis e principalmente são capazes de realizar cálculos com números complexos. Dentre elas, posso citar a HP-15C, que trabalha muito facilmente com números complexos. Além disso ela possui grande memória para programas e faz conversões de notações retangulares (a + bj) para notação polar (R , q) e vice-e-versa.
O programa a seguir vai calcular as tensões e fases sobre resistor e capacitor (resultados em notação polar de amplitude e fase em graus), dados os valores de frequência, resistência, capacitância e tensão de entrada.

001 – 42,21,11   g LBL A
002 – 44 0            STO 0
003 – 0                  0
004 – 36               ENTER
005 – 36               ENTER
006 – 45 0            RCL 0
007 – 45 2            RCL 2
008 – 20               X             (vezes)
009 – 2                  2
010 – 20               X
011 – 43 26         g p
012 – 20               X
013 – 42 25         f I
014 – 15               1/x
015 – 42 30         f Re <-> Im  (swap real x imaginário)
016 – 44 4            STO 4
017 – 42 30         f Re <-> Im
018 – 45 1            RCL 1
019 – 40               +
020 – 45 3            RCL 3
021 – 34               x<->y  (swap)
022 – 10               /              (dividido)
023 – 44.0           STO.0
024 – 42 30         f Re <-> Im
025 – 44.1           STO.1
026 – 42 30         f Re <-> Im
027 – 45 1            RCL 1
028 – 20               X
029 – 36               ENTER
030 – 43 16         g ABS
031 – 44 6            STO 6
032 – 33               roll down
033 – 36               ENTER
034 – 42 30         f Re<->Im
035 – 43 5 8        g Cf 8
036 – 10               /
037 – 43 25         g Tan -1
038 – 43 3            g -> Deg
039 – 44 7            STO 7
040 – 45.0           RCL.0
041 – 45.1           RCL.1
042 – 42 25         f I
043 – 0                  0
044 – 45 4            RCL 4
045 – 42 25         f I
046 – 20               X
047 – 36               ENTER
048 – 43 16         g ABS
049 – 44 8            STO 8
050 – 33               roll down
051 – 36               ENTER
052 – 42 30         f Re <-> Im
053 – 43 5 8        g Cf 8
054 – 10               /
055 – 43 25         g  Tan -1
056 – 43 3            g  -> DEG
057 – 44 9            STO 9
058 – 43 5 8        g Cf 8
059 – 45 1            RCL 1
060 – 43 11         g  x^2
061 – 45 4            RCL 4
062 – 43 11         g  x^2
063 – 40               +
064 – 11               raiz quadrada
065 – 44 5            STO 5
066 – 43 32         RTN

Para executar o cálculo devemos guardar o valor do resistor R (em ohms) no registrador de memória R1, o valor do capacitor (em farads) no registrador R2, o valor da tensão (em volts) no registrador R2, digitamos o valor da frequência (em hertz), em seguida f LBL A e R/S. Ao final teremos os seguintes valores calculados nos registradores de memória:
R0 = frequência
R1 = resistência
R2 = capacitância
R3 = tensão de entrada
R4 = Reatância capacitiva
R5 = Módulo da impedância total
R6 = Módulo da tensão no resistor (para plotar filtro passa-alta)
R7 = fase da tensão no resistor (em graus)
R8 = Módulo da tensão no capacitor (para plotar filtro passa-baixas)
R9 = fase da tensão no capacitor (em graus)
R.0 = componente real da corrente elétrica
R.1 = componente imaginário da corrente elétrica.

Como exemplo, quero plotar a resposta de um filtro passa-altas  com resistor de 100k ohms e um capacitor de  10nF e 10V de tensão de entrada (alternada e senoidal).
Entramos com os valores:
100000  STO 1
10 E -9  STO 2
10 STO 3

Iniciando com 30Hz, digitamos 30  f LBL A  R/S e esperamos aparecer o valor do módulo da impedância total (539858), chamando RCL  6 obtemos: 1,85.
Montando-se uma tabela:
30Hz – 1,85V
40Hz – 2,43V
50Hz – 2,99V
60Hz – 3,53V
80Hz – 4,49V
100Hz – 5,32V
120Hz – 6,02V
150Hz – 6,85V
180Hz – 7,49V
200Hz – 7,82V
240Hz – 8,33V
300Hz – 8,83V
400Hz – 9,29V
500Hz – 9,53V
600Hz – 9,66V
1000Hz – 9,87V
2000Hz – 9,97V
5000Hz – 9,99V
10kHz – 10V








sábado, 5 de setembro de 2015

Editor/Leitor de memórias EEPROM I2C

Precisei ler algumas memórias EEPROM do tipo I2C e resolvi aproveitar uma placa de desenvolvimento MCLAB2 da Mosaico que já tem um soquete de 8 pinos para memórias 24LCXX, um PIC 16F877A e um LCD de 16x2.

As memórias EEPROM 24LC usam comunicação serial I2C (ou IIC) que utiliza 2 sinais: um clock de até 400kHz e uma via de dados bidirecional. Isso economiza bastante as portas de um microcontrolador e por isso diversos aparelhos e sistemas usam essas memórias para armazenar dados de configuração ou de monitoramento coletados por sensores.

As memórias que incluí no programa são:
24LC01 de 1kbits (8 x 128)
24LC02 de 2kbits (8 x 256)
24LC04 de 4 kbits (8 x 512)
24LC08 de 8 kbits (8 x 1024)
24LC16 de 16 kbits (8 x 2048)
24LC32 de 32 kbits (8 x 4096)
24LC64 de 64 kbits (8 x 8192)
24LC128 de 128 kbits (8 x 16384)
24LC256 de 256 kbits (8 x 32768)
24LC512 de 512 kbits (8 x 65536)

A vantagem é que todas essas memórias usam a mesma pinagem e encapsulamento DIP 8.

A parte do circuito aproveitada da placa MCLAB2 é a seguinte e pode ser montada em protoboard:

A MCLAB2 possui 4 botões de contato momentâneo, assim designei-os de botões 1 a 4, sendo que B1 tem a função de decremento, B2 de incremento, B3 de avanço e B4 de enter ou saída.

Ao ligar, aparece um Menu com as seguintes opções:
1 - Seleciona dispositivo: escolhe qual a memória a editar ou ler.
2 - Leitura da memória: apenas se consegue ver os dados gravados nos endereços
3 - Edição da memória: pode-se ver os dados e alterá-los
4 - Apagamento da memória: seta todas as posições de memória com o valor $FF (255 em decimal).

Para escolher uma das opções, aperta-se o botão correspondente à desejada.

Ao escolher a opção 1, devemos a seguir escolher qual o modelo de memória a ser usada. Os botões B1 e B2 selecionam na lista de modelos e o botão B4 aceita a seleção e volta ao menu inicial.

Na opção de leitura, devemos entrar com o endereço inicial a ser lido. Iniciando pelo digito hexadecimal mais significativo (o primeiro da esquerda, de 4) podemos mudá-lo de 0 a F com os botões B1 e B2. Aparecendo o dígito desejado, aperta-se B3 e passamos ao segundo dígito e assim por diante até o último dígito menos significativo. Se o endereço for maior do que a capacidade da memória escolhida, aparece uma mensagem de erro e volta-se para a seleção do endereço. A qualquer momento também aparece o valor do endereço em decimal. Ao final já se apresenta o valor do dado (em hexadecimal e decimal) naquela posição de memória:

Para passar para o endereço seguinte, aperta-se B2, para voltar uma posição, aperta-se B1.  Para sair da leitura, aperta-se B4.

Na opção de edição/gravação (3), também devemos entrar com o endereço inicial a ser editado. Depois de entrado o endereço, aparece o valor atual do dado naquela posição de memória. Para alterar o valor usamos B1 para modificar o valor do dígito (nibble) hexadecimal mais significativo e B2 para o nibble menos significativo. Para gravar e avançar para o próximo endereço usamos o botão B3. Para terminar a edição e voltar para o menu, aperta-se B4.


A última opção apaga a memória por inteiro, gravando o valor $FF em todas as posições. Memórias com grande capacidade demoram um certo tempo para terem todas posições apagadas. Ao final do processo aparece uma mensagem informando o final do apagamento e pedindo para apertar B4 para voltar ao menu.

O firmware para o 16F877A é o seguinte:

:10000000B2017C29B216B21EB212B2190B28B21577
:100010004420031832280830A3005920A20DA30B56
:100020000D28B21E3D2063205F20B21A32203720F7
:10003000220803107729B216B21EB21232192528EF
:10004000FE39B300321503107729321A2D28A60085
:10005000321644200318322826084C200318322870
:10006000B21E77293D20632032113212B2113608B8
:100070008400340884178004432836088400340937
:100080008005841780057729372063207B213D2058
:100090005F203308B2190138A2000830A300A20D76
:1000A00003183720031C3D2063205F20A30B4F283B
:1000B000372063203608840034080005FF3E3708E7
:1000C0008400350940283708840035083A28040898
:1000D000A70089100910091083168910091009104A
:1000E000880183122708B21890283A30A100FC300A
:1000F00002213330A600A3201030A1006830022175
:10010000A32064300121A32038308F200C308F20B1
:1001100001308F2006308F20B21427089028321427
:10012000A600321C9E280910033C031CA328A32010
:100130000730A100D0300221031408003214FE3C25
:1001400003197729091489142608880032108910A8
:100150003230012103140800B31329080319B3171F
:100160000430A800250EB9202508B920240EB92096
:1001700024080F39F63E0318073E0A3EDC28B31365
:1001800029080319B3170530A8002730A300103041
:10019000D5200330A300E830D520A3016430D5205A
:1001A000A3010A30D5202408DC28A2002508A100DC
:1001B0002408A00040212008A000A8030319B313BD
:1001C00029080319E6282802031808002008031D3F
:1001D000B313B31B0800303E722983178001840AD1
:1001E000FF3E031DEE287729A301A200FF30A207DE
:1001F000031CA307031C77290330A100DF30022171
:10020000F628A101E83EA000A109FC30031C0B293F
:10021000A00703180829A0076400A10F08292018C7
:100220001129A01C1529000015290800A101A3010E
:10023000A20001302529A20006302529A101A30131
:10024000A20004302529A2000530A80023082102BD
:10025000031D2C2922082002043003180130031941
:1002600002302805031DFF3077290038031DFF30B9
:100270000405031DFF3077290404031DFF3077298F
:10028000A501A4011030A600210DA40DA50D220882
:10029000A4022308031C230FA502031856292208D1
:1002A000A40723080318230FA5070310A00DA10D11
:1002B000A60B4429200877291030A800A101A0012D
:1002C000A70CA60C031C6A292208A0072308031800
:1002D000230FA107A10CA00CA50CA40CA80B60294E
:1002E00024087729840031088A00300882008313AB
:1002F00003138312640008008316DF3085000F307B
:100300008600913087008801890106309F00073000
:100310009C00831207112030840060308A01EE2097
:10032000A030840050308A01EE201030840060300C
:100330008A01ED209030840060308A01ED20FE308B
:100340008A01682001308A01682050308A016820C3
:100350006C308A01682061308A01682063308A012C
:10036000682061308A01682020308A0168204D3081
:100370008A01682043308A0168204C308A01682055
:1003800041308A01682042308A01682032308A0177
:10039000682020308A01682020308A0168202030BF
:1003A0008A01682020308A016820FE308A01682096
:1003B000C0308A0168204C308A01682065308A018B
:1003C00068202F308A01682067308A0168207230E7
:1003D0008A01682061308A01682076308A016820AD
:1003E00061308A01682020308A01682049308A0102
:1003F000682032308A01682043308A01682020302A
:100400008A01682020308A01682020308A01682013
:10041000FE308A0168200F308A0168200730A3006F
:10042000D0308A01F520FE308A01682001308A012F
:10043000682031308A0168202D308A0168207330AD
:100440008A01682065308A0168206C308A01682042
:1004500020308A01682064308A01682065308A0172
:10046000682076308A01682020308A016820323086
:100470008A0168202D308A01682072308A01682044
:1004800065308A01682061308A01682064308A0101
:100490006820FE308A016820C0308A01682033302D
:1004A0008A0168202D308A01682077308A0168200F
:1004B00072308A01682069308A01682074308A01AC
:1004C000682065308A01682020308A016820343035
:1004D0008A0168202D308A01682065308A016820F1
:1004E00072308A01682061308A01682073308A0185
:1004F000682065308A01682064008A110A12061893
:10050000892AFA308A01F4200130C6008A110A12C1
:10051000AC2A64008A110A128618942AFA308A01D9
:10052000F4208A150A122E2A64008A110A1206196A
:100530009F2AFA308A01F4208A150A126B2B640074
:100540008A110A128619AA2AFA308A01F4208A1519
:100550000A12C92D8A017C2AFE308A0168200130E6
:100560008A01682053308A01682065308A0168203A
:100570006C308A01682065308A01682063308A0106
:10058000682074308A01682020308A016820643035
:100590008A01682065308A01682076308A016820E7
:1005A00069308A01682063308A01682065308A01D9
:1005B00068203A308A01682020308A016820203083
:1005C0008A016820FE308A016820C0308A016820D4
:1005D0003D308A0168208A110A12242364008A119E
:1005E0000A120618022BFA308A01F420C6036400AE
:1005F0004608003C8A110A12031D002B0B30C6006E
:100600008A01E22A64008A110A128618162BFA302F
:100610008A01F420C60A640046080C3C8A110A12BA
:10062000031D142B0130C6008A01E22A64008A11DE
:100630000A128619222B0130A3005E308A01F520B0
:100640008A019F298A01EE2A64004608013C8A112A
:100650000A12031D542BFE308A016820C0308A0123
:1006600068203D308A01682032308A0168203430A9
:100670008A0168204C308A01682043308A01682052
:1006800030308A01682031308A01682020308A01A8
:10069000682020308A01682020308A016820A0303C
:1006A000C4007F30BA00BB0164004608023C8A11D6
:1006B0000A12031D842BFE308A016820C0308A0193
:1006C00068203D308A01682032308A016820343049
:1006D0008A0168204C308A01682043308A016820F2
:1006E00030308A01682032308A01682020308A0147
:1006F000682020308A01682020308A016820A030DC
:10070000C400FF30BA00BB0164004608033C8A11F4
:100710000A12031DB52BFE308A016820C0308A0101
:1007200068203D308A01682032308A0168203430E8
:100730008A0168204C308A01682043308A01682091
:1007400030308A01682034308A01682020308A01E4
:10075000682020308A01682020308A016820A0307B
:10076000C400FF30BA000130BB0064004608043CFE
:100770008A110A12031DE62BFE308A016820C03060
:100780008A0168203D308A01682032308A01682061
:1007900034308A0168204C308A01682043308A0155
:1007A000682030308A01682038308A016820203083
:1007B0008A01682020308A01682020308A01682060
:1007C000A030C400FF30BA000330BB00640046080C
:1007D000053C8A110A12031D172CFE308A0168207D
:1007E000C0308A0168203D308A01682032308A0199
:1007F000682034308A0168204C308A0168204330F8
:100800008A01682031308A01682036308A016820E8
:1008100020308A01682020308A01682020308A0137
:100820006820A030C400FF30BA000730BB0064006D
:100830004608063C8A110A12031D482CFE308A0124
:100840006820C0308A0168203D308A01682032303B
:100850008A01682034308A0168204C308A0168207F
:1008600043308A01682033308A01682032308A019F
:10087000682020308A01682020308A0168202030DA
:100880008A016820A030C400FF30BA000F30BB00DE
:1008900064004608073C8A110A12031D792CA03017
:1008A000C400FE308A016820C0308A0168203D30D3
:1008B0008A01682032308A01682034308A01682039
:1008C0004C308A01682043308A01682036308A0122
:1008D000682034308A01682020308A016820203066
:1008E0008A01682020308A016820FF30BA001F305A
:1008F000BB0064004608083C8A110A12031DA82C9C
:10090000FE308A016820C0308A0168203D308A01AB
:10091000682032308A01682034308A0168204C30E7
:100920008A01682043308A01682031308A016820BA
:1009300032308A01682038308A01682020308A01EC
:10094000682020308A016820FF30BA003F30BB00A9
:1009500064004608093C8A110A12031DD72CFE3098
:100960008A016820C0308A0168203D308A016820F1
:1009700032308A01682034308A0168204C308A0184
:10098000682043308A01682032308A01682035307F
:100990008A01682036308A01682020308A01682068
:1009A00020308A016820FF30BA007F30BB0064002D
:1009B00046080A3C8A110A12031D062DFE308A01E0
:1009C0006820C0308A0168203D308A0168203230BA
:1009D0008A01682034308A0168204C308A016820FE
:1009E00043308A01682035308A01682031308A011D
:1009F000682032308A01682020308A016820203047
:100A00008A016820FF30BA00FF30BB00640046084E
:100A10000B3C8A110A12031D312DFE308A01682019
:100A2000C0308A0168203D308A01682073308A0115
:100A3000682070308A01682065308A016820633040
:100A40008A01682069308A01682061308A01682043
:100A50006C308A01682020308A01682020308A01A9
:100A600068200800FE308A0168200F308A01682063
:100A7000FE308A01682001308A01682045308A01F1
:100A800068206E308A01682074308A0168206530E1
:100A90008A01682072308A01682020308A0168202B
:100AA00061308A01682064308A01682064308A01DC
:100AB000682072308A01682065308A0168207330AE
:100AC0008A01682073308A0168203A308A016820E0
:100AD00020308A01682020308A016820A601103069
:100AE000A7004C08A200A3018A015C21BC002508D4
:100AF000BD00A6010130A7004B08A200A3018A0196
:100B00005C21BE002508BF003C08BE073D08031855
:100B1000013EBF071030A600A7014A08A200A301AA
:100B20008A015C21C0002508C1003E08C0073F08BB
:100B30000318013EC10749084007B80041080318DF
:100B4000013EB900FE308A016820C0308A01682069
:100B50003D308A0168200430A9003808A400390813
:100B6000A5006730B000B1018A01AC2020308A01B5
:100B700068200530A9003808A4003908A5006730AE
:100B8000B000B1018A01BF20FE308A016820C13067
:100B90008A01682064008A110A120618382EFA3079
:100BA0008A01F420CC0364004C08FF3C8A110A122D
:100BB000031DDC2D0F30CC00A6011030A7004C081F
:100BC000A200A3018A015C21BC002508BD00A6018A
:100BD0000130A7004B08A200A3018A015C21BE00DE
:100BE0002508BF003C08BE073D080318013EBF07AB
:100BF0001030A600A7014A08A200A3018A015C21C7
:100C0000C0002508C1003E08C0073F080318013E88
:100C1000C10749084007B80041080318013EB90060
:100C2000FE308A016820C0308A0168203D308A0188
:100C300068200430A9003808A4003908A5006730EE
:100C4000B000B1018A01AC2020308A016820053053
:100C5000A9003808A4003908A5006730B000B10128
:100C60008A01BF20FE308A016820C1308A016820D5
:100C700064008A110A128618A52EFA308A01F4201F
:100C8000CC0A64004C08103C8A110A12031D492E3C
:100C9000CC01A6011030A7004C08A200A3018A01D4
:100CA0005C21BC002508BD00A6010130A7004B084F
:100CB000A200A3018A015C21BE002508BF003C08F8
:100CC000BE073D080318013EBF071030A600A7016C
:100CD0004A08A200A3018A015C21C0002508C100C6
:100CE0003E08C0073F080318013EC10749084007F6
:100CF000B80041080318013EB900FE308A0168209F
:100D0000C0308A0168203D308A0168200430A90083
:100D10003808A4003908A5006730B000B1018A0185
:100D2000AC2020308A0168200530A9003808A400D2
:100D30003908A5006730B000B1018A01BF20FE303C
:100D40008A016820C1308A01682064008A110A1271
:100D50000619B62EFA308A01F420FE308A01682086
:100D600014308A0168208A110A12B82E8A01CA2D0D
:100D700064008A110A120618262FFA308A01F4201C
:100D8000CB0364004B08FF3C8A110A12031DCA2ED4
:100D90000F30CB00A6011030A7004C08A200A30121
:100DA0008A015C21BC002508BD00A6010130A70016
:100DB0004B08A200A3018A015C21BE002508BF00E8
:100DC0003C08BE073D080318013EBF071030A600CF
:100DD000A7014A08A200A3018A015C21C0002508DE
:100DE000C1003E08C0073F080318013EC10749087B
:100DF0004007B80041080318013EB900FE308A01DF
:100E00006820C0308A0168203D308A0168200430A3
:100E1000A9003808A4003908A5006730B000B10166
:100E20008A01AC2020308A0168200530A9003808EA
:100E3000A4003908A5006730B000B1018A01BF20C5
:100E4000FE308A016820C2308A01682064008A115D
:100E50000A128618932FFA308A01F420CB0A640014
:100E60004B08103C8A110A12031D372FCB01A60133
:100E70001030A7004C08A200A3018A015C21BC002D
:100E80002508BD00A6010130A7004B08A200A30160
:100E90008A015C21BE002508BF003C08BE073D0852
:100EA0000318013EBF071030A600A7014A08A200A0
:100EB000A3018A015C21C0002508C1003E08C007CB
:100EC0003F080318013EC10749084007B800410820
:100ED0000318013EB900FE308A016820C0308A0143
:100EE00068203D308A0168200430A9003808A40039
:100EF0003908A5006730B000B1018A01AC2020306C
:100F00008A0168200530A9003808A4003908A50026
:100F10006730B000B1018A01BF20FE308A0168202D
:100F2000C2308A01682064008A110A120619A42FAF
:100F3000FA308A01F420FE308A01682014308A01D8
:100F400068208A110A12A62F8A01B82E64008A1519
:100F50000A1206181428FA308A01F420CA03640021
:100F60004A08FF3C8A110A12031DB82F0F30CA002D
:100F7000A6011030A7004C08A200A3018A015C2141
:100F8000BC002508BD00A6010130A7004B08A20047
:100F9000A3018A015C21BE002508BF003C08BE07F2
:100FA0003D080318013EBF071030A600A7014A08FC
:100FB000A200A3018A015C21C0002508C1003E08EF
:100FC000C0073F080318013EC10749084007B800A1
:100FD00041080318013EB900FE308A016820C03084
:100FE0008A0168203D308A0168200430A900380851
:100FF000A4003908A5006730B000B1018A01AC2017
:1010000020308A0168200530A9003808A40039087A
:10101000A5006730B000B1018A01BF20FE308A010F
:101020006820C3308A01682064008A150A12861875
:101030008128FA308A01F420CA0A64004A08103C68
:101040008A150A12031D2528CA01A6011030A7001F
:101050004C08A200A3018A015C21BC002508BD0048
:10106000A6010130A7004B08A200A3018A015C2160
:10107000BE002508BF003C08BE073D080318013E1E
:10108000BF071030A600A7014A08A200A3018A01E9
:101090005C21C0002508C1003E08C0073F080318B6
:1010A000013EC10749084007B80041080318013E46
:1010B000B900FE308A016820C0308A0168203D30C6
:1010C0008A0168200430A9003808A4003908A50066
:1010D0006730B000B1018A01AC2020308A0168205D
:1010E0000530A9003808A4003908A5006730B00011
:1010F000B1018A01BF20FE308A016820C3308A0115
:10110000682064008A150A1206199228FA308A01AA
:10111000F420FE308A01682014308A0168208A1584
:101120000A1294288A01A62F64008A150A1206184A
:101130000229FA308A01F420C90364004908FF3CFF
:101140008A150A12031DA6280F30C900A601103007
:10115000A7004C08A200A3018A015C21BC0025085D
:10116000BD00A6010130A7004B08A200A3018A011F
:101170005C21BE002508BF003C08BE073D080318DF
:10118000013EBF071030A600A7014A08A200A30134
:101190008A015C21C0002508C1003E08C0073F0845
:1011A0000318013EC10749084007B8004108031869
:1011B000013EB900FE308A016820C0308A016820F3
:1011C0003D308A0168200430A9003808A40039089D
:1011D000A5006730B000B1018A01AC2020308A013F
:1011E00068200530A9003808A4003908A500673038
:1011F000B000B1018A01BF20FE308A016820C430EE
:101200008A01682064008A150A1286186F29FA304C
:101210008A01F420C90A64004908103C8A150A12A0
:10122000031D1329C901A6011030A7004C08A20014
:10123000A3018A015C21BC002508BD00A601013084
:10124000A7004B08A200A3018A015C21BE0025086B
:10125000BF003C08BE073D080318013EBF07103021
:10126000A600A7014A08A200A3018A015C21C000D0
:101270002508C1003E08C0073F080318013EC1070A
:1012800049084007B80041080318013EB900FE3084
:101290008A016820C0308A0168203D308A016820B8
:1012A0000430A9003808A4003908A5006730B00050
:1012B000B1018A01AC2020308A0168200530A900E4
:1012C0003808A4003908A5006730B000B1018A01D0
:1012D000BF20FE308A016820C4308A016820640083
:1012E0008A150A1206198029FA308A01F420FE3084
:1012F0008A01682014308A0168208A150A1283291D
:101300008A150A129428A6011030A7004C08A200E2
:10131000A3018A015C21BC002508BD00A6010130A3
:10132000A7004B08A200A3018A015C21BE0025088A
:10133000BF003C08BE073D080318013EBF07103040
:10134000A600A7014A08A200A3018A015C21C000EF
:101350002508C1003E08C0073F080318013EC10729
:1013600049084007B80041080318013EB900380891
:10137000A0003908A1003B08A3003A088A011B21FC
:101380008A150A12031D2D2AFE308A0168200130B9
:101390008A01682049308A0168206E308A016820FD
:1013A00076308A01682061308A0168206C308A01B9
:1013B000682069308A01682064308A016820203002
:1013C0008A01682061308A01682064308A016820BF
:1013D00064308A01682072308A01682065308A0191
:1013E000682073308A01682073308A0168202030B9
:1013F0008A016820FE308A016820C0308A01682096
:101400004D308A01682061308A01682078308A0175
:10141000682020308A01682061308A0168206430A9
:101420008A01682064308A01682072308A0168204D
:101430003D308A0168200530A9003A08A4003B0825
:10144000A5006730B000B1018A01BF200B30A300B6
:10145000B8308A01F5208A01322D08008A01322530
:101460004414FE308A01682001308A01682061300E
:101470008A01682064308A01682064308A0168200B
:1014800072308A0168203D308A0168200430A9004A
:101490003808A4003908A5006730B000B1018A01FE
:1014A000AC2020308A0168200530A9003808A4004B
:1014B0003908A5006730B000B1018A01BF2064007F
:1014C000033046028A150A120318772A0730B6003D
:1014D0001030B4000730B7000830B50044088A0166
:1014E0001D2038088A011D208A010220CD004608EF
:1014F000033C031DFF30FF3ABC004608043C031DBB
:10150000FF30FF3ABE003C0884003E088A013C21BF
:10151000BE00BF004608053C031DFF30FF3AC00077
:101520003E083F04840040088A013C21C000C100FD
:101530006400400841048A150A120319BC2A3918AC
:10154000C414391CC410B9184415B91C44113919F4
:10155000C415391DC4110730B6001030B40007306F
:10156000B7000830B50044088A011D2038088A01F8
:101570001D208A010220CD004608A00005308A0106
:101580001621BC004608A0000B308A011E21BE00B7
:101590003C0884003E088A013521BE00BF0064007B
:1015A0003E083F048A150A120319EA2A0730B600DA
:1015B0001030B4000730B7000830B50044088A0185
:1015C0001D2039088A011D2038088A011D208A0142
:1015D0000220CD00FE308A016820C0308A016820D8
:1015E00064308A01682061308A01682074308A0181
:1015F000682061308A0168203D308A01682002300D
:10160000A9004D08A400A5016730B000B1018A010E
:10161000AC2020308A0168200330A9004D08A400C6
:10162000A5016730B000B1018A01BF2064008A15AE
:101630000A1206183F2BFA308A01F4200130B80252
:101640000030031C013EB902FF30A000FF30A100B2
:101650003908A30038088A0123218A150A12031DBC
:101660003C2B64000A3046028A150A1203183C2BF0
:101670003A08B8003B08B9008A150A12302A6400FB
:101680008A150A1286185C2BFA308A01F420B80AEF
:101690000319B90A3808A0003908A1003B08A300C3
:1016A0003A088A011B218A150A12031D592BB80119
:1016B000B9018A150A12302A64008A150A1286199D
:1016C000682B0130A3005E308A01F5208A019F2932
:1016D0008A150A12162B8A01322514308A01F42049
:1016E0004414FE308A01682001308A01682061308C
:1016F0008A01682064308A01682064308A01682089
:1017000072308A0168203D308A0168200430A900C7
:101710003808A4003908A5006730B000B1018A017B
:10172000AC2020308A0168200530A9003808A400C8
:101730003908A5006730B000B1018A01BF206400FC
:10174000033046028A150A120318B72B0730B60079
:101750001030B4000730B7000830B50044088A01E3
:101760001D2038088A011D208A010220CD0046086C
:10177000033C031DFF30FF3ABC004608043C031D38
:10178000FF30FF3ABE003C0884003E088A013C213D
:10179000BE00BF004608053C031DFF30FF3AC000F5
:1017A0003E083F04840040088A013C21C000C1007B
:1017B0006400400841048A150A120319FC2B3918E9
:1017C000C414391CC410B9184415B91C4411391972
:1017D000C415391DC4110730B6001030B4000730ED
:1017E000B7000830B50044088A011D2038088A0176
:1017F0001D208A010220CD004608A00005308A0184
:101800001621BC004608A0000B308A011E21BE0034
:101810003C0884003E088A013521BE00BF006400F8
:101820003E083F048A150A1203192A2C0730B60015
:101830001030B4000730B7000830B50044088A0102
:101840001D2039088A011D2038088A011D208A01BF
:101850000220CD00FE308A016820C0308A01682055
:1018600064308A01682061308A01682074308A01FE
:10187000682061308A0168203D308A01682002308A
:10188000A9004D08A400A5016730B000B1018A018C
:10189000AC2020308A0168200330A9004D08A40044
:1018A000A5016730B000B1018A01BF20FE308A0176
:1018B000682010308A016820FE308A0168201030CC
:1018C0008A016820FE308A01682010308A01682071
:1018D000FE308A01682010308A0168204D08A0007F
:1018E000A1011030A200A3018A014021C8004808CC
:1018F000A600A7011030A200A3018A015C21BC0050
:101900002508BD003C084D02C70064008A150A1274
:101910000618992CFA308A01F420C80A6400480895
:10192000103C8A150A12031D962CC8018A150A124A
:10193000762564008A150A128618AD2CFA308A01C1
:10194000F420C70A64004708103C8A150A12031DD8
:10195000AA2CC7018A150A12762564008A150A1274
:101960000619672D4410FA308A01F4201030A600C1
:10197000A7014808A200A3018A015C21BC00250838
:10198000BD003C084707CD006400033046028A15BD
:101990000A120318DC2C0730B6001030B4000730F0
:1019A000B7000830B50044088A011D2038088A01B4
:1019B0001D204D088A011B204608033C031DFF30F3
:1019C000FF3ABC004608043C031DFF30FF3ABE004E
:1019D0003C0884003E088A013C21BE00BF00460846
:1019E000053C031DFF30FF3AC0003E083F04840061
:1019F00040088A013C21C000C10064004008410445
:101A00008A150A120319212D3918C414391CC4105F
:101A1000B9184415B91C44113919C415391DC4111C
:101A20000730B6001030B4000730B7000830B500FA
:101A300044088A011D2038088A011D204D088A01AA
:101A40001B204608A00005308A011621BC0046086C
:101A5000A0000B308A011E21BE003C0884003E0815
:101A60008A013521BE00BF0064003E083F048A158C
:101A70000A1203194F2D0730B6001030B40007309A
:101A8000B7000830B50044088A011D2039088A01D2
:101A90001D2038088A011D204D088A011B20B80A24
:101AA0000319B90A3808A0003908A1003B08A300AF
:101AB0003A088A0123218A150A12031D612DB801F3
:101AC000B90114308A01F4208A150A126D2B6400C2
:101AD0008A150A128619732D0130A3005E308A011F
:101AE000F5208A019F298A150A12852C1030A6003C
:101AF000A7014808A200A3018A015C21BC002508B7
:101B0000BD003C084707CD00FE308A016820C03088
:101B10008A01682064308A01682061308A01682067
:101B200074308A01682061308A0168203D308A0162
:101B300068200230A9004D08A400A5016730B0005C
:101B4000B1018A01AC2020308A0168200330A9004D
:101B50004D08A400A5016730B000B1018A01BF2083
:101B6000FE308A01682010308A016820FE308A0128
:101B7000682010308A016820FE308A016820103009
:101B80008A016820FE308A01682010308A016820AE
:101B900008004410FE308A01682001308A01682064
:101BA00045308A01682072308A01682061308A01DC
:101BB000682073308A01682069308A0168206E309D
:101BC0008A01682067308A01682020308A016820F5
:101BD0006D308A01682065308A0168206D308A0185
:101BE00068206F308A01682072308A01682079305D
:101BF0008A01682020308A01682020308A0168200C
:101C0000FE308A016820C0308A01682043308A0192
:101C100068206F308A0168206E308A016820663043
:101C20008A01682069308A01682072308A01682040
:101C30006D308A01682020308A0168203F308A0197
:101C4000682020308A01682042308A01682075307F
:101C50008A01682074308A01682031308A01682046
:101C600020308A01682020308A01682064008A15AB
:101C70000A120618412EFA308A01F4208A150A1237
:101C80004E2E64008A150A1286184B2EFA308A01ED
:101C9000F4208A019F298A150A12362EFE308A0105
:101CA000682001308A01682045308A01682072303E
:101CB0008A01682061308A01682073308A016820B7
:101CC00069308A0168206E308A01682067308A0195
:101CD000682020308A0168206D308A0168206530D4
:101CE0008A0168206D308A0168206F308A0168207F
:101CF00072308A01682079308A01682020308A0198
:101D0000682020308A016820FE308A016820C030B7
:101D10008A01682057308A01682061308A01682072
:101D200069308A01682074308A01682020308A0175
:101D3000682020308A01682020308A016820203005
:101D40008A01682020308A01682020308A016820BA
:101D500020308A01682020308A01682020308A01E2
:101D6000682020308A01682020308A0168202030D5
:101D70008A016820C201C3014208A0004308A100F3
:101D80003B08A3003A088A0118218A150A12031D8C
:101D9000602FFF30CD006400033046028A150A121E
:101DA0000318E32E0730B6001030B4000730B70038
:101DB0000830B50044088A011D2042088A011D2010
:101DC0004D088A011B204608033C031DFF30FF3AE3
:101DD000BC004608043C031DFF30FF3ABE003C082F
:101DE00084003E088A013C21BE00BF004608053C35
:101DF000031DFF30FF3AC0003E083F048400400846
:101E00008A013C21C000C1006400400841048A15D9
:101E10000A120319282F4318C414431CC410C318F2
:101E20004415C31C44114319C415431DC411073084
:101E3000B6001030B4000730B7000830B5004408D1
:101E40008A011D2042088A011D204D088A011B209D
:101E50004608A00005308A011621BC004608A000F3
:101E60000B308A011E21BE003C0884003E088A0116
:101E70003521BE00BF0064003E083F048A150A12E7
:101E80000319562F0730B6001030B4000730B700E2
:101E90000830B50044088A011D2043088A011D202E
:101EA00042088A011D204D088A011B2014308A0136
:101EB000F420C20A0319C30A8A150A12031DBC2E94
:101EC000FE308A01682001308A0168204D308A0185
:101ED000682065308A0168206D308A0168206F3083
:101EE0008A01682072308A01682079308A0168206E
:101EF00020308A01682065308A01682072308A01AA
:101F0000682061308A01682073308A01682065305A
:101F10008A01682064308A01682020308A016820A4
:101F200020308A01682020308A016820FE308A0132
:101F30006820C0308A01682050308A0168207230E1
:101F40008A01682065308A01682073308A01682020
:101F500073308A01682020308A01682042308A016B
:101F6000682075308A01682074308A0168207430D6
:101F70008A0168206F308A0168206E308A016820EB
:101F800020308A01682034308A01682020308A019C
:101F9000682020308A01682064008A150A12861998
:101FA000D82F0130A30090308A01F5208A019F29A3
:0E1FB0008A150A12CC2F63008A150A12DB2F45
:02400E00313F40
:00000001FF