mirror of
https://github.com/eddyem/STM8_samples.git
synced 2025-12-06 18:55:15 +03:00
added 1-wire at 3-digit voltmeter (still buggy)
This commit is contained in:
parent
8cde19f5b1
commit
e45e1e7ed8
@ -1,7 +1,7 @@
|
||||
NAME=testproj
|
||||
SDCC=sdcc
|
||||
|
||||
CCFLAGS=-DSTM8S003 -I../ -I../../ -I/usr/share/sdcc/include -mstm8 --out-fmt-ihx -DBUTNS
|
||||
CCFLAGS=-DSTM8S003 -I../ -I../../ -I/usr/share/sdcc/include -mstm8 --out-fmt-ihx
|
||||
LDFLAGS=-mstm8 --out-fmt-ihx -lstm8
|
||||
FLASHFLAGS=-cstlinkv2 -pstm8s003
|
||||
|
||||
@ -13,8 +13,8 @@ INDEPENDENT_HEADERS=../stm8l.h Makefile
|
||||
|
||||
all: $(NAME).ihx
|
||||
|
||||
$(SRC) : %.c : %.h $(INDEPENDENT_HEADERS)
|
||||
@touch $@
|
||||
#$(SRC) : %.c : %.h $(INDEPENDENT_HEADERS)
|
||||
# @touch $@
|
||||
|
||||
%.h: ;
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
#include "stm8l.h"
|
||||
#include "interrupts.h"
|
||||
#include "onewire.h"
|
||||
|
||||
// Top Level Interrupt
|
||||
INTERRUPT_HANDLER(TLI_IRQHandler, 0){}
|
||||
@ -87,6 +88,32 @@ INTERRUPT_HANDLER(TIM2_UPD_OVF_BRK_IRQHandler, 13){}
|
||||
// Timer2 Capture/Compare Interrupt
|
||||
// process soft I2C
|
||||
INTERRUPT_HANDLER(TIM2_CAP_COM_IRQHandler, 14){
|
||||
TIM2_SR1 &= ~TIM_SR1_CC1IF;
|
||||
onewire_gotlen = TIM2_CCR1H << 8;
|
||||
onewire_gotlen |= TIM2_CCR1L;
|
||||
if(onewire_tick_ctr){ // there's some more data to transmit / receive
|
||||
--onewire_tick_ctr;
|
||||
if(is_receiver){// receive bits
|
||||
ow_data >>= 1;
|
||||
if(onewire_gotlen < ONE_ZERO_BARRIER){ // this is 1
|
||||
ow_data |= 0x80; // LSbit first!
|
||||
}
|
||||
// in receiver mode we don't need to send byte after ctr is zero!
|
||||
if(onewire_tick_ctr == 0){
|
||||
TIM2_CR1 &= ~TIM_CR1_CEN;
|
||||
}
|
||||
}else{// transmit bits
|
||||
// update CCR2 registers with new values
|
||||
if(ow_data & 1){ // transmit 1
|
||||
TIM2REG(CCR2, BIT_ONE_P);
|
||||
}else{ // transmit 0
|
||||
TIM2REG(CCR2, BIT_ZERO_P);
|
||||
}
|
||||
ow_data >>= 1;
|
||||
}
|
||||
}else{ // end: turn off timer
|
||||
TIM2_CR1 &= ~TIM_CR1_CEN;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // STM8S903
|
||||
|
||||
@ -43,14 +43,17 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* BUTTONS (if BUTNS defined)
|
||||
* BUTTONS
|
||||
* DON'T FORGET: PB4 & PB5 are "real open-drain"! They can't be pullup inputs, so
|
||||
* you should solder resistor 10..47k to appropriate buttons!
|
||||
* 0 - PB4, 1 - PB5, 2 - PD1, 3..7 - PC3..PC7
|
||||
* or:
|
||||
* 0 - F(10), 1 - B(7), 2 - C(4), 3 - A(11), 4 - E(1), 5 - D(2), 6 - DP(3), 7 - G(5)
|
||||
*/
|
||||
#ifdef BUTNS
|
||||
volatile U8 buttons_state;
|
||||
#endif
|
||||
|
||||
static U8 display_buffer[3] = {' ',' ',' '}; // blank by default
|
||||
static U8 N_current = 0; // current digit to display
|
||||
|
||||
/*
|
||||
* Number of digit on indicator with common anode
|
||||
@ -59,17 +62,30 @@ volatile U8 buttons_state;
|
||||
#define CLEAR_ANODES() do{PD_ODR &= ~(0x30);PA_ODR &= ~(0x08);}while(0)
|
||||
|
||||
/************* arrays for ports *************/
|
||||
// PB, mask: 0x30, PB4:0x10=16, PB5:0x20=32
|
||||
// PB, mask: 0x30 (dec: 48), PB4:0x10=16, PB5:0x20=32
|
||||
// To light up a segment we should setup it as PPout -> this arrays are inverse!
|
||||
#define PB_BLANK 0x30
|
||||
static U8 PB_bits[18] = {0,16,16,16,0,32,32,16,0,0,0,32,32,16,32,32,48,32};
|
||||
// PC, mask: 0xF8, PC3:0x08=8, PC4:0x10=16, PC5:0x20=32, PC6:0x40=64, PC7:0x80=128
|
||||
static U8 PB_bits[18] = {48,32,32,32,48,16,16,32,48,48,48,16,16,32,16,16,0,16};
|
||||
// PC, mask: 0xF8 (dec: 248), PC3:0x08=8, PC4:0x10=16, PC5:0x20=32, PC6:0x40=64, PC7:0x80=128
|
||||
#define PC_BLANK 0xF8
|
||||
//static U8 PC_bits[18] = {128,184,0,16,56,16,0,176,0,16,32,8,128,8,0,32,56,40};
|
||||
static U8 PC_bits[18] = {192,248,64,80,120,80,64,240,64,80,96,72,192,72,64,96,120,104};
|
||||
static U8 PC_bits[18] = {56,0,184,168,128,168,184,8,184,168,152,176,56,176,184,152,128,144};
|
||||
// PD, mask: 0x02, PD1
|
||||
static U8 PD_bits[18] = {0,0,2,0,0,0,0,0,0,0,0,0,2,0,2,2,2,0};
|
||||
static U8 PD_bits[18] = {2,2,0,2,2,2,2,2,2,2,2,2,0,2,0,0,0,2};
|
||||
#define PD_BLANK 0x02
|
||||
|
||||
/**
|
||||
* Initialize ports
|
||||
* anodes (PA3, PD4, PD5) are push-pull outputs,
|
||||
* cathodes (PB4, PB5, PD1, PC3..PC7) are ODouts in active mode, pullup inputs in buttons reading and floating inputs in inactive
|
||||
* PA3, PB4|5, PC3|4|5|6|7, PD1|4|5
|
||||
*/
|
||||
void LED_init(){
|
||||
PA_DDR |= 0x08; PD_DDR |= 0x30; // anodes are PPout, cathodes will be PPout only in active mode
|
||||
PA_CR1 |= 0x08; PD_CR1 |= 0x30;
|
||||
// prepare cathodes ODR
|
||||
PB_ODR &= ~PB_BLANK; PC_ODR &= ~PC_BLANK; PD_ODR &= ~PD_BLANK;
|
||||
}
|
||||
|
||||
/*
|
||||
********************* GPIO (page 111) ********************
|
||||
* Px_ODR - Output data register bits
|
||||
@ -81,81 +97,64 @@ static U8 PD_bits[18] = {0,0,2,0,0,0,0,0,0,0,0,0,2,0,2,2,2,0};
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup for writing a letter
|
||||
* @param ltr - letter (0..17 for 0..F, - or h | 0x80 for DP, any other value for 'space')
|
||||
* Show next digit - function calls from main() by some system time value amount
|
||||
*/
|
||||
void write_letter(U8 ltr){
|
||||
U8 L = ltr & 0x7f;
|
||||
// process buttons attached to A1 and cathodes
|
||||
#ifdef BUTNS
|
||||
if(PA_DDR & 0x08){ // first digit was lighten up
|
||||
// convert all cathodes to pullup inputs (CR1 is already in ones)
|
||||
void show_next_digit(){
|
||||
U8 L = display_buffer[N_current] & 0x7f;
|
||||
// first turn all off
|
||||
CLEAR_ANODES();
|
||||
// convert all cathodes to pullup inputs (CR1 is already in ones)
|
||||
PB_DDR &= ~PB_BLANK;
|
||||
PC_DDR &= ~PC_BLANK;
|
||||
PD_DDR &= ~PD_BLANK;
|
||||
// and turn anode into zero
|
||||
//PA_ODR &= ~0x08;
|
||||
}
|
||||
#endif
|
||||
// first turn all off
|
||||
CLEAR_ANODES();
|
||||
// light up all segments
|
||||
PB_ODR &= ~PB_BLANK;
|
||||
PC_ODR &= ~PC_BLANK;
|
||||
PD_ODR &= ~PD_BLANK;
|
||||
// now clear spare segments
|
||||
PB_CR1 |= PB_BLANK;
|
||||
PC_CR1 |= PC_BLANK;
|
||||
PD_CR1 |= PD_BLANK;
|
||||
// process buttons attached to A1 and cathodes
|
||||
if(N_current == 1){ // first digit was lighten up, now we light second -- check buttons
|
||||
// now check button states: 0 - PB4, 1 - PB5, 2 - PD1, 3..7 - PC3..PC7
|
||||
buttons_state =
|
||||
((PB_IDR & PB_BLANK) >> 4) |
|
||||
((PD_IDR & PD_BLANK) << 1) |
|
||||
(PC_IDR & PC_BLANK);
|
||||
}
|
||||
// switch all anodes to floating inputs
|
||||
PA_DDR &= ~0x08; PA_CR1 &= ~0x08;
|
||||
PD_DDR &= ~0x30; PD_CR1 &= ~0x30;
|
||||
// turn off pullups of cathodes (also all outputs now will be OD)
|
||||
PB_CR1 &= ~PB_BLANK;
|
||||
PC_CR1 &= ~PC_BLANK;
|
||||
PD_CR1 &= ~PD_BLANK;
|
||||
// now set spare segments switching them to ODoutputs
|
||||
if(L < 18){ // letter
|
||||
PB_ODR |= PB_bits[L];
|
||||
PC_ODR |= PC_bits[L];
|
||||
PD_ODR |= PD_bits[L];
|
||||
}else{ // space - turn all OFF
|
||||
PB_ODR |= PB_BLANK;
|
||||
PC_ODR |= PC_BLANK;
|
||||
PD_ODR |= PD_BLANK;
|
||||
PB_DDR |= PB_bits[L];
|
||||
PC_DDR |= PC_bits[L];
|
||||
PD_DDR |= PD_bits[L];
|
||||
}
|
||||
if(ltr & 0x80){ // DP
|
||||
PC_ODR &= ~GPIO_PIN6;
|
||||
if(display_buffer[N_current] & 0x80){ // DP
|
||||
PC_DDR |= GPIO_PIN6;
|
||||
}
|
||||
#ifdef BUTNS
|
||||
if(PA_DDR & 0x08){ // first digit was lighten up
|
||||
// now check button states: 0 - PB4, 1 - PB5, 2 - PD1, 3..7 - PC3..PC7
|
||||
buttons_state =
|
||||
((PB_IDR & PB_BLANK) >> 4) |
|
||||
((PD_IDR & PD_BLANK) << 1) |
|
||||
(PC_IDR & PC_BLANK);
|
||||
PA_DDR &= ~0x08; // switch first anode to input
|
||||
// and switch cathodes to output
|
||||
PB_DDR |= PB_BLANK;
|
||||
PC_DDR |= PC_BLANK;
|
||||
PD_DDR |= PD_BLANK;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on anode power for digit N (0..2: PA3, PD4, PD5 -- A0x08, D0x10, D0x20)
|
||||
* @param N - number of digit (0..2), if other - no action (display off)
|
||||
* @return
|
||||
*/
|
||||
void light_up_digit(U8 N){
|
||||
switch(N){
|
||||
switch(N_current){
|
||||
case 0:
|
||||
#ifdef BUTNS
|
||||
PA_DDR |= 0x08; // switch to output
|
||||
#endif
|
||||
PA_CR1 |= 0x08; // push-pull
|
||||
PA_ODR |= 0x08;
|
||||
break;
|
||||
case 1:
|
||||
PD_DDR |= 0x10;
|
||||
PD_CR1 |= 0x10;
|
||||
PD_ODR |= 0x10;
|
||||
break;
|
||||
case 2:
|
||||
PD_DDR |= 0x20;
|
||||
PD_CR1 |= 0x20;
|
||||
PD_ODR |= 0x20;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static U8 display_buffer[3] = {' ',' ',' '}; // blank by default
|
||||
static U8 N_current = 0; // current digit to display
|
||||
if(++N_current > 2) N_current = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* fills buffer to display
|
||||
@ -208,37 +207,9 @@ void set_display_buf(char *str){
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Nth digit of buffer (function ran by timer)
|
||||
* @param N - number of digit in buffer (0..3)
|
||||
*/
|
||||
void show_buf_digit(U8 N){
|
||||
if(N > 2) return;
|
||||
write_letter(display_buffer[N]);
|
||||
light_up_digit(N);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show next digit - function calls from main() by some system time value amount
|
||||
*/
|
||||
void show_next_digit(){
|
||||
show_buf_digit(N_current++);
|
||||
if(N_current > 2) N_current = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off current digit: to change display brightness
|
||||
*/
|
||||
void lights_off(){
|
||||
U8 N;
|
||||
if(N_current) N = N_current - 1;
|
||||
else N = 2;
|
||||
light_up_digit(N);
|
||||
}
|
||||
|
||||
/**
|
||||
* convert integer value i into string and display it
|
||||
* @param i - value to display, -99 <= i <= 999, if wrong, displays "---E"
|
||||
* @param i - value to display, -99 <= i <= 999, if wrong, displays "--E"
|
||||
*/
|
||||
void display_int(int I, char voltmeter){
|
||||
int rem;
|
||||
|
||||
@ -24,24 +24,12 @@
|
||||
|
||||
#include "stm8l.h"
|
||||
|
||||
#ifdef BUTNS
|
||||
extern volatile U8 buttons_state; // flags for button: 1 - pressed, 0 - not pressed
|
||||
#endif
|
||||
|
||||
void LED_init();
|
||||
void set_display_buf(char *str);
|
||||
void show_buf_digit(U8 N);
|
||||
void show_next_digit();
|
||||
void lights_off();
|
||||
void display_int(int i, char voltmeter);
|
||||
void display_DP_at_pos(U8 i);
|
||||
|
||||
/**
|
||||
* Initialize ports
|
||||
* PA3, PB4|5, PC3|4|5|6|7, PD1|4|5
|
||||
*/
|
||||
#define LED_init() do{ \
|
||||
PA_DDR = 0x08; PB_DDR = 0x30; PC_DDR = 0xf8; PD_DDR = 0x32; \
|
||||
PA_CR1 = 0x08; PB_CR1 = 0x30; PC_CR1 = 0xf8; PD_CR1 = 0x32; \
|
||||
}while(0)
|
||||
|
||||
#endif // __LED_H__
|
||||
|
||||
@ -19,41 +19,140 @@
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "stm8l.h"
|
||||
#include "onewire.h"
|
||||
#include "interrupts.h"
|
||||
#include "led.h"
|
||||
|
||||
/*
|
||||
int temp;
|
||||
#define PIX_SORT(a,b) { if ((a)>(b)) PIX_SWAP((a),(b)); }
|
||||
#define PIX_SWAP(a,b) { temp=(a);(a)=(b);(b)=temp; }
|
||||
int p[9]; // buffer for median filtering
|
||||
int opt_med9(){
|
||||
PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ;
|
||||
PIX_SORT(p[0], p[1]) ; PIX_SORT(p[3], p[4]) ; PIX_SORT(p[6], p[7]) ;
|
||||
PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ;
|
||||
PIX_SORT(p[0], p[3]) ; PIX_SORT(p[5], p[8]) ; PIX_SORT(p[4], p[7]) ;
|
||||
PIX_SORT(p[3], p[6]) ; PIX_SORT(p[1], p[4]) ; PIX_SORT(p[2], p[5]) ;
|
||||
PIX_SORT(p[4], p[7]) ; PIX_SORT(p[4], p[2]) ; PIX_SORT(p[6], p[4]) ;
|
||||
PIX_SORT(p[4], p[2]) ; return(p[4]) ;
|
||||
}
|
||||
*/
|
||||
|
||||
U32 Global_time = 0L; // global time in ms
|
||||
* DISPLAYER ERRORS:
|
||||
* --- - starting
|
||||
* e00 - Not found any DS18x20
|
||||
* eab - Error when read (or sensor is absent)
|
||||
* eee - EEPROM error (zeroed when running)
|
||||
* eff - can't store last ROM: no space left or EEPROM error
|
||||
*
|
||||
* BUTTONS:
|
||||
* 0 - PB4, 1 - PB5, 2 - PD1, 3..7 - PC3..PC7
|
||||
* here we use:
|
||||
* btn2 (PD1) - STORE NEW ROM
|
||||
* btn3 (PC3) - DELETE NONEXISTANT
|
||||
* btn4 (PC4) - DELETE ALL
|
||||
*/
|
||||
#define STORE_BTN (1<<2)
|
||||
#define DELETE_BTN (1<<3)
|
||||
#define DELALL_BTN (1<<4)
|
||||
|
||||
// one digit emitting time
|
||||
#define LED_delay 1
|
||||
#define LED_delay (1)
|
||||
// pause between buttons actions
|
||||
#define BTNS_delay 30
|
||||
#define BTNS_delay (30)
|
||||
// delays: time of showing sensor number & time of showing temperature (0.3s & 0.7s)
|
||||
#define NUMBER_delay (300)
|
||||
#define TEMPER_delay (700)
|
||||
// pause to show stored value
|
||||
#define STORE_delay (2000)
|
||||
|
||||
U32 Global_time = 0L; // global time in ms
|
||||
volatile U8 waitforread = 0;
|
||||
long temp_readed = ERR_TEMP_VAL; // value of themperature (in 10th of Celsius)
|
||||
U8 temp_ready = 0; // ready flag
|
||||
U8 matchROM = 0, // scan all stored ROMs
|
||||
starting_val = 0, // starting ROM number for next portion of scan
|
||||
delete_notexistant = 0; // delete all ROMs that not exists
|
||||
U32 T_time = 0L; // temperature timer
|
||||
U16 temper_delay = NUMBER_delay; // pause for showing different info
|
||||
U8 block_keys = 0;
|
||||
|
||||
void show_received_data();
|
||||
void send_read_seq(){
|
||||
onewire_receive_bytes(9);
|
||||
ow_process_resdata = show_received_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* get starting value of sensor number
|
||||
* return 1 if found or 0 if there's no ROMs data stored
|
||||
*/
|
||||
U8 get_starting_val(){
|
||||
for(;starting_val < MAX_SENSORS; starting_val++)
|
||||
if((saved_data->ROMs[starting_val]).is_free == 0){
|
||||
return 1;
|
||||
}
|
||||
//delete_notexistant = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void read_next_sensor(){
|
||||
U8 i;
|
||||
U8 *rom = (saved_data->ROMs[starting_val]).ROM_bytes;
|
||||
if(!onewire_reset()){
|
||||
ow_process_resdata = NULL;
|
||||
return;
|
||||
}
|
||||
ow_data_array[0] = OW_READ_SCRATCHPAD;
|
||||
ow_process_resdata = send_read_seq;
|
||||
for(i = 0; i < 8; i++){
|
||||
ow_data_array[i+1] = rom[i];
|
||||
}
|
||||
ow_data_array[9] = OW_MATCH_ROM;
|
||||
onewire_send_bytes(10);
|
||||
}
|
||||
|
||||
void show_received_data(){
|
||||
ow_process_resdata = NULL;
|
||||
temp_readed = gettemp();
|
||||
if(temp_readed == ERR_TEMP_VAL){
|
||||
if(delete_notexistant){
|
||||
erase_saved_ROM(starting_val);
|
||||
}
|
||||
}
|
||||
temp_ready = 1;
|
||||
}
|
||||
|
||||
void wait_reading(){
|
||||
if(ow_data_array[0] == 0xff){ // the conversion is done!
|
||||
waitforread = 1;
|
||||
ow_process_resdata = NULL;
|
||||
}else{
|
||||
onewire_receive_bytes(1); // send read seq waiting for end of conversion
|
||||
}
|
||||
}
|
||||
|
||||
U8 start_temp_reading(){
|
||||
if(!onewire_reset()){
|
||||
set_display_buf("e00");
|
||||
return 0;
|
||||
}
|
||||
ow_data_array[0] = OW_CONVERT_T;
|
||||
ow_data_array[1] = OW_SKIP_ROM;
|
||||
ow_process_resdata = wait_reading;
|
||||
onewire_send_bytes(2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void store_last_ROM(){
|
||||
char i;
|
||||
U8 r;
|
||||
for(i = 7; i > -1; i--)
|
||||
ROM[i] = ow_data_array[i];
|
||||
T_time = Global_time;
|
||||
temper_delay = STORE_delay;
|
||||
r = store_ROM();
|
||||
if(r){
|
||||
display_int((int) r, 0);
|
||||
}else{
|
||||
set_display_buf("eff");
|
||||
}
|
||||
block_keys = 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
U32 T_LED = 0L; // time of last digit update
|
||||
U32 T_time = 0L; // timer
|
||||
U32 Tow = 0L; // 1-wire time
|
||||
U32 T_btns = 0L; // buttons timer
|
||||
U8 old_btns_state = 0;
|
||||
//U8 tmpva = 0;
|
||||
// int pidx = 0; // index in median buffer
|
||||
// long cntrin = 0, cntrcap = 0; // counters for average
|
||||
U8 show_temp = 0; // =0 to show number; = 1 to show temp
|
||||
|
||||
// Configure clocking
|
||||
CLK_CKDIVR = 0; // F_HSI = 16MHz, f_CPU = 16MHz
|
||||
@ -74,63 +173,107 @@ int main() {
|
||||
// auto-reload + interrupt on overflow + enable
|
||||
TIM1_CR1 = TIM_CR1_APRE | TIM_CR1_URS | TIM_CR1_CEN;
|
||||
|
||||
onewire_setup();
|
||||
eeprom_default_setup();
|
||||
|
||||
// enable all interrupts
|
||||
enableInterrupts();
|
||||
set_display_buf("abc");
|
||||
set_display_buf("---");
|
||||
if(get_starting_val()){
|
||||
matchROM = 1; // if ROMs not empty, start scanning
|
||||
starting_val = 0; // reset starting value
|
||||
}
|
||||
start_temp_reading();
|
||||
// Loop
|
||||
do {
|
||||
// onse per 300ms refresh displayed value
|
||||
if(((unsigned int)(Global_time - T_time) > 300) || (T_time > Global_time)){
|
||||
if(((U16)(Global_time - T_time) > temper_delay) || (T_time > Global_time)){
|
||||
T_time = Global_time;
|
||||
// display_int((int)tmpva++,0);
|
||||
// cntrin = 0;cntrcap = 0;voltagein = 0L;voltagecap = 0L;pidx = 0;
|
||||
if(show_temp){ // show temperature
|
||||
temper_delay = TEMPER_delay;
|
||||
show_temp = 0;
|
||||
if(!temp_ready || temp_readed == ERR_TEMP_VAL){
|
||||
set_display_buf("eab");
|
||||
}else{
|
||||
temp_ready = 0;
|
||||
display_int((int)temp_readed,0);
|
||||
display_DP_at_pos(1);
|
||||
}
|
||||
if(matchROM) ++starting_val;
|
||||
}else{ // show number
|
||||
show_temp = 1;
|
||||
temper_delay = NUMBER_delay;
|
||||
if(matchROM){
|
||||
if(get_starting_val()){
|
||||
display_int(starting_val+1,0);
|
||||
read_next_sensor();
|
||||
}else{
|
||||
starting_val = 0;
|
||||
if(start_temp_reading()){
|
||||
if(!get_starting_val()){
|
||||
matchROM = 0;
|
||||
set_display_buf("eee");
|
||||
}else{
|
||||
display_int(starting_val+1,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
start_temp_reading();
|
||||
}
|
||||
}
|
||||
}
|
||||
if((U8)(Global_time - T_LED) > LED_delay){
|
||||
T_LED = Global_time;
|
||||
show_next_digit();
|
||||
/*if(buttons_state != old_btns_state){ // user has pressed or released any button
|
||||
;
|
||||
old_btns_state = buttons_state;
|
||||
}*/
|
||||
}
|
||||
if((U8)(Global_time - T_btns) > BTNS_delay){
|
||||
T_btns = Global_time;
|
||||
if(old_btns_state != buttons_state){
|
||||
if(!block_keys && old_btns_state != buttons_state){
|
||||
U8 pressed = old_btns_state & ~buttons_state; // pressed buttons are ones
|
||||
if(pressed){ // display
|
||||
//display_int(pressed, 0);
|
||||
display_int(buttons_state, 0);
|
||||
}else{ // some buttons released
|
||||
if(buttons_state == 0xff){ // all buttons released
|
||||
set_display_buf("abc");
|
||||
}else{
|
||||
display_int(~old_btns_state & buttons_state, 0); // released are ones
|
||||
if(pressed){ // some buttons were pressed
|
||||
if(pressed & STORE_BTN){
|
||||
if(onewire_reset()){
|
||||
delete_notexistant = 0;
|
||||
block_keys = 1;
|
||||
onewire_send_byte(OW_READ_ROM);
|
||||
while(OW_BUSY);
|
||||
ow_process_resdata = store_last_ROM;
|
||||
onewire_receive_bytes(8);
|
||||
}
|
||||
}else if(pressed & DELETE_BTN){
|
||||
delete_notexistant = 1;
|
||||
}else if(pressed & DELALL_BTN){
|
||||
U8 i;
|
||||
for(i = 0; i < MAX_SENSORS; i++){
|
||||
erase_saved_ROM(i);
|
||||
set_display_buf("---");
|
||||
matchROM = 0;
|
||||
}
|
||||
}
|
||||
old_btns_state = buttons_state;
|
||||
//display_int(pressed, 0);
|
||||
}else{ // some buttons released
|
||||
//display_int(~old_btns_state & buttons_state, 0); // released are ones
|
||||
}
|
||||
}
|
||||
old_btns_state = buttons_state;
|
||||
}
|
||||
if(Global_time != Tow){ // process every byte not frequently than once per 1ms
|
||||
Tow = Global_time;
|
||||
process_onewire();
|
||||
}
|
||||
if(waitforread){
|
||||
if(onewire_reset()){
|
||||
ow_process_resdata = send_read_seq;
|
||||
waitforread = 0;
|
||||
if(!matchROM){
|
||||
ow_data_array[0] = OW_READ_SCRATCHPAD;
|
||||
ow_data_array[1] = OW_SKIP_ROM;
|
||||
onewire_send_bytes(2);
|
||||
}else{
|
||||
read_next_sensor();
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(1);
|
||||
}
|
||||
|
||||
/*
|
||||
if(ADC_ready){
|
||||
// prepare data for rounded output
|
||||
p[pidx] = ADC_value;
|
||||
if(++pidx == 9){ // buffer is ready
|
||||
if(vcap){
|
||||
voltagecap += (long)(opt_med9());
|
||||
cntrcap++;
|
||||
ADC_CSR = 0x24; // switch to ain
|
||||
vcap = 0;
|
||||
}else{
|
||||
voltagein += (long)(opt_med9());
|
||||
cntrin++;
|
||||
ADC_CSR = 0x26; // switch to vcap
|
||||
vcap = 1;
|
||||
}
|
||||
pidx = 0;
|
||||
}
|
||||
ADC_ready = 0;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* main.h
|
||||
*
|
||||
* Copyright 2015 Edward V. Emelianoff <eddy@sao.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#include "stm8l.h"
|
||||
|
||||
#define CONCAT(a,b) a##_##b
|
||||
#define PORT(a,b) CONCAT(a,b)
|
||||
|
||||
#endif // __MAIN_H__
|
||||
334
voltmeters/3_digit_voltmeter_as_thermometer/src/onewire.c
Normal file
334
voltmeters/3_digit_voltmeter_as_thermometer/src/onewire.c
Normal file
@ -0,0 +1,334 @@
|
||||
/*
|
||||
* onewire.c
|
||||
*
|
||||
* Copyright 2015 Edward V. Emelianoff <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
#include "onewire.h"
|
||||
|
||||
// last gotten ROM in reverse order
|
||||
U8 ROM[8];
|
||||
|
||||
eeprom_data *saved_data = (eeprom_data*)EEPROM_START_ADDR;
|
||||
// mode of 1-wire
|
||||
volatile OW_modes ow_mode = OW_MODE_OFF;
|
||||
// length of zero-pulse (TIM2_CCR1)
|
||||
volatile U16 onewire_gotlen = 0;
|
||||
volatile U8 is_receiver = 0;
|
||||
volatile U8 ow_data;
|
||||
// remaining ticks counter
|
||||
volatile U8 onewire_tick_ctr;
|
||||
// array for sending/receiving data
|
||||
// DATA STORED IN REVERCE ORDER! FIRST BYTE ID ow_data_array[N] AND LAST IS ow_data_array[0]!!!
|
||||
U8 ow_data_array[10];
|
||||
// how much bytes to send/receive
|
||||
U8 ow_byte_ctr;
|
||||
// this function will be called after receiving/transmitting of N bytes
|
||||
// inside this function should be: ow_process_resdata = NULL;
|
||||
void (*ow_process_resdata)() = NULL;
|
||||
|
||||
|
||||
/*
|
||||
********************* Timer2 ********************
|
||||
* prescaler: TIM2_PSCR f = f_{in}/2^{TIM2_PSCR}
|
||||
* other registers:
|
||||
* TIM2_CR1 (page 223): | ARPE | reserved[2:0] | OPM | URS | UDIS | CEN |
|
||||
* ARPE - Auto-reload preload enable (for TIM2_ARR)
|
||||
* OPM: One-pulse mode (not implemented!)
|
||||
* URS: Update request source (When enabled by the UDIS bit, 1 - interrupt only on counter overflow/underflow)
|
||||
* UDIS: Update disable (1 - disable update int)
|
||||
* CEN: Counter enable (1 - enable)
|
||||
* TIM2_IER (page 226): | res | TIE | res | res | CC3IE | CC2IE | CC1IE | UIE |
|
||||
* T - trigger; CC - comp/capt; U - update <--
|
||||
* TIM2_SR1 (page 227): similar (but instead of IE -> IF)
|
||||
* interrupt flags
|
||||
* TIM2_SR2 (page 228): overcapture flags
|
||||
* TIM2_EGR (page 229): event generation
|
||||
* TIM2_CCMR1 (page 230):
|
||||
* OUTPUT: | res | OC1M[2:0] | OC1PE | res | CC1S[1:0] |
|
||||
* INPUT: | IC1F[3:0] | IC1PSC[1:0] | CC1S[1:0] |
|
||||
* OC1M: compare mode !!! writeable only when channel is off (CC1E=0) !!!
|
||||
* 000: no
|
||||
* 001: set channel 1 to active level on match
|
||||
* 010: set chan1 to inactive ...
|
||||
* 011: toggle
|
||||
* 100: force 0
|
||||
* 101: force 1
|
||||
* 110: PWM mode 1 (1->0)
|
||||
* 111: PWM mode 2 (0->1)
|
||||
* OC1PE: output compare 1 preload enable (0 - loads immediately)
|
||||
* CC1S: comp/capt selection
|
||||
* 00: CC1 is out
|
||||
* 01: CC1 is in (TI1FP1)
|
||||
* 10: TI2FP1
|
||||
* 11: (only for TIM5)
|
||||
* IC1F: input capture filter (0 - no filter)
|
||||
* IC1PSC: capture prescaler (0 - no, xx - 2^{xx} events)
|
||||
* TIM2_CCMRx - the same for channels 2 & 3
|
||||
* TIM2_CCERx - CC polarity/enable (lowest 2 bytes in each 4): P=1:active high/capture on rising edge;
|
||||
* TIM2_CNTRH, TIM2_CNTRL - counter value (automatical)
|
||||
* TIM2_PSCR - prescaler value, lower 4 bits
|
||||
* TIM1_ARRH, TIM1_ARRL - auto-reload value (while zero, timer is stopped) (page 206)
|
||||
* TIM2_CCRxL/H - compare/capture registers
|
||||
*/
|
||||
|
||||
void onewire_setup(){
|
||||
// freq = 1MHz: psc=16 -> TIM2_PSCR = 4
|
||||
TIM2_PSCR = 4;
|
||||
// AIN: PD3 / TIM2_CH2 -> CC1 will be input on TI2FP1 & CC2 will be output
|
||||
// configure pin CC2 (PD3): open-drain output
|
||||
PORT(PD, DDR) |= GPIO_PIN3; // output & pseudo open-drain
|
||||
PORT(PD, CR2) |= GPIO_PIN3; // fast
|
||||
// out: PWM mode 1 (active -> inactive), preload enable
|
||||
// CCMR2: | 0 | 110 | 1 | 0 | 00 |
|
||||
TIM2_CCMR2 = 0x68;
|
||||
// in: TI2FP1
|
||||
TIM2_CCMR1 = 0x02;
|
||||
// polarity: out - active LOW, in - capture on rising edge, enable
|
||||
TIM2_CCER1 = 0x31;
|
||||
// interrupts: CC1IE
|
||||
TIM2_IER = TIM_IER_CC1IE;
|
||||
// enable preload for registers to refresh their values only by UEV
|
||||
TIM2_CR1 = TIM_CR1_APRE | TIM_CR1_URS;
|
||||
// ARR values: 1000 for reset, 70 for data in/out
|
||||
// CCR2 values: 500 for reset, 60 for sending 0 or reading, <15 for sending 1
|
||||
// CCR1 values: >550 if there's devices on line (on reset), >12 (typ.15) - read 0, < 12 (typ.1) - read 1
|
||||
// WARN! on reset there would be two CC events generated
|
||||
}
|
||||
|
||||
/**
|
||||
* reset 1-wire bus
|
||||
* return 0 if no devices found, else return 1
|
||||
*/
|
||||
U8 onewire_reset(){
|
||||
is_receiver = 0; // send data, not receive
|
||||
onewire_tick_ctr = 1; // if there's devices on the bus CC1 int would be generated twice!
|
||||
TIM2REG(ARR, RESET_LEN);
|
||||
TIM2REG(CCR2, RESET_P);
|
||||
//TIM2_CCR1H = TIM2_CCR1L = 0;
|
||||
TIM2_EGR = TIM_EGR_UG; // generate UEV to update values
|
||||
TIM2_CR1 |= TIM_CR1_CEN; // turn on timer
|
||||
ow_mode = OW_MODE_RESET;
|
||||
while(OW_BUSY); // wait until transmission is over
|
||||
return ((onewire_gotlen > RESET_BARRIER) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send one byte through 1-wire
|
||||
*/
|
||||
void onewire_send_byte(U8 byte){
|
||||
ow_data = byte;
|
||||
is_receiver = 0;
|
||||
onewire_tick_ctr = 7; // 7 bits remain
|
||||
TIM2REG(ARR, BIT_LEN);
|
||||
if(ow_data & 1){ // transmit 1
|
||||
TIM2REG(CCR2, BIT_ONE_P);
|
||||
}else{ // transmit 0
|
||||
TIM2REG(CCR2, BIT_ZERO_P);
|
||||
}
|
||||
TIM2_EGR = TIM_EGR_UG; // generate UEV to update values
|
||||
ow_data >>= 1;
|
||||
TIM2_CR1 |= TIM_CR1_CEN; // turn on timer
|
||||
}
|
||||
|
||||
/**
|
||||
* get 1 byte through 1-wire
|
||||
*/
|
||||
void onewire_wait_for_receive(){
|
||||
ow_data = 0;
|
||||
is_receiver = 1;
|
||||
onewire_tick_ctr = 8; // eight bits remain!
|
||||
TIM2REG(ARR, BIT_LEN);
|
||||
TIM2REG(CCR2, BIT_READ_P); // reading length
|
||||
TIM2_EGR = TIM_EGR_UG; // generate UEV to update values
|
||||
TIM2_CR1 |= TIM_CR1_CEN; // turn on timer
|
||||
}
|
||||
|
||||
// DATA STORED IN REVERCE ORDER! FIRST BYTE ID ow_data_array[N] AND LAST IS ow_data_array[0]!!!
|
||||
/**
|
||||
* wait for receiveing N bytes from 1-wire
|
||||
* N shoud be not great than 10
|
||||
*/
|
||||
void onewire_receive_bytes(U8 N){
|
||||
ow_byte_ctr = N;
|
||||
ow_mode = OW_MODE_RECEIVE_N;
|
||||
onewire_wait_for_receive();
|
||||
}
|
||||
|
||||
void onewire_send_bytes(U8 N){
|
||||
ow_byte_ctr = N;
|
||||
ow_mode = OW_MODE_TRANSMIT_N; // first data portion will be send by process_onewire
|
||||
}
|
||||
|
||||
/**
|
||||
* process 1-wire events
|
||||
*/
|
||||
void process_onewire(){
|
||||
if(OW_BUSY) return; // let data to be processed
|
||||
switch(ow_mode){
|
||||
case OW_MODE_RECEIVE_N: // wait for receiving of N bytes -> send next byte
|
||||
ow_data_array[--ow_byte_ctr] = ow_data;
|
||||
if(ow_byte_ctr){ // there's some more data to receive
|
||||
onewire_wait_for_receive(); // wait for another byte
|
||||
return;
|
||||
}
|
||||
// we have received all data - process it!
|
||||
ow_mode = OW_MODE_OFF;
|
||||
if(ow_process_resdata){
|
||||
ow_process_resdata();
|
||||
}
|
||||
break;
|
||||
case OW_MODE_TRANSMIT_N:
|
||||
if(ow_byte_ctr){ // we have some more data to transmit
|
||||
onewire_send_byte(ow_data_array[--ow_byte_ctr]);
|
||||
return;
|
||||
}
|
||||
ow_mode = OW_MODE_OFF;
|
||||
if(ow_process_resdata){
|
||||
ow_process_resdata();
|
||||
}
|
||||
break;
|
||||
case OW_MODE_RESET:
|
||||
ow_mode = OW_MODE_OFF;
|
||||
break;
|
||||
default: // OW_MODE_OFF
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* convert temperature from ow_data_array (scratchpad)
|
||||
* in case of error return 200000 (ERR_TEMP_VAL)
|
||||
* return value in 10th degrees centigrade
|
||||
* don't forget that bytes in ow_data_array have reverce order!!!
|
||||
* so:
|
||||
* 8 - themperature LSB
|
||||
* 7 - themperature MSB (all higher bits are sign)
|
||||
* 6 - T_H
|
||||
* 5 - T_L
|
||||
* 4 - B20: Configuration register (only bits 6/5 valid: 9..12 bits resolution); 0xff for S20
|
||||
* 3 - 0xff (reserved)
|
||||
* 2 - (reserved for B20); S20: COUNT_REMAIN (0x0c)
|
||||
* 1 - COUNT PER DEGR (0x10)
|
||||
* 0 - CRC
|
||||
*/
|
||||
long gettemp(){
|
||||
// detect DS18S20
|
||||
long t = 0L;
|
||||
U8 l,m;
|
||||
char v;
|
||||
if(ow_data_array[1] == 0xff) // 0xff can be only if there's no such device or some other error
|
||||
return ERR_TEMP_VAL;
|
||||
m = ow_data_array[7];
|
||||
l = ow_data_array[8];
|
||||
if(ow_data_array[4] == 0xff){ // DS18S20
|
||||
v = l >> 1 | (m & 0x80); // take signum from MSB
|
||||
t = ((long)v) * 10L;
|
||||
if(l&1) t += 5L; // decimal 0.5
|
||||
}
|
||||
else{
|
||||
v = l>>4 | ((m & 7)<<4);
|
||||
if(m&0x80){ // minus
|
||||
v |= 0x80;
|
||||
}
|
||||
t = ((long)v) * 10L;
|
||||
m = l&0x0f; // add decimal
|
||||
t += (long)m; // t = v*10 + l*1.25 -> convert
|
||||
if(m > 1) t++; // 1->1, 2->3, 3->4, 4->5, 4->6
|
||||
else if(m > 5) t+=2L; // 6->8, 7->9
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
U8 unlock_EEPROM(){
|
||||
// unlock memory
|
||||
FLASH_DUKR = EEPROM_KEY1;
|
||||
FLASH_DUKR = EEPROM_KEY2;
|
||||
// check bit DUL=1 in FLASH_IAPSR
|
||||
if(!(FLASH_IAPSR & 0x08))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void lock_EEPROM(){
|
||||
while(!(FLASH_IAPSR & 0x04)); // wait till end
|
||||
// clear DUL to lock write
|
||||
FLASH_IAPSR &= ~0x08;
|
||||
}
|
||||
|
||||
/**
|
||||
* setup EEPROM after first run: mark all cells as free
|
||||
*/
|
||||
void eeprom_default_setup(){
|
||||
U8 i;
|
||||
if(saved_data->magick == EEPROM_MAGICK) return; // all OK
|
||||
if(!unlock_EEPROM()) return;
|
||||
saved_data->magick = EEPROM_MAGICK;
|
||||
for(i = 0; i < MAX_SENSORS; i++)
|
||||
(saved_data->ROMs[i]).is_free = 1;
|
||||
lock_EEPROM();
|
||||
}
|
||||
|
||||
/**
|
||||
* erase cell with number num
|
||||
* return 0 if fails
|
||||
*/
|
||||
U8 erase_saved_ROM(U8 num){
|
||||
if(!unlock_EEPROM()) return 0;
|
||||
saved_data->ROMs[num].is_free = 1;
|
||||
lock_EEPROM();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* check ROMs for current value
|
||||
* Return MAX_SENSORS if not found or cell number
|
||||
*/
|
||||
U8 check_ROM(){
|
||||
U8 r,i;
|
||||
U8 *cellbytes;
|
||||
for(r = 0; r < MAX_SENSORS; r++){
|
||||
if(!(saved_data->ROMs[r].is_free)){ // not free cell: check
|
||||
cellbytes = saved_data->ROMs[r].ROM_bytes;
|
||||
for(i = 0; i < 8; i++)
|
||||
if(cellbytes[i] != ROM[i]) break;
|
||||
if(i == 8) break; // we found this cell
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* store last ROM in EEPROM
|
||||
* return 0 if fails or return cell number + 1
|
||||
*/
|
||||
U8 store_ROM(){
|
||||
U8 i, r;
|
||||
ow_ROM *cell = NULL;
|
||||
r = check_ROM();
|
||||
if(r != MAX_SENSORS) return r+1; // we already have stored this value
|
||||
for(r = 0; r < MAX_SENSORS; r++)
|
||||
if(saved_data->ROMs[r].is_free) break;
|
||||
if(r == MAX_SENSORS) return 0; // fail: all cells are busy
|
||||
cell = &(saved_data->ROMs[r]);
|
||||
if(!unlock_EEPROM()) return 0;
|
||||
cell->is_free = 0;
|
||||
for(i = 0; i < 8; i++)
|
||||
cell->ROM_bytes[i] = ROM[i];
|
||||
lock_EEPROM();
|
||||
return r+1;
|
||||
}
|
||||
149
voltmeters/3_digit_voltmeter_as_thermometer/src/onewire.h
Normal file
149
voltmeters/3_digit_voltmeter_as_thermometer/src/onewire.h
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* onewire.h
|
||||
*
|
||||
* Copyright 2015 Edward V. Emelianoff <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __ONEWIRE_H__
|
||||
#define __ONEWIRE_H__
|
||||
|
||||
#include "stm8l.h"
|
||||
|
||||
#define CONCAT(a, b) a ## _ ## b
|
||||
#define PORT(a, b) CONCAT(a , b)
|
||||
|
||||
#define ERR_TEMP_VAL (200000)
|
||||
|
||||
#define TIM2REGH(reg) TIM2_##reg##H
|
||||
#define TIM2REGL(reg) TIM2_##reg##L
|
||||
#define TIM2REG(reg, val) do{TIM2REGH(reg) = val >> 8; TIM2REGL(reg) = val & 0xff;}while(0)
|
||||
|
||||
|
||||
// ARR values: 1000 for reset, 100 for data in/out
|
||||
// CCR2 values: 500 for reset, 60 for sending 0 or reading, <15 for sending 1
|
||||
// CCR1 values: >550 if there's devices on line (on reset), >12 (typ.15) - read 0, < 12 (typ.1) - read 1
|
||||
#define RESET_LEN ((U16)1000)
|
||||
#define BIT_LEN ((U16)100)
|
||||
#define RESET_P ((U16)500)
|
||||
#define BIT_ONE_P ((U16)10)
|
||||
#define BIT_ZERO_P ((U16)60)
|
||||
#define BIT_READ_P ((U16)5)
|
||||
#define RESET_BARRIER ((U16)550)
|
||||
#define ONE_ZERO_BARRIER ((U16)10)
|
||||
|
||||
#define OW_BUSY ((TIM2_CR1 & TIM_CR1_CEN))
|
||||
|
||||
|
||||
/*
|
||||
* thermometer commands
|
||||
* send them with bus reset!
|
||||
*/
|
||||
// find devices
|
||||
#define OW_SEARCH_ROM (0xf0)
|
||||
// read device (when it is alone on the bus)
|
||||
#define OW_READ_ROM (0x33)
|
||||
// send device ID (after this command - 8 bytes of ID)
|
||||
#define OW_MATCH_ROM (0x55)
|
||||
// broadcast command
|
||||
#define OW_SKIP_ROM (0xcc)
|
||||
// find devices with critical conditions
|
||||
#define OW_ALARM_SEARCH (0xec)
|
||||
/*
|
||||
* thermometer functions
|
||||
* send them without bus reset!
|
||||
*/
|
||||
// start themperature reading
|
||||
#define OW_CONVERT_T (0x44)
|
||||
// write critical temperature to device's RAM
|
||||
#define OW_SCRATCHPAD (0x4e)
|
||||
// read whole device flash
|
||||
#define OW_READ_SCRATCHPAD (0xbe)
|
||||
// copy critical themperature from device's RAM to its EEPROM
|
||||
#define OW_COPY_SCRATCHPAD (0x48)
|
||||
// copy critical themperature from EEPROM to RAM (when power on this operation runs automatically)
|
||||
#define OW_RECALL_E2 (0xb8)
|
||||
// check whether there is devices wich power up from bus
|
||||
#define OW_READ_POWER_SUPPLY (0xb4)
|
||||
|
||||
/*
|
||||
* RAM register:
|
||||
* 0 - themperature LSB
|
||||
* 1 - themperature MSB (all higher bits are sign)
|
||||
* 2 - T_H
|
||||
* 3 - T_L
|
||||
* 4 - B20: Configuration register (only bits 6/5 valid: 9..12 bits resolution); 0xff for S20
|
||||
* 5 - 0xff (reserved)
|
||||
* 6 - (reserved for B20); S20: COUNT_REMAIN (0x0c)
|
||||
* 7 - COUNT PER DEGR (0x10)
|
||||
* 8 - CRC
|
||||
*
|
||||
* To identify S20/B20 use value of confuguration register: its MSbit is 0
|
||||
*/
|
||||
|
||||
typedef enum{
|
||||
OW_MODE_OFF, // sleeping
|
||||
OW_MODE_TRANSMIT_N, // transmit N bytes
|
||||
OW_MODE_RECEIVE_N, // receive N bytes
|
||||
OW_MODE_RESET // reset bus
|
||||
} OW_modes;
|
||||
|
||||
typedef struct{
|
||||
U8 is_free;
|
||||
U8 ROM_bytes[8];
|
||||
} ow_ROM;
|
||||
|
||||
#define EEPROM_MAGICK (0x1234)
|
||||
|
||||
// there's only 128 bytes of EEPROM on STM8S003!!!
|
||||
// so we have not more than 14 sensors!
|
||||
#define MAX_SENSORS (14)
|
||||
|
||||
typedef struct{
|
||||
U16 magick;
|
||||
ow_ROM ROMs[MAX_SENSORS];
|
||||
} eeprom_data;
|
||||
|
||||
extern U8 ROM[];
|
||||
extern eeprom_data *saved_data;
|
||||
|
||||
extern volatile U8 ow_data; // byte to send/receive
|
||||
extern volatile U8 onewire_tick_ctr; // tick counter
|
||||
extern volatile U8 is_receiver;
|
||||
extern volatile U16 onewire_gotlen; // last captured value
|
||||
extern U8 ow_data_array[];
|
||||
extern U8 ow_byte_ctr;
|
||||
extern volatile OW_modes ow_mode;
|
||||
|
||||
extern void (*ow_process_resdata)();
|
||||
|
||||
void onewire_setup();
|
||||
U8 onewire_reset();
|
||||
void onewire_send_byte(U8 byte);
|
||||
void onewire_wait_for_receive();
|
||||
void process_onewire();
|
||||
void onewire_receive_bytes(U8 N);
|
||||
void onewire_send_bytes(U8 N);
|
||||
|
||||
long gettemp();
|
||||
|
||||
void eeprom_default_setup();
|
||||
U8 erase_saved_ROM(U8 num);
|
||||
U8 store_ROM();
|
||||
|
||||
#endif // __ONEWIRE_H__
|
||||
@ -1,58 +1,130 @@
|
||||
:2080A000808080808080808080AE5255F644241B90CE000472A90001C60003A90097C60025
|
||||
:1980C00002A9009590CF0004CF0002AE52557F808080808080808080805F
|
||||
:2080A000808080808080808080AE5255F644241B90CE005B72A90001C6005AA90097C60077
|
||||
:2080C00059A9009590CF005BCF0059AE52557F808080AE5304F6A4FDF7AE5311F65F9758EA
|
||||
:2080E00058585858585858CF001AAE5312F6974FCA001A959FCA001B97CF001A725D000AEA
|
||||
:208100002759C6000A4AC7000A725D001C2726C6000944C70009CE001AA3000A2408C60052
|
||||
:2081200009AA80C70009725D000A2636AE5300F6A4FEF7202D7200000902200CAE53137FEE
|
||||
:20814000AE5314A60AF7200AAE53137FAE5314A63CF7C6000944C700092007AE5300F6A413
|
||||
:09816000FEF780808080808080A1
|
||||
:20816900AE530EA604F7AE5011F6AA08F7AE5013F6AA08F7AE5308A668F7AE5307A602F733
|
||||
:20818900AE530AA631F7AE5303A602F7AE5300A684F781725F001C3501000AAE530FA603D1
|
||||
:2081A900F7AE5310A6E8F7AE5313A601F7AE5314A6F4F7AE5306A601F7AE5300F6AA01F793
|
||||
:2081C90035030019AE5300F64425F9CE001AA302262304A60120014F817B03C70009725F5B
|
||||
:2081E900001C3507000AAE530F7FAE5310A664F77200000902200CAE53137FAE5314A60A72
|
||||
:20820900F7200AAE53137FAE5314A63CF7AE5306A601F7725400097210530081725F00090F
|
||||
:208229003501001C3508000AAE530F7FAE5310A664F7AE53137FAE5314A605F7AE5306A604
|
||||
:2082490001F772105300817B03C7001535020019CC82257B03C70015350100198188AE53F7
|
||||
:2082690000F6442403CC82EBC6001988C600154A6B0284A1012739A1022706A103275F20C2
|
||||
:2082890061AE000B7B01C700159FCB0015979EA90095C60009F7725D00152705CD82252007
|
||||
:2082A90041725F0019CE001D2738CE001DFD2032725D00152719AE000B7B01C700159FCB67
|
||||
:2082C9000015979EA90095F688CD81E2842013725F0019CE001D270ACE001DFD2004725FC5
|
||||
:2082E90000198481522090AE000B93E601A1FF260AAE0D4090AE0003CC83F093E6076B0AE2
|
||||
:2083090093E6086B0590E604957B0AA4806B189EA1FF26477B05441A1897494FA200959091
|
||||
:208329009790958990894B0A5F894B00CD8D7E5B081F0E170C7B05442503CC83EC1E0E1C54
|
||||
:2083490000051F167B0DA9006B157B0CA9006B0C1616170E7B156B0DCC83EC7B054EA40F6D
|
||||
:208369006B0B7B0AA407484848481A0B0D182702AA8097494FA20095909790958990894BF2
|
||||
:208389000A5F894B00CD8D7E5B08511F017B05A40F6B200F1F5F72F91F1708889F1903971D
|
||||
:2083A9009E190295841F0C1608170EA10123191E0E1C00017B0DA9006B117B0CA9001F0E43
|
||||
:2083C9006B0C7B116B0D201BA10523171E0E1C00027B0DA9006B1A7B0CA9001F0E6B0C7BAF
|
||||
:2083E9001A6B0D1E0E160C5B2081AE5064A6AEF7AE5064A656F7AE505FF6A50826034F20FE
|
||||
:2084090002A60181AE505FF6A50427F8A4F7AE505FF7815203CE0017FEA312342733200003
|
||||
:20842900CD83F34D272BCE001790AE1234FF0F014FCE00175C5C1F025F9772FB0288A60138
|
||||
:20844900F784AB090C01887B02A10E8425E3CD840D5B03815202CD83F34D26034F201ACEF6
|
||||
:2084690000175C5C1F017B0597A609424F9572FB01A601F7CD840DA6015B02815209AE0020
|
||||
:20848900011F050F030F04CE00175C5C9F1B046B099EA9006B081E08F64D26291E085C1FA7
|
||||
:2084A900014F5F9772FB0188F69095845F9772FB0588F66B08909E11088426054CA108256F
|
||||
:2084C900E1A108270E7B04AB096B040C037B03A10E25B47B035B09815208CD8485A10E27B4
|
||||
:2084E900044CCC855C0F014F9095CE00175C5C1F045F41909E4172FB04F64D260C72A90919
|
||||
:20850900000C017B01A10E25E17B016B067B01A10E26034F203D7B0197A609424F9572FBD2
|
||||
:208529000489CD83F3854D26034F20277F5C1F07AE00011F024F905F909772F9075F9772C1
|
||||
:16854900FB0288F69790F7844CA10825E9CD840D7B064C5B0881ED
|
||||
:088F3C004000000000000000ED
|
||||
:20855F00AE5002F6AA08F7AE5011F6AA30F7AE5003F6AA08F7AE5012F6AA30F7AE5005F617
|
||||
:20857F00A4CFF7AE500AF6A407F7AE500FF6A4FDF7815208AE001F1F04C60022974F957297
|
||||
:20859F00FB04F6A47F6B01AE500FF6A4CFF7AE5000F6A4F7F7AE5007F6A4CFF7AE500CF6E0
|
||||
:2085BF00A407F7AE5011F6A4FDF7AE5008F6AA30F7AE500DF6AAF8F7AE5012F6AA02F7C687
|
||||
:2085DF000022A1012621AE5006F6A4304EA40F6B06AE5010F6A402481A066B03AE500BF6B2
|
||||
:2085FF00A4F81A03C70016AE5002F6A4F7F7AE5003F6A4F7F7AE5011F6A4CFF7AE5012F640
|
||||
:20861F00A4CFF7AE5008F6A4CFF7AE500DF6A407F7AE5012F6A4FDF77B01A1122448AE5091
|
||||
:20863F0007F66B02AE00239F1B01979EA90095F61A02AE5007F7AE500CF66B08AE00359FAF
|
||||
:20865F001B01979EA90095F61A08AE500CF7AE5011F66B07AE00479F1B01979EA90095F6C3
|
||||
:20867F001A07AE5011F7C60022974F9572FB04F6482407AE500CF6AA40F7C60022A10027E6
|
||||
:20869F0010C60022A1012720C60022A10227302043AE5002F6AA08F7AE5003F6AA08F7AEA8
|
||||
:2086BF005000F6AA08F7202CAE5011F6AA10F7AE5012F6AA10F7AE500FF6AA10F72015AE5C
|
||||
:2086DF005011F6AA20F7AE5012F6AA20F7AE500FF6AA20F7C600224CC70022A1022304727F
|
||||
:2086FF005F00225B08815212725F0022AE001F1F0D4F5F9772FB0D88A620F7844CA1032FFF
|
||||
:20871F00F11E152603CC8835961C00041F0B0F01161517091E09F66B03887B024A6B098457
|
||||
:20873F004D2603CC88097B01A1032F03CC88094F957B03A12F2D0C7B03A13A2E06A6309535
|
||||
:20875F00CC87EE7B03A1602C040F072004A6016B077B03A1672F034F2002A60114074D2758
|
||||
:20877F0006A65795CC87EE7B03A1402C040F122004A6016B127B03A1472F034F2002A60159
|
||||
:20879F0014124D2705A6379520457B03A12D2605A61D95203A7B03A1682605A65795202F88
|
||||
:2087BF007B03A1482605A6379520247B03A12E26180D0126071E0BA6FFF720265F7B089708
|
||||
:2087DF0072FB0BF6AA80F720197B03A1202613905F7B01909772F90B7B038910018590F70E
|
||||
:2087FF000C011E095C1F09CC87337B086B027B026B11A6026B037B11A1FF2D1A5F7B039736
|
||||
:20881F0072FB0D1F0F5F7B119772FB0BF61E0FF70A110A0320E05B1281520A0F020F011ECC
|
||||
:20883F000DA3FF9D2F131E0DA303E72C040F062004A6016B060D06270CAE893B89CD8705B8
|
||||
:20885F005B02CC89230D0F2729AE001F1F044F5F9772FB047F4CA1032FF50D0627294B0AC7
|
||||
:20887F004B001E0F89CD8EE75B041F0DA6016B022015AE001F1F094F5F9772FB0988A620C4
|
||||
:20889F00F7844CA1032FF11E0D2607AE00217FCC89231E0DA300002E09A6016B011E0D507D
|
||||
:2088BF001F0DAE001F1F07A6026B034B0A4B001E0F89CD8D405B04905F7B03909772F9070F
|
||||
:2088DF009F90F74B0A4B001E0F89CD8EE75B041F0D0A037B03A1FF2C034F2002A6014D274A
|
||||
:2088FF00041E0D26C60D01270D4D270A5F7B039772FB07A610F70D0F270A5F7B029772FBBC
|
||||
:20891F00077999765B0A817B03A102220EAE001F9F1B03979EA90095799976812D2D4500CD
|
||||
:208F4400202020003020202030101020303030101020101000103800B8A880A8B808B8A8CD
|
||||
:1A8F640098B038B0B898809002020002020202020202020200020000000249
|
||||
:208000008200808382000000820080A0820080A1820080A2820080A3820080A4820080A57E
|
||||
:20802000820080A6820080A78200000082000000820080A8820080A9820080D0820080D1F1
|
||||
:20804000820080D28200000082000000820080D3820080D4820080D58200000082000000C2
|
||||
:20806000820080D6820080D7820080D88200000082000000820000008200000082000000EB
|
||||
:1D808300AE00012707724F00005A26F9AE003E2709D68685D700015A26F7CC8080B1
|
||||
:03808000CC80D9D8
|
||||
:2080D900521D5F1F0C1F0A5F1F081F065F1F041F020F01AE50C67F72107F60AE5002A608B5
|
||||
:2080F900F7AE5007A630F7AE500CA6F8F7AE5011A632F7AE5003A608F7AE5008A630F7AEFA
|
||||
:20811900500DA6F8F7AE5012A632F7AE7F0AF6AA28F7AE52607FAE5261A60FF7AE5262A68B
|
||||
:2081390003F7AE5263A6E8F7AE5254A601F7AE5250A685F79AAE822F1F1C1E1C89CD836D2C
|
||||
:208159005B02CE000472F008C6000312076B19C600021206C600056B1790CE0003C60002B1
|
||||
:208179006B14A3012C2211CE00041308C600031207C600021206240A17077B176B097B14D4
|
||||
:208199006B06C60005887B0E6B14841013A101230D170B7B176B0D7B146B0ACD84BEC6007C
|
||||
:2081B90005887B066B13841012A11E2395CE00041F04CE00021F027B01C100012603CC8163
|
||||
:2081D9005BC600014314014D2711C60001974F954B0089CD84EC5B03CC815BC60001A1FFC7
|
||||
:2081F900260A1E1C89CD836D5B02201F7B016B110F101E1053C600010F0E89140285979E45
|
||||
:1A821900140E954B0089CD84EC5B03C600016B01CC815B5B1D81616263002B
|
||||
:0486860000000000F0
|
||||
:2082330052067B09A47F6B01AE5002F6A5082715AE5007F6A4CFF7AE500CF6A407F7AE50DC
|
||||
:2082530011F6A4FDF7AE500FF6A4CFF7AE5000F6A4F7F7AE5005F6A4CFF7AE500AF6A4076D
|
||||
:20827300F7AE500FF6A4FDF7AE5005F66B057B01A1122444AE00069F1B01979EA90095F681
|
||||
:208293001A05AE5005F7AE500AF66B02AE00189F1B01979EA90095F61A02AE500AF7AE5044
|
||||
:2082B3000FF66B04AE002A9F1B01979EA90095F61A04AE500FF720167B05AA30AE5005F78F
|
||||
:2082D300AE500AF6AAF8F7AE500FF6AA02F77B09482407AE500AF6A4BFF7AE5002F69095E4
|
||||
:2082F300A508273EAE5006F6A4304EA40F6B03AE5010F6A402481A036B06AE500BF6A4F801
|
||||
:208313001A06C70001909EA4F7AE5002F7AE5007F6AA30F7AE500CF6AAF8F7AE5011F6AA8E
|
||||
:2083330002F75B06817B03A100270E7B03A10127187B03A102271B2020AE5002F6AA08F75A
|
||||
:20835300AE5000F6AA08F72010AE500FF6AA10F72007AE500FF6AA20F7815212725F003FA9
|
||||
:20837300AE003C1F094F5F9772FB0988A620F7844CA1032FF11E152603CC849C965C5C1F8F
|
||||
:20839300070F011615170B1E0BF66B06887B024A6B13844D2603CC84707B01A1032F03CC31
|
||||
:2083B30084704F957B06A12F2D0C7B06A13A2E06A63095CC84557B06A1602C040F112004B2
|
||||
:2083D300A6016B117B06A1672F034F2002A60114114D2706A65795CC84557B06A1402C042C
|
||||
:2083F3000F102004A6016B107B06A1472F034F2002A60114104D2705A6379520457B06A1BC
|
||||
:208413002D2605A61D95203A7B06A1682605A65795202F7B06A1482605A6379520247B06DD
|
||||
:20843300A12E26180D0126071E07A6FFF720265F7B129772FB07F6AA80F720197B06A12051
|
||||
:208453002613905F7B01909772F9077B068910018590F70C011E0B5C1F0BCC839A7B126B08
|
||||
:20847300057B056B0FA6026B067B0FA1FF2D1A5F7B069772FB091F0D5F7B0F9772FB07F65D
|
||||
:208493001E0DF70A0F0A0620E05B12817B03A1022218AE003C9F1B03979EA90095F688CDD0
|
||||
:2084B3008233847B0388CD83388481C6003F95725C003F9E88CD849F84C6003FA1022304CD
|
||||
:2084D300725F003F81725D003F2706C6003F4A2002A60288CD83388481520A0F030F011EF3
|
||||
:2084F3000DA3FF9D2F131E0DA303E72C040F082004A6016B080D08270CAE85EF89CD836DEE
|
||||
:208513005B02CC85D70D0F2729AE003C1F044F5F9772FB047F4CA1032FF50D0827294B0A47
|
||||
:208533004B001E0F89CD86315B041F0DA6016B032015AE003C1F064F5F9772FB0688A620B9
|
||||
:20855300F7844CA1032FF11E0D2607AE003E7FCC85D71E0DA300002E09A6016B011E0D50FF
|
||||
:208573001F0DAE003C1F09A6026B024B0A4B001E0F89CD85F35B04905F7B02909772F90994
|
||||
:208593009F90F74B0A4B001E0F89CD86315B041F0D0A027B02A1FF2C034F2002A6014D2759
|
||||
:2085B300041E0D26C60D01270D4D270A5F7B029772FB09A610F70D0F270A5F7B039772FB09
|
||||
:2085D300097999765B0A817B03A102220EAE003C9F1B03979EA90095799976812D2D4500FE
|
||||
:20868A00001010100020201000000020201020203020C0F84050785040F040506048C048F0
|
||||
:1A86AA004060786800000200000000000000000002000202020020202000CC
|
||||
:2085F30052051E08A300002F040F012004A6016B010D0127051E085020021E081F041E0A8B
|
||||
:20861300A300002E071E0A501F022004160A170216021E0465930D012701505B0581520886
|
||||
:208633001E0BA300002F040F052004A6016B050D0527051E0B5020021E0B1F011E0DA300E9
|
||||
:20865300002F040F062004A6016B060D0627107B0E406B044F120D6B0316031707200416B4
|
||||
:138673000D170716071E01657B0518064D2701505B0881E1
|
||||
:20804000820080D2820000008200000082008163820081648200816582000000820000000F
|
||||
:20806000820081668200816782008168820000008200000082000000820000008200000038
|
||||
:1D808300AE00162707724F00005A26F9AE00562709D68F3BD700165A26F7CC8080B0
|
||||
:03808000CC8AB8EF
|
||||
:20893F004B09CD825084AE89DFCF001D815202C60064A10E2424CE00175C5C1F01C60064C2
|
||||
:20895F0097A609424F9572FB01F64D2604A601200AC600644CC7006420D54F5B02815206C5
|
||||
:20897F00CE00175C5C1F05C6006497A609424F9572FB055C1F01CD819C4D260A725F001E3D
|
||||
:20899F00725F001D2037AE000B1F031E03A6BEF7AE893FCF001D4F5F975C72FB0390935F27
|
||||
:2089BF009772FB0188F69790F7844CA10825E81E031C0009A655F74B0ACD825C845B0681D3
|
||||
:2089DF00725F001E725F001DCD82EDCF006090CF005ECE0060A30D402615CE005EA3000348
|
||||
:2089FF00260D725D006527073B0064CD845D843501006281AE000BF6A1FF260E3501005DC3
|
||||
:208A1F00725F001E725F001D20064B01CD82508481CD819C4D260CAE8D2C89CD87055B0235
|
||||
:208A3F004F2018AE000BA644F75CA6CCF7AE8A13CF001D4B02CD825C84A601815204AE0052
|
||||
:208A5F00011F01AE000B1F03A607905F909772F9015F9772FB0388F69790F7844AA1FF2C30
|
||||
:208A7F00E990CE005BCE005990CF0068CF006635D0006B3507006ACD84E14D270C5F974B09
|
||||
:208A9F000089CD88385B032009AE8D3089CD87055B02725F006C5B048152185F1F0D1F0B34
|
||||
:208ABF005F1F071F055F1F031F010F0A0F09AE50C67FAE7F60F6AA01F7CD855FAE7F0AF6D6
|
||||
:208ADF00AA28F7AE52607FAE5261A60FF7AE5262A603F7AE5263A6E8F7AE5254A601F7AE38
|
||||
:208AFF005250A685F7CD8169CD841C9AAE8D341F171E1789CD87055B02CD894C4D27083569
|
||||
:208B1F00010063725F0064CD8A30CE005B72B00068C6005AC200676B14C60059C20066C391
|
||||
:208B3F00006A2217CE005BC30068C6005AC20067C60059C200662503CC8C1D90CE005BCE6B
|
||||
:208B5F00005990CF0068CF00660D09275235BC006B3502006A0F09725D00622710CE006067
|
||||
:208B7F00A30D402613CE005EA30003260BAE8D3889CD87055B022015725F0062CE00604B17
|
||||
:208B9F000089CD88385B034B01CD892684725D00632603CC8C1DC600644CC70064205FA660
|
||||
:208BBF00016B09352C006B3501006A725D0063274ACD894C4D2714C60064974F955C4B009C
|
||||
:208BDF0089CD88385B03CD897D2033725F0064CD8A304D2729CD894C4D260F725F0063AE7D
|
||||
:208BFF008D3C89CD87055B022014C60064974F955C4B0089CD88385B032003CD8A30C600EA
|
||||
:208C1F005C887B0F6B11841010A101230DCE005B1F0DCE00591F0BCD8591C6005C887B0522
|
||||
:208C3F006B1084100FA11E2203CC8CD3CE005B1F03CE00591F01725D006C2703CC8CCE7B50
|
||||
:208C5F000AC100162603CC8CCEC6001643140A4D2603CC8CCEA5042729CD819C4D275072D3
|
||||
:208C7F005F00653501006C4B33CD81E284AE5300F64425F9AE8A5BCF001D4B08CD825084EF
|
||||
:208C9F00202DA5082706350100652023A510271F161717114F8888CD845D84841E1188890B
|
||||
:208CBF00CD87055B0284725F00634CA10E25E6C600166B0A1E07C3005B26071E05C3005921
|
||||
:208CDF00270DCE005B1F07CE00591F05CD8266725D005D2603CC8B29CD819C4D2603CC8B66
|
||||
:208CFF0029AE893FCF001D725F005D725D00632613AE000BA6BEF75CA6CCF74B02CD825C60
|
||||
:208D1F0084CC8B29CD897DCC8B295B188165303000656666002D2D2D006561620065656515
|
||||
:018D3F000033
|
||||
:148F7E00000000000000030D400000000000000000012C0062
|
||||
:208D400052051E08A300002F040F012004A6016B010D0127051E085020021E081F041E0A36
|
||||
:208D6000A300002E071E0A501F022004160A170216021E0465930D012701505B05815240FA
|
||||
:208D80009096905C961C00431F051E05E603961C00471F0B1E0B1F0D1E0D1F3F1E3F88E6D0
|
||||
:208DA0000197844290FF72A900021E05E6031E0B1F071E071F091E091F0F1E0F88E6039777
|
||||
:208DC000844290FF965C1F151E15F66B171E05F697160B90E603429F1B171E15F71E15F6BD
|
||||
:208DE0006B1C1E05E60197160B90E602429F1B1C1E15F79096905C93FE1F1D1E05E6011E69
|
||||
:208E00000B1F231E231F251E251F271E2788E60397844272FB1D90FF93FE1F291E05E602E7
|
||||
:208E20001E0B1F2B1E2B1F2D1E2D1F311E3188E60297844272FB2990FF16051E05E6021E0A
|
||||
:208E40000B1F331E331F351E351F371E3788E6019784429F90F71E055C1F391E05E60290AE
|
||||
:208E6000971E0BE60390421E39FF160B1E05E6031E0B1F3D1E3D1F2F1E2F88F69784429FFF
|
||||
:208E800090F71E0B5C1F3B1E05E60390971E0BE60290421E3BFF1E0B1C00037F1E051C00F8
|
||||
:208EA000037F965CE6036B14E6026B13E6016B12F616431718164572F9131721887B13194E
|
||||
:208EC0001A6B218419186B1F1621EF02161FFFE603E602FE16491E4772F9219F1920979E25
|
||||
:208EE000191F95515B408152081E0BA300002F040F052004A6016B050D0527051E0B5020B9
|
||||
:208F0000021E0B1F011E0DA300002F040F062004A6016B060D0627107B0E406B044F120DC4
|
||||
:1C8F20006B03160317072004160D170716071E01657B0518064D2701505B088143
|
||||
:00000001FF
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user