coading help required for pic16c54c.

Status
Not open for further replies.
hi;
i wana display battery charging level on a bargraph LCD using pic16c54c. Data is on four input pins of pic from circuit. normally there are simple dc inputs on all pins, but when battery is 20% charged then all inputs contains DC. when it is 40%Charged then one of the 4 pins contain 100hz frequency with 70%duty cycle. when it is 60% charged then two inputs have 100hz frequency. when it is 80% charged then 3 inputs have 100hz signal. and when it is 100% charged finally then all the pins have 100hz signal...
Now accordingly 1,2,3,4,5 bars should be displayed on the LCD , and for this just 60hz square wave is sent on LCD...
how should i code the logic in C.
1) To generate 60hz signal at the output.
2) To detect Rising or falling edge at the input.

Regards
 
Why have you posted this in the 8051 section?

This seems a very roundabout way of displaying a battery level..
 
Acctually i didn't found any catagory for PIC controllers thats why i post my question here.

It is a bit confusing but because PICs are the majority of postings here we discuss them in the main Microcontroller forum. I moved your thread here.

3v0 (moderator)
 
Can you explain how 60Hz makes an LCD work? What kind of LCD?

Mike.
 
Can you explain how 60Hz makes an LCD work? What kind of LCD?

Mike.

it is bar grapah LCD with no number is written on it and have 7 pins. 60 HZ means, i am sending HIGH for 7ms and LOW for 7ms. suppose i want to on 1st bar i will send 1 or 0 on com pin and than inverted level on pin 1; the bar will be on......
 
That makes no sense. How do you light one bar, two bars, many bars?

Mike.
 
I think there might be some language issues here...

Why use a 16C54? It is a very old PIC that can only be programmed once, so is expensive to work with. You must buy a ceramic windowed 16J54 (expensive!) and a UV eraser box. Then each time you program the PIC you spend 10 minutes UV erasing the device before you can program it again.

Then when your code is perfect you program it into the OTP 16C54.

A much better choice of PIC would be a 16F84 or 16F628A.
 


acctually the circuit was already designed. i don't know why they used 16C54 .... and i think it may be the idea of business mind :B . anyhow i solved it and it displayed the bars accurately. and i also preffer to work with f series PICs. using UV Erasable PICs is also not a good idea.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…