Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC programming project

Status
Not open for further replies.

Wishmaster

New Member
HI all..

Im doing a final year project for my school which involves PIC programming. im using PIC16F628 microcontroller.

Part of my project involves code scanning and checking..
im using the serial USART to recieve the code but im stuck at how to cross-check the recieved code with the one stored in the PIC..

If anyone could help me out with any solutions or suggestions, I wud be very greatful..
thanx.
 
Well. I would just take advantage of the SUBWF command. Load your 8bit snipet into W and subtract from the [file] that has the correct and appropriate 8bit snipet. If they are the same then the Z flag should set.

ex:

repeat
bcf status,Z
movf sample,w
subwf actual,w
btfss status,Z
goto repeat

Assuming you are programming in Assembly.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top