Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 3rd February 2008, 09:01 PM   (permalink)
Default PIC16F628A Simon Says Game

I was looking online for simple PIC Projects, and I found this http://www.talkingelectronics.com/pr...n/SimonP3.html. I was wondering how would I program the chip? I saw the asm code, but any tips on how I would go about doing that? Would I just save as a asm file and import to chip (using Inchworm+)
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:06 PM   (permalink)
Default

You need to compile the asm code into a hex file which then gets loaded onto the pic. You can use MPLab to do this.

Update: Why not just take the .hex file from the site?
gregmcc is offline  
Reply With Quote
Old 3rd February 2008, 09:09 PM   (permalink)
Default

Yes I saw that but would I save it as a .hex file and import to chip?
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:21 PM   (permalink)
Default

This is what I got when I programmed it. I trust it will work?

Code:
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
ICDWarn0033: MPLAB ICD 2 does not support programming this device if both the internal oscillator and internal MCLR are selected.  You may continue programming, but you are encouraged to cancel, reconfigure your device, and try again.
...Erasing Part
...Programming Program Memory (0x0 - 0x28F)
Verifying...
...Program Memory
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
...Programming succeeded
03-Feb-2008, 16:14:12

MPLAB ICD 2 Ready
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:30 PM   (permalink)
Default

You should heed that warning, you may not be able to reprogram the PIC if you don't.
As long as it's the exact same PIC and the same target schematic it should work fine.

PS I looked at the schematic, and there was no need to force MCLR_OFF as he's tied MCLR to VDD.
PPS a 4.5V (3xAA) supply would be much easier to build than his switching design.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com

Last edited by blueroomelectronics; 3rd February 2008 at 09:32 PM.
blueroomelectronics is offline  
Reply With Quote
Old 3rd February 2008, 09:33 PM   (permalink)
Default

I erased the PIC and programmed it, so I guess it works?
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:36 PM   (permalink)
Default

Ok thanks hooray.
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:40 PM   (permalink)
Default

Before I build this thing, any important things to say?

what about the stuff in red? Should I build that too?
Does the code look ok?

Well I will let you know here in one moment how it turned out...
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:44 PM   (permalink)
Default

Actually I don't Know if I programmed it correctly. I copied the hex file and saved it as a hex file, but it still says it's a hex.txt file. Can you turn it into a hex so I don't kill the pic with random stuff?
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:53 PM   (permalink)
Default

Change
__CONFIG 3F18h
to
__CONFIG 3F38h

That should get rid of the warning.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 3rd February 2008, 09:59 PM   (permalink)
Default

I cannot get the asm file to work. I am getting 318 Errors when I cut and paste the code into MPLAB. How do I get it working. SKYPE?
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 09:59 PM   (permalink)
Default

Quote:
Originally Posted by blueroomelectronics
You should heed that warning, you may not be able to reprogram the PIC if you don't.
Actually not, the diagram is marked with MCLR not connected if you use a 16F628, although you obviously could connect it and modify CONFIG accordingly.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 3rd February 2008, 10:01 PM   (permalink)
Default

ok, I put the hex into MPLAB and saved it as a hex file. I then programmed the chip and I am hoping it will work.
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 10:03 PM   (permalink)
Default

ok here is what my screen looks like. Does everything look correct? I saved it as a hex file and It should work. I imported the hex file and pressed program. This is where I am at right now. I AM NOT USING THE ASM SO DON'T BOTHER WITH THAT.
Attached Images
File Type: jpg screen.JPG (307.1 KB, 16 views)
Krumlink is offline  
Reply With Quote
Old 3rd February 2008, 10:06 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Actually not, the diagram is marked with MCLR not connected if you use a 16F628, although you obviously could connect it and modify CONFIG accordingly.
I thought the red wire on RA5/MCLR meant it was connected.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
finshed testing 8x16 dot matrix game danny009 Electronic Projects Design/Ideas/Reviews 14 8th February 2008 09:30 AM
Bio-med game interface. teckjunkie Electronic Projects Design/Ideas/Reviews 7 29th June 2007 01:36 PM
how can i connect a game buzzer to a computer??? eleanor General Electronics Chat 4 18th October 2006 07:37 PM
An pong game whithout an single semiconductor or vacum tube. Someone Electro Chit-Chat 2 10th August 2005 08:23 AM
Help me on basketball's game clock and shot clock! syaw_007 Electronic Projects Design/Ideas/Reviews 1 6th September 2004 09:50 PM



All times are GMT. The time now is 06:15 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.