flat assembler
Message board for the users of flat assembler.

Index > Heap > So... I got the PCB, now what?

Author
Thread Post new topic Reply to topic
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
I got a predrilled PCB, and was wondering how exactly do I connect the components on it? I have a socket(and PIC), and some components to connect it to, but I don't know what to use to connect them. You don't use wire, do you???


Description: In case I was using incorrect terminology, and it was hard to tell what I meant, here's a pic.
Filesize: 184.13 KB
Viewed: 9335 Time(s)

SANY0121.JPG


Post 14 Jan 2011, 21:49
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
My goal is basically to learn to program PICs, and some EE related crap while I'm doing that. With this, all I'm going to do is make an LED blink.
Post 14 Jan 2011, 21:51
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
What you've got are two prototyping matrix boards. You can leave them joined together if you think you need that much space, or break them apart along the "dotted line".

It's not a PCB because there is no "printed circuit", just a lot of drilled pads in a rectangular matrix.

First solder your PIC socket in the middle of one of the boards. You know that the pins are soldered on the copper side right? Just checking Very Happy Yes, you need to make your interconnections with hook-up wire - insulated single-strand copper wire is best, diameter 0.32mm to 0.5mm works best.

Plan your circuit on graph paper looking from the copper side, and remember to correctly identify where pin1 is when looking from that side.

Good luck!

_________________
FAMOS - the first memory operating system
Post 14 Jan 2011, 23:07
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Quote:

You know that the pins are soldered on the copper side right?

I wasn't sure... Razz

I went back to the store and got a breadboard. I thought it'd be a good investment if I'm going to be doing a lot of prototyping. The impermanence is nice too.
Post 14 Jan 2011, 23:39
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Which side of a battery translates to ground? I think it's the negative side, but that's counterintuitive because electrons flow from neg to pos... Just making sure so I don't fry my $2 PIC. Smile Actually it's the wait I'm trying to avoid. It took a near eternal(when you're anxious) 5 days to get here.
Post 15 Jan 2011, 00:50
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
Image

just do that, and after, use icprog to transfert your binaries to the target, via ICSP, or directlly on the programmer's socket.

be carefull, you can't program two pics at a time by connecting them in paralell.
Post 15 Jan 2011, 01:33
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Thanks edfed, but I can't read it. Sorry. All I was asking is if the side of the battery with the - is GND.
Post 15 Jan 2011, 02:27
View user's profile Send private message Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
1. Google search should help. Here's a couple of examples:
http://www.diylife.com/2008/02/15/program-a-pic-microcontroller/
http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm
http://www.microchipc.com/

2. On FASM board, do a search of shoorick, he is an expert on lots of things, including building nifty things from discrete components, which he then hooks up to various microprocessors, including some ancient ones, designed before your parents were born.

3. Yes, the negative side of the battery corresponds to "ground", or "earth". Do you have a three pronged outlet, with the larger, third, middle prong connected to a copper wire buried in the soil? Some of the older construction in USA, especially in North Carolina, and other southern states, use the old fashioned two pronged outlets, with no earth connection.

4. To read Edfed's EXCELLENT diagram, originating from Denmark and Czech Republic, you can certainly find the information you need. The small parallel lines, for example, labelled C2, C3 represent capacitors, the values correspond to microfarads, respectively 100 microfarads, and 22 microfarads. The symbol after the numbers on the schema correspond to the Greek letter mu, indicating, in electrical engineering, "micro". You can also get help you need by visiting the local Radio Shack, which sells for one or two dollars, a pamphlet on how to read circuit diagrams.....

Smile
Post 16 Jan 2011, 12:06
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
i had no deal with PIC, so, can not help with it exactly Smile there are a lot of tutorial sites started with led blinking and then step-by-step so far so complex.

but anyway you can see pictures how to wire components in some ways:
Image

Image
(at89c2051 testing board)

http://shoorick.org.ua/monsters/8049.html
http://picasaweb.google.com/shooricks/fSEvwB
(last two - some too outdated stuff Very Happy )

at first download pdf about your MCU and read it some times to know what is it and how does it work.

