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.

3x3x3 LED Cube - can i use16f628 instead 16f690

Status
Not open for further replies.
I didn't use the lkr I use the project wizard set the pic and it builds my hex

Yes but you will find that if you use quickbuild (no porject) it will fail exactly as nre-the-8th found out. I think if you look at the build output you will see that the project is using the linker file even if you did not ask for it.
 
I no there the hex it's the zip and the asm that I changed to 16f628a it works I made about 10 of them for kids that my girls go to school with. I no about that linker and quickbuild .
Code:
Debug build of project `C:\Users\Dad\Desktop\testing\LED.disposable_mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Feb 04 09:42:29 2009
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "C:\Users\Dad\Desktop\testing\LED.asm" /l"C:\Users\Dad\Desktop\testing\LED.lst" /e"C:\Users\Dad\Desktop\testing\LED.err" /d__DEBUG=1
Message[305] C:\USERS\DAD\DESKTOP\TESTING\LED.ASM 2072 : Using default destination of 1 (file).
Message[305] C:\USERS\DAD\DESKTOP\TESTING\LED.ASM 2096 : Using default destination of 1 (file).
Message[305] C:\USERS\DAD\DESKTOP\TESTING\LED.ASM 2098 : Using default destination of 1 (file).
Message[305] C:\USERS\DAD\DESKTOP\TESTING\LED.ASM 2100 : Using default destination of 1 (file).
Loaded C:\Users\Dad\Desktop\testing\LED.cod.
----------------------------------------------------------------------
Debug build of project `C:\Users\Dad\Desktop\testing\LED.disposable_mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Wed Feb 04 09:42:30 2009
----------------------------------------------------------------------
BUILD SUCCEEDED
But he is doing some thing wrong it builds even with quickbuild that's the output from
a quickbuild.
 
I down loaded the 3x3x316f628a.asm that I posted and tryed it with quickbuild here's what you get
Code:
----------------------------------------------------------------------
Debug build of project `C:\Users\Dad\Desktop\testing\3x3x316f628a.disposable_mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Feb 04 09:52:44 2009
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "C:\Users\Dad\Desktop\testing\3x3x316f628a.asm" /l"C:\Users\Dad\Desktop\testing\3x3x316f628a.lst" /e"C:\Users\Dad\Desktop\testing\3x3x316f628a.err" /d__DEBUG=1
Message[305] C:\USERS\DAD\DESKTOP\TESTING\3X3X316F628A.ASM 2072 : Using default destination of 1 (file).
Message[305] C:\USERS\DAD\DESKTOP\TESTING\3X3X316F628A.ASM 2096 : Using default destination of 1 (file).
Message[305] C:\USERS\DAD\DESKTOP\TESTING\3X3X316F628A.ASM 2098 : Using default destination of 1 (file).
Message[305] C:\USERS\DAD\DESKTOP\TESTING\3X3X316F628A.ASM 2100 : Using default destination of 1 (file).
Loaded C:\Users\Dad\Desktop\testing\3x3x316f628a.cod.
----------------------------------------------------------------------
Debug build of project `C:\Users\Dad\Desktop\testing\3x3x316f628a.disposable_mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Wed Feb 04 09:52:45 2009
----------------------------------------------------------------------
BUILD SUCCEEDED
Did you download the asm or cut a paste what i posted i bet his file was saved a
3x3x316f628a..asm
 
Last edited:
I downloaded the file did a quickbuild and it failed.

