Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

setting current and voltage sampling for pic16f88

Status
Not open for further replies.

seunatoki

Newbie level 6
Joined
Jan 3, 2014
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
87
Hi All,
Please, how can I set my pic16f88 to read current sampling and voltage sampling in my boost converter ?
I write in Hitec C and this is how I wrote it below

TRISA = 0xFF;
I = RA0;
V = RA1;

Is there any other way to do this ?
Thanks.
 

Presumably you want to read analog amounts rather than just high or low so you need to use the ADC module. You configure the pins as analog inputs and select them one at a time then read the value back from the ADC results registers. The value will be in step sizes decided by the reference voltage you choose divided by 1023 so you will need to do some math on the result to convert it back to real volts and amps.

Brian.
 

thanks Brian, please could you help me to write the code here in Hitech C ? I will know how I will incorporate it with my program
Thanks
 

I'm afraid I do not have Hitech C, I usually program in assembly language or Wiz-C, occasionally XC8 and XC16.
I will try to help with the methods but I won't be able to confirm whether the code itself is correct, especially if you use Hitech's built in library functions.

A quick search found this: https://extremeelectronics.co.in/mi...tal-converter-–-pic-microcontroller-tutorial/
which might be useful to you. It is specific to the 18F PIC mentioned in the text but isn't far off what you would use for the 16F88. You need to change the PIC configuration values and adjust the maximum number of channels but the rest is fairly straight forward. It should be enough to give you some ideas.

Brian.
 

You are a good being.
Cheers
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top