then find simpliest scheme. it may contain:
a.) pins for ISP interface - you need them to attach programmer to your device (hope, you are using MCU with ISP - in-system programming interface, a programmer to it is or usb-device, or five wires from lpt)
b.)clocking circuit - qwartz with two capacitors, or resistor+capacitor, or even nothing (best for you if your MCU have it all inside)
c.)at least one output: a chain of LED with resistor 220-330 Ohm connected to Vcc and chosen pin of MCU.
(the scheme above is complex for newbie who asking what is capacitor Wink )

now take all parts and socket instead of MCU, insert them into your predrilled PCB and connect all wires (with $0.2 socket you will not fry your MCU) - check your wiring well Wink if OK - insert MCU. check well if your MCU may work with your power supply voltage. Usually they have wide range (3.3-6V, 2.7-6V), but check this well before turn it on.

now prepare hex or bin to fill your MCU and download it with ISP programmer. now try it Wink

_________________
UNICODE forever!
Post 16 Jan 2011, 17:06
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
a) I bought a USB based programmer b/c my laptop doesn't have a serial port.
b) The PIC I have comes with a built in 4KHz clock, so I'm good on that one.
c) I don't see a pin labelled Vcc. All it has is Vdd, Vpp, and Vss. Would Vcc be the same as one of there?

I've got it programmed now, but, for whatever reason, there's no power on any of the pins(other than Vdd and Vss).
Post 16 Jan 2011, 18:19
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
VDD is VCC is + 5V
VSS is GND is 0V
VPP is programming voltage is 12 or 13V (works with 12)

in fact, the pic will be programmed if and only if VPP is 12V
Post 16 Jan 2011, 20:35
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
I've been researching why it won't reset and I keep finding references to MCLR. Some say it has to be grounded, others that it has to be set high, even some saying I have to pulse it to get the PIC to reset. Which is it?

BTW, I should have said it in the beginning, I'm using a PIC16F628A.
Post 16 Jan 2011, 23:55
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
at first, read the DATASHEET. you will learn a lot.

then search for simpliest scheme, say, like this:

Image

and read what they say

also, you may search for PIC forums to get more instant info Wink

regards!

---------------------
ps: as i see, it is a low-voltage programming device, so, you will not need 12V to program it. however, some low-voltage chips may accept +12V at PGM input just for compatibility with old programmers, but not all. in any case i do not think it will be your case Wink

_________________
UNICODE forever!
Post 17 Jan 2011, 06:02
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler
Is the capacitor required? I've got the light to come on, with a certain length delay. When I increase the time for the delay, it doesn't come on at all. This seems like a weird capacitor related bug, because I KNOW it's not in my code.

Can you see any problems with my circuit?


Description:
Filesize: 463.13 KB
Viewed: 9170 Time(s)

SANY0122.JPG


Post 18 Jan 2011, 05:07
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
Tyler wrote:
Is the capacitor required? I've got the light to come on, with a certain length delay. When I increase the time for the delay, it doesn't come on at all. This seems like a weird capacitor related bug, because I KNOW it's not in my code.

Can you see any problems with my circuit?

the capacitor on the scheme above is for reducing power pulsation, esp. when device is turning on, thus capacitor is optional and can be absent. i do not know how does your code look when led is blinking and when does not, it may be even kinda overflow, when increased delay may become very small and not noticable with an eye. try to blink two leds: one with delay you you are sure with and another with variating - if the first is blinking and second not, then there is no problem with device and should be problem with code. add button to swap delay or buttons to reduce and increase delay etc.

_________________
UNICODE forever!
Post 18 Jan 2011, 05:41
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
shoorick, your link about RCD is realy really cool. Very Happy thank you!!!

i just come to program, verify and read a pic12F675 with it, right now!! finally! [french] ├ža marche enfin! il etait temps putain!!![/french]

i first tryed to do a jdm programmer, but it didn't work, i wasted at least, all the afternoon to solder it.

and last hour, i just tryed RCD, it works ok now.

i will be able to code for PIC now!!!!