Code:
----------------------------------------------------------------------
Debug build of project `C:\Users\webmaster\Desktop\proj\3x3x316f628a.disposable_mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Feb 04 09:12:03 2009
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "3x3x316f628a.asm" /l"3x3x316f628a.lst" /e"3x3x316f628a.err" /d__DEBUG=1
Message[305] C:\USERS\WEBMASTER\DESKTOP\PROJ\3X3X316F628A.ASM 2072 : Using default destination of 1 (file).
Message[305] C:\USERS\WEBMASTER\DESKTOP\PROJ\3X3X316F628A.ASM 2096 : Using default destination of 1 (file).
Message[305] C:\USERS\WEBMASTER\DESKTOP\PROJ\3X3X316F628A.ASM 2098 : Using default destination of 1 (file).
Message[305] C:\USERS\WEBMASTER\DESKTOP\PROJ\3X3X316F628A.ASM 2100 : Using default destination of 1 (file).
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F628A "3x3x316f628a.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"3x3x316f628a.cof" /M"3x3x316f628a.map" /W /x
MPLINK 4.30, Linker
Copyright (c) 2009 Microchip Technology Inc.
Error - section '.org_1' can not fit the absolute section. Section '.org_1' start=0x00000000, length=0x00000f72
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\Users\webmaster\Desktop\proj\3x3x316f628a.disposable_mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Wed Feb 04 09:12:04 2009
----------------------------------------------------------------------
BUILD FAILED

There may be some switch to pick a quickbuild tha does or does not require linking. If you are going to like you need the right linker file.

nre-the-8th's problem is solved. That is good enough for me. I never use quickbuild.
 
what is the diffrance between 16f627 and 16f628?
I have a 16f627 and am wondering if i can use this code for my cube or if i have to get the 16f628
 
It may not have Memory if it has it should work just change the
Code:
   list      p=16f627            ; list directive to define processor
	#include <p16f627.inc>        ; processor specific variable definitions
 
ok thank you....
at least i didn´t get an error while writing in onto the pic now.

edit:
I accidentally put code protection on while i was writing a program to test all the layers and led´s so i wont be using that anymore...

and the elecronic stores that i know of where i live (in Iceland) only sell 16f84 :( so i dicided to try to use the pic 18f2455... but when i'm simulating in mplab i get errors:S

Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 528 : Illegal opcode (la4)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 532 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 534 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 536 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 539 : Illegal opcode (la4)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 544 : Illegal opcode (Time)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 546 : Illegal opcode (Time)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 548 : Illegal opcode (Time)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 550 : Illegal opcode (Time)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 552 : Illegal opcode (Time)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 557 : Illegal opcode (la1)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 565 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 573 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 581 : Illegal opcode (la2)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 589 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 597 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 606 : Illegal opcode (la3)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 614 : Illegal opcode (Brightness)
Error[122] C:\DOCUMENTS AND SETTINGS\HEMMI\DESKTOP\3X3X316F628A.ASM 622 : Illegal opcode (Brightness)


la1,2,3,4 = layer1,2,3,4


can anyone tell me what might be wrong?
 
Last edited:
Hi,

I've been working on this for a few days now and I'm stuck. I'm using the 16F628A on a breadboard and used the datasheets for the two PICs to determine which pins are which for VDD, VSS and so on.

I have the cathodes(-) from the cube connected to RB5,RB6 and RB7 on the 16F628A but the original Instructable shows the anodes connecting to RC0-RC7 and one to RB4.

How do I determine which pins to use on the 16F628A instead of the RCx pins? I tried RA0-RA7 and RB4, hooked up the battery and nothing....

Being so new to electronics, I'm wondering if I have the 7805 regulator and transistors all correct. For the transistors I'm using 2N3904. I have all the emitters ran to one row on the breadboard and from there to pin 5 VSS on the 16F628. I have resistors coming from pins 10-12 RB4-RB6 to the base then the collectors running to the cathodes on the cube.

I wasn't sure if I had the voltage regulator right but with the battery plugged in, I checked and had 5v at pin 14 VDD so that seems right. Also, what purpose does the 220µF capacitor serve?

I thought about trying to just power it from the pickit2 but figured I'd just leave it battery powered so if it ever works, it's portable. :) You really don't want to know what the breadboard looks like, I tried counting how many wires there are and lost track at about 25. This mess could be part of the problem. :eek:
 
Here this will help This is for a 16f628
Code:
3 layers of 3 x 3 LEDs			
					
RA5	-	Top layer common	
RA6	-	Middle layer common	
RA7	-	Bottom layer common
					
					
	Each layer of LED's Anodes
					
RB1			RB0			RA4
						
						
RB4			RB3			RB2
						
						
RB7			RB6			RB5
 
Last edited:
I've spent 3 days SOLID working on this damned thing. Did it on a breadboard and did it again today on a little project board. I can't even get MPLAB or the PICkit2 software to even see the PIC now on the project board.

Right now, this is about as fun as stabbing myself in the eye with the soldering iron and I have to wonder why I don't just pay a 6th grader to build this thing for me.

Enough whining, I'm going to bed.
 
Here I hope this helps you out I drawled a better circuit
 

Attachments

  • ledcube.PNG
    ledcube.PNG
    9.3 KB · Views: 1,738
Thank you be80be.

I couldn't sleep because I couldn't figure out why I couldn't program the PIC so I figured I'd look at it again.

So I was looking at the header pins and the connections at the PIC and it dawned on me, I had wired the header backwards to what I thought I had. So, turn the programmer around and it worked like a charm. :eek:

I'll try hooking the cube up tomorrow and see if I can get it to work. If not, I'll take a break and come back and make sure I wasn't backwards again. :eek:
 
The first board i made was for 16f628a I just got my pickit 2 in the mail it had a 16f690 and ever thing I could find used the 16f628 so I got me a board from radio shack put a socket on it and header pins then my icsp header hooked it up went to load my hex no pic I looked at it for a hour wires all over it then i turned it over and plugged the pickit2 in with face laying down it came on then. now that's the first thing i do when I make a new board icsp header first check it to see that its right.Then go on.:D
 
Anyone have the source code for this lab? I´m doing this as a school project so my teacher would like to see how you build the software from the beginning
 
Your teacher checking MY job, not YOURS? Strange.
 
well yeah ´cause he asked us to find ideas from the web for the project, and i thought this was kinda cool so i told him to go to instructables.com to check it out and he liked it.
So he ask´s me to find the source code to it, and i asked for it politely here.

I´m thinking about doing a sligthly larger version of it.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top