1. 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.
    Dismiss Notice

3x3x3 LED Cube - can i use16f628 instead 16f690

Discussion in 'Microcontrollers' started by robotsmani, Jan 20, 2009.

  1. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    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.
     
  2. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    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 (text):
    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.
     
  3. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    I down loaded the 3x3x316f628a.asm that I posted and tryed it with quickbuild here's what you get
    Code (text):
    ----------------------------------------------------------------------
    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: Feb 4, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA

    I downloaded the file did a quickbuild and it failed.

    Code (text):
    ----------------------------------------------------------------------
    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.
     
  6. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    Are you using mplab v8.15a
     
  7. hemmikall

    hemmikall New Member

    Joined:
    Feb 4, 2009
    Messages:
    2
    Likes:
    0
    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
     
  8. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    v8.2

    for the text len checker...
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    It may not have Memory if it has it should work just change the
    Code (text):

       list      p=16f627            ; list directive to define processor
        #include <p16f627.inc>        ; processor specific variable definitions
       
     
  10. hemmikall

    hemmikall New Member

    Joined:
    Feb 4, 2009
    Messages:
    2
    Likes:
    0
    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: Feb 6, 2009
  11. hstewart

    hstewart New Member

    Joined:
    Feb 25, 2009
    Messages:
    12
    Likes:
    1
    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:
     
  12. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    Here this will help This is for a 16f628
    Code (text):

    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: Mar 7, 2009
  13. hstewart

    hstewart New Member

    Joined:
    Feb 25, 2009
    Messages:
    12
    Likes:
    1
    Thank you be80be!

    I'll give that a shot and see how it goes. :)
     
  14. hstewart

    hstewart New Member

    Joined:
    Feb 25, 2009
    Messages:
    12
    Likes:
    1
    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.
     
  15. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    Here I hope this helps you out I drawled a better circuit
     

    Attached Files:

  16. hstewart

    hstewart New Member

    Joined:
    Feb 25, 2009
    Messages:
    12
    Likes:
    1
    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:
     
    • Like Like x 1
  17. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    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
     
  18. hegge91

    hegge91 New Member

    Joined:
    Mar 11, 2009
    Messages:
    3
    Likes:
    0
    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
     
  19. atferrari

    atferrari Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    2,816
    Likes:
    121
    Location:
    Buenos Aires - Argentina
    Your teacher checking MY job, not YOURS? Strange.
     
  20. hegge91

    hegge91 New Member

    Joined:
    Mar 11, 2009
    Messages:
    3
    Likes:
    0
    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.
     
  21. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn

Share This Page