Porównaj commity

...

5 Commity

Autor SHA1 Wiadomość Data
David Fainitski cbbc7e1378
Add files via upload 2024-01-08 15:15:46 -05:00
David Fainitski 6e73c67c91
Delete ATU_100_EXT_board/FirmWare_PIC16F1938/1938_EXT_board_sources_V_3.2/main.h 2024-01-08 12:15:30 -08:00
David Fainitski 03d149f04c
Delete ATU_100_EXT_board/FirmWare_PIC16F1938/1938_EXT_board_sources_V_3.2/main.c 2024-01-08 12:15:07 -08:00
David Fainitski ede3db78ba
Add files via upload 2024-01-08 15:14:43 -05:00
David Fainitski 222dce892f
Delete ATU_100_EXT_board/FirmWare_PIC16F1938/atu_100_fw_EXT_32.zip 2024-01-08 12:14:33 -08:00
3 zmienionych plików z 48 dodań i 47 usunięć

Wyświetl plik

@ -11,7 +11,7 @@
int SWR_fixed_old = 0, work_int;
unsigned char work_char, work_str[7], work_str_2[7];
float Forward;
int Power =0, Power_old = 10000;
int Power = 0, Power_old = 10000;
int SWR_old = 10000;
char type, Soft_tune = 0, Auto = 0, Track = 0;
char bypas = 0, cap_mem = 0, ind_mem = 0, SW_mem = 0, Auto_mem = 0;
@ -127,7 +127,7 @@ void main() {
if(Restart==1 ) lcd_prep_short = 1;
lcd_prep();
}
else Test_init();
else test_init();
lcd_ind();
tune_btn_release = 1;
@ -148,7 +148,7 @@ void main() {
if(Relay_off){
set_ind(0);
set_cap(0);
set_SW(0);
set_sw(0);
}
dysp = 0;
dysp_off();
@ -207,7 +207,7 @@ void main() {
}
} // end of BYP button
//
if(Button(&PORTB, 1, 50, 0) & Bypas==0){ // Auto button
if(Button(&PORTB, 1, 50, 0) & bypas==0){ // Auto button
asm CLRWDT;
while(PORTB.B1==0) {
if(L & ind>0) {
@ -233,7 +233,7 @@ void button_proc(void) {
if(tune_btn_release==0 & Button(&PORTB, 0, 50, 0)) dysp_cnt = Dysp_delay * dysp_cnt_mult;
if((Button(&PORTB, 0, 50, 0) & tune_btn_release) | Soft_tune){
if(dysp==0) { // dysplay ON
if(Relay_off==1){ set_ind(ind); set_cap(cap); set_SW(SW); }
if(Relay_off==1){ set_ind(ind); set_cap(cap); set_sw(SW); }
dysp = 1;
dysp_on();
dysp_cnt = Dysp_delay * dysp_cnt_mult;
@ -259,7 +259,7 @@ void button_proc(void) {
//
if(Button(&PORTB, 2, 50, 0)){ // BYP button
if(dysp==0) { // dysplay ON
if(Relay_off==1){ set_ind(ind); set_cap(cap); set_SW(SW); }
if(Relay_off==1){ set_ind(ind); set_cap(cap); set_sw(SW); }
dysp = 1;
dysp_on();
dysp_cnt = Dysp_delay * dysp_cnt_mult;
@ -278,7 +278,7 @@ void button_proc(void) {
SW = 1;
set_ind(ind);
set_cap(cap);
set_SW(SW);
set_sw(SW);
if(Loss_mode==0) lcd_ind();
Auto_mem = Auto;
Auto = 0;
@ -290,27 +290,27 @@ void button_proc(void) {
SW = SW_mem;
set_cap(cap);
set_ind(ind);
set_SW(SW);
set_sw(SW);
if(Loss_mode==0) lcd_ind();
Auto = Auto_mem;
}
if(type==4 | type==5) { // 128*64 OLED
if(Auto & !Bypas) led_wr_str (0, 16+8*12, ".", 1);
else if(!Auto & Bypas) led_wr_str (0, 16+8*12, "_", 1);
if(Auto & !bypas) led_wr_str (0, 16+8*12, ".", 1);
else if(!Auto & bypas) led_wr_str (0, 16+8*12, "_", 1);
else led_wr_str (0, 16+8*12, " ", 1);
}
else if(type!=0) { // 1602 LCD or 128*32 OLED
if(Auto & !Bypas) led_wr_str (0, 8, ".", 1);
else if(!Auto & Bypas) led_wr_str (0, 8, "_", 1);
if(Auto & !bypas) led_wr_str (0, 8, ".", 1);
else if(!Auto & bypas) led_wr_str (0, 8, "_", 1);
else led_wr_str (0, 8, " ", 1);
}
asm CLRWDT;
while(Button(&PORTB, 2, 50, 0)) {lcd_pwr(); asm CLRWDT; }
}
//
if(Button(&PORTB, 1, 50, 0) & Bypas==0){ // Auto button
if(Button(&PORTB, 1, 50, 0) & bypas==0){ // Auto button
if(dysp==0) { // dysplay ON
if(Relay_off==1){ set_ind(ind); set_cap(cap); set_SW(SW); }
if(Relay_off==1){ set_ind(ind); set_cap(cap); set_sw(SW); }
dysp = 1;
dysp_on();
dysp_cnt = Dysp_delay * dysp_cnt_mult;
@ -322,13 +322,13 @@ void button_proc(void) {
else Auto = 0;
EEPROM_Write(2, Auto);
if(type==4 | type==5) { // 128*64 OLED
if(Auto & !Bypas) led_wr_str (0, 16+8*12, ".", 1);
else if(!Auto & Bypas) led_wr_str (0, 16+8*12, "_", 1);
if(Auto & !bypas) led_wr_str (0, 16+8*12, ".", 1);
else if(!Auto & bypas) led_wr_str (0, 16+8*12, "_", 1);
else led_wr_str (0, 16+8*12, " ", 1);
}
else if(type!=0) { // 1602 LCD or 128*32 OLED
if(Auto & !Bypas) led_wr_str (0, 8, ".", 1);
else if(!Auto & Bypas) led_wr_str (0, 8, "_", 1);
if(Auto & !bypas) led_wr_str (0, 8, ".", 1);
else if(!Auto & bypas) led_wr_str (0, 8, "_", 1);
else led_wr_str (0, 8, " ", 1);
}
asm CLRWDT;
@ -356,14 +356,14 @@ void show_reset() {
if(type==4 | type==5) { // 128*64 OLED
led_wr_str (2, 16, "RESET ", 8);
asm CLRWDT;
delay_ms(600);
Delay_ms(600);
led_wr_str (2, 16, "SWR=0.00", 8);
asm CLRWDT;
}
else if(type!=0) {// 1602 LCD & 128*32 OLED
led_wr_str (1, 0, "RESET ", 8);
asm CLRWDT;
delay_ms(600);
Delay_ms(600);
led_wr_str (1, 0, "SWR=0.00", 8);
asm CLRWDT;
}
@ -391,8 +391,8 @@ void btn_push() {
}
tune();
if(type==0) { // real-time 2-colors led work
if(swr<=150) { LATB.B6 = 0; LATB.B7 = 1; } // Green
else if(swr<=250) {PORTB.B6 = 0; PORTB.B7 = 0;} // Orange
if(SWR<=150) { LATB.B6 = 0; LATB.B7 = 1; } // Green
else if(SWR<=250) {PORTB.B6 = 0; PORTB.B7 = 0;} // Orange
else { PORTB.B6 = 1; PORTB.B7 = 0; } // Red
}
else if(Loss_mode==0 | Loss_ind==0) lcd_ind();
@ -567,6 +567,7 @@ void show_pwr(int Power, int SWR) {
work_str_2[3] = 'W';
}
else {
if(Power>9999){ Power = 9999; Overload = 1;}
IntToStr(Power, work_str);
work_str_2[0] = work_str[2];
work_str_2[1] = work_str[3];
@ -652,7 +653,7 @@ void lcd_pwr() {
if(PWR>=10){
set_ind(ind);
set_cap(cap);
set_SW(SW);
set_sw(SW);
//
dysp = 1;
dysp_on(); // dysplay ON
@ -689,46 +690,46 @@ void lcd_pwr() {
if(Overload==1) {
if(type==4 | type==5) { // 128*64 OLED
led_wr_str (2, 16, " ", 8);
delay_ms(100);
Delay_ms(100);
led_wr_str (2, 16, "OVERLOAD", 8);
delay_ms(500);
Delay_ms(500);
asm CLRWDT;
led_wr_str (2, 16, " ", 8);
delay_ms(300);
Delay_ms(300);
asm CLRWDT;
led_wr_str (2, 16, "OVERLOAD", 8);
delay_ms(500);
Delay_ms(500);
asm CLRWDT;
led_wr_str (2, 16, " ", 8);
delay_ms(300);
Delay_ms(300);
asm CLRWDT;
led_wr_str (2, 16, "OVERLOAD", 8);
delay_ms(500);
Delay_ms(500);
asm CLRWDT;
led_wr_str (2, 16, " ", 8);
delay_ms(100);
Delay_ms(100);
led_wr_str (2, 16, "SWR= ", 8);
}
else if(type!=0) { // 1602 & 128*32
led_wr_str (1, 0, " ", 8);
delay_ms(100);
Delay_ms(100);
led_wr_str (1, 0, "OVERLOAD", 8);
delay_ms(500);
Delay_ms(500);
asm CLRWDT;
led_wr_str (1, 0, " ", 8);
delay_ms(300);
Delay_ms(300);
asm CLRWDT;
led_wr_str (1, 0, "OVERLOAD", 8);
delay_ms(500);
Delay_ms(500);
asm CLRWDT;
led_wr_str (1, 0, " ", 8);
delay_ms(300);
Delay_ms(300);
asm CLRWDT;
led_wr_str (1, 0, "OVERLOAD", 8);
delay_ms(500);
Delay_ms(500);
asm CLRWDT;
led_wr_str (1, 0, " ", 8);
delay_ms(100);
Delay_ms(100);
led_wr_str (1, 0, "SWR= ", 8);
}
asm CLRWDT;
@ -824,7 +825,7 @@ void lcd_ind() {
}
void Test_init(void) { // Test mode
void test_init(void) { // Test mode
if(type==4 | type==5) // 128*64 OLED
led_wr_str (0, 10, "TEST MODE", 9);
else if(type!=0) // 1602 LCD or 128*32 OLED

Wyświetl plik

@ -186,7 +186,7 @@ void set_ind(char Ind) {
Ind_45 = ~Ind.B6;
//
}
Vdelay_ms(Rel_Del);
VDelay_ms(Rel_Del);
}
void set_cap(char Cap) {
@ -198,12 +198,12 @@ void set_cap(char Cap) {
Cap_470 = Cap.B5;
Cap_1000 = Cap.B6;
//
Vdelay_ms(Rel_Del);
VDelay_ms(Rel_Del);
}
void set_sw(char SW) { // 0 - IN, 1 - OUT
Cap_sw = SW;
Vdelay_ms(Rel_Del);
VDelay_ms(Rel_Del);
}
void atu_reset() {
@ -211,7 +211,7 @@ void atu_reset() {
cap = 0;
set_ind(ind);
set_cap(cap);
Vdelay_ms(Rel_Del);
VDelay_ms(Rel_Del);
}
@ -289,14 +289,14 @@ void sharp_cap() {
cap = min_range;
set_cap(cap);
get_swr(); if(SWR==0) return;
min_SWR = SWR;
min_swr = SWR;
for(count=min_range+C_mult; count<=max_range; count+=C_mult) {
set_cap(count);
get_swr(); if(SWR==0) return;
if(SWR>=min_SWR) { Delay_ms(10); get_swr(); }
if(SWR>=min_SWR) { Delay_ms(10); get_swr(); }
if(SWR < min_SWR) {
min_SWR = SWR;
if(SWR>=min_swr) { Delay_ms(10); get_swr(); }
if(SWR>=min_swr) { Delay_ms(10); get_swr(); }
if(SWR < min_swr) {
min_swr = SWR;
cap = count;
if(SWR<120) break;
}