Перейти к содержанию
    

"...Hi there. I need correction program for PIC16F876A. I do not understand programming.

Sending file. The scheme works, but there's one problem.

When there is no load on the output reading of I is not 0.000 A, and depending on the scope is as follows:

1A - 0,001 A

2A - 0,002 A

4A - 0.004 A

8A - 0.008 A

Can this be corrected?

I'd also like to extend coverage to 30 V. If anyone can help I would be very grateful.

For a fee, of course... :-)....."

PIC_Power_Supply.rar

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Hi.

Tell us first, what is the voltage between AIN0 & AIN1 in no-load condition?

This question appears because of R4 potentiometer in the ckt, so it may be no need to correct a program - simply ajust zero by R4 :)

Изменено пользователем _Pasha

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

AIN1 meassure current, AIN0 measure the voltage. R4 is for adjust correct witness of current /it's adjust gain of the OP Amp IC3b/. If no load condition and pin AIN1 is grounded, witness is the same, like I say: 0,001 to 0,008A. I think reason is the software, because resolution of the range is the same 0,001 to 0,008A.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Author make an incorrect rounding in voltage and current averagings.

Replace

      amp_lue=amp_lue/16;
      amp_lue=amp_lue+1;

with

      amp_lue = (amp_lue + amp_lue/32) / 16;

and by same reason

      volt_lue=volt_lue/16;
      volt_lue=volt_lue+2;// compenser pour le restant de la division a l'affichage

with

      volt_lue = (volt_lue + volt_lue/32) / 16;

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

I replace that, but I can't compile C file. Here is the mesage:

 

>>> Warning 208 "alim876a.c" Line 49(1,19): Function not void and does not return a value comparer_Iset_Ilue

*** Error 112 "alim876a.c" Line 87(1,1): Function used but not defined: ... comparer_Iset_Ilue SCR=382

1 Errors, 1 Warnings.

Build Failed.

 

I don't know what is the reason.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

I replace that, but I can't compile C file.

Me too. Neither author nor you do advert about used compiler.

 

UPD: remove line 49

49: comparer_Iset_Ilue();

and try again

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

"UPD: remove line 49

 

Код

 

49: comparer_Iset_Ilue();"

 

I've already tried it and no problem with the compiler (using PIC C Compiler). But if I remove this subroutine, the arrow at the bottom of the display no longer shows what is under control - U or I. Instead, there are other indications. This is not a decision for me. Can anyone fix this program?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

"UPD: remove line 49

 

Код

 

49: comparer_Iset_Ilue();"

 

I've already tried it and no problem with the compiler (using PIC C Compiler). But if I remove this subroutine, the arrow at the bottom of the display no longer shows what is under control - U or I. Instead, there are other indications. This is not a decision for me.

Missing string on the display is another error in the program not related to removed string.

I had use three different PIC C compilers and listen half-dosen about yet more different ones. I can't recognize your's used compiler and have no time and no wish try each possible to compile your program. Suppose, if you type '<compiler-name> -v' (substitute <compiler-name> with real .exe) in console you see a needed magic words.

Can anyone fix this program?

Of course. Keep try.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Thanks to "xemul " for the time given. I do not understand what you mean, because, as I am not an expert.

 

"lightKnight"- I do not use R6. Or if I use, have connected between +out and gnd.

I think my BIG problem unable to compile the file.

Изменено пользователем maharadga

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

I do not understand what you mean, because, as I am not an expert.

I had ask you run a console window (cmd.exe in WinXXX, something like bash in Linux/Unix), type in few words like these

 

and post here an output of command '<compiler-name> --version' (compiler name is picc.exe in this case).

The same output you can find in compiler log window, you see where it's results like ">>> Warning 208 "alim876a.c" Line 49(1,19): ...", just scroll to top of output.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

If I understand correctly, you want the version of the compiler. Upload. I tried a few compiler, but it is not. What is the reason, I do not know.

post-75288-1359359682_thumb.png

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Change line 294 to

294: void comparer_Iset_Ilue(void)

accordingly prototype of this function in line 48

48: void comparer_Iset_Ilue(void); // determiner qui est en controle, E ou I

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Tanks, xemul. You're a genius for me. :)

I can now compile the file. But with changes in post №4 current measurements is wrong, instead x,xxxA is xA. Only one position.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

×
×
  • Создать...