but before, redo the programmer in a compact way.

i use this shematics exactlly:

Image
really easy and cheap, cheaper than JDM. Very Happy


Last edited by edfed on 26 Jan 2011, 11:30; edited 3 times in total
Post 23 Jan 2011, 21:29
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
thanks to google Smile
Post 24 Jan 2011, 05:41
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
it works with .hex files, under icprog.

then, THE goal is a .hex2rcd function, all in fasm. and pic macro, to assemble pic code in .hex file. with fasm syntax Smile.
just need what?
1: a fool program to flash the pic with com1, via .HEX file, because icprog rocks, but i don't have the source
2: a fasm macro set, to generate .HEX files from PIC source, in fasm syntax.because MPlab is a crap
3: DO IT!!!!
Post 25 Jan 2011, 02:28
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
Code:
;PIC 12F675 instruction set
;
;ADDWF   f, d    Add W and f                     1       00 0111 dfff ffff  C,DC,Z
;ANDWF   f, d    AND W with f                    1       00 0101 dfff ffff  Z
;CLRF    f       Clear f                         1       00 0001 lfff ffff  Z
;CLRW    -       Clear W                         1       00 0001 0xxx xxxx  Z
;COMF    f, d    Complement f                    1       00 1001 dfff ffff  Z
;DECF    f, d    Decrement f                     1       00 0011 dfff ffff  Z
;DECFSZ  f, d    Decrement f, Skip if 0          1(2)    00 1011 dfff ffff
;INCF    f, d    Increment f                     1       00 1010 dfff ffff  Z
;INCFSZ  f, d    Increment f, Skip if 0          1(2)    00 1111 dfff ffff
;IORWF   f, d    Inclusive OR W with f           1       00 0100 dfff ffff  Z
;MOVF    f, d    Move f                          1       00 1000 dfff ffff  Z
;MOVWF   f       Move W to f                     1       00 0000 lfff ffff
;NOP     -       No Operation                    1       00 0000 0xx0 0000
;RLF     f, d    Rotate Left f through Carry     1       00 1101 dfff ffff  C
;RRF     f, d    Rotate Right f through Carry    1       00 1100 dfff ffff  C
;SUBWF   f, d    Subtract W from f               1       00 0010 dfff ffff  C,DC,Z
;SWAPF   f, d    Swap nibbles in f               1       00 1110 dfff ffff
;XORWF   f, d    Exclusive OR W with f           1       00 0110 dfff ffff  Z
;
;
;BCF     f, b    Bit Clear f                     1       01 00bb bfff ffff
;BSF     f, b    Bit Set f                       1       01 01bb bfff ffff
;BTFSC   f, b    Bit Test f, Skip if Clear       1 (2)   01 10bb bfff ffff
;BTFSS   f, b    Bit Test f, Skip if Set         1 (2)   01 11bb bfff ffff
;
;
;ADDLW   k       Add literal and W               1       11 111x kkkk kkkk  C,DC,Z
;ANDLW   k       AND literal with W              1       11 1001 kkkk kkkk  Z
;CALL    k       Call subroutine                 2       10 0kkk kkkk kkkk
;CLRWDT  -       Clear Watchdog Timer            1       00 0000 0110 0100  TO,PD
;GOTO    k       Go to address                   2       10 1kkk kkkk kkkk
;IORLW   k       Inclusive OR literal with W     1       11 1000 kkkk kkkk  Z
;MOVLW   k       Move literal to W               1       11 00xx kkkk kkkk
;RETFIE  -       Return from interrupt           2       00 0000 0000 1001
;RETLW   k       Return with literal in W        2       11 01xx kkkk kkkk
;RETURN  -       Return from Subroutine          2       00 0000 0000 1000
;SLEEP   -       Go into Standby mode            1       00 0000 0110 0011  TO,PD
;SUBLW   k       Subtract W from literal         1       11 110x kkkk kkkk  C,DC,Z
;XORLW   k       Exclusive OR literal with W     1       11 1010 kkkk kkkk  Z
    
Post 18 Feb 2011, 09:10
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.