Support Forum (EN/FR)

Velleman Projects
It is currently Tue Oct 21, 2014 9:27 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Feb 11, 2008 6:09 pm 
Offline
Member
Member

Joined: Mon Feb 11, 2008 4:01 pm
Posts: 8
Hello

I'm very new to this stuff and I don't know if this is the right board to ask this but I'll ask anyway.

I built my own circuit with the PIC16F627 from the K8048. On it is Demo1 from it. You can see it with the link. However it doesn’t work and I don’t know why. Is the programming wrong or did I put a wire on the wrong pin or something like that? May you help me please?

S.

http://img114.imageshack.us/my.php?image=circuitsm5.jpg


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 6:43 pm 
Offline
Member
Member

Joined: Sun May 13, 2007 10:03 pm
Posts: 60
Hi snake,

I note from your image that you don't have any resistors between the PIC and the LED's. You also don't have a crystal and capacitors...have you changed the program to use the internal oscillator?

Have a look at this thread:
http://forum.velleman.be/viewtopic.php?t=1179

There is a link in one of the posts, where you can download the schematic for the K8048 in PDF form. You will also note in the thread, that a 3K3 resistor needs to go between +5V & Vpp (PIN 4). Don't forget to supply power through a regulated 5V supply, or through a 5V regulator (78L05 etc) Switches are connected to RA0 through RA3, with the other side of the switch going to +5V. On the PIC side of the switches, there should be a 10K resistor connected to ground for each pin...look at the schematic and all will become clear.

HTH.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 7:49 pm 
Offline
Member
Member

Joined: Sun May 13, 2007 10:03 pm
Posts: 60
Here is a link to how the circuit should be constructed:

http://img.photobucket.com/albums/v47/M ... ircuit.jpg


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 1:29 pm 
Offline
Member
Member

Joined: Mon Feb 11, 2008 4:01 pm
Posts: 8
Hello

I assume I won’t need the 680 resistors in front of the LEDs because I have 5V LEDs? I think I won’t need the switches either?

If I turn on the internal oscillator I won’t need the stuff on pin 15? Could you please give me the line of code to do this?

I just don’t understand why I need power on the Vpp pin. I thought this is some kind of programming voltage and not needed during runtime?

I have to admit that there was no fitting power supply around and my resistors are gone so I used the USB port power. I think this is regulated?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 6:52 pm 
Offline
Member
Member

Joined: Sun May 13, 2007 10:03 pm
Posts: 60
Snake wrote:
Hello

I assume I won’t need the 680 resistors in front of the LEDs because I have 5V LEDs?


What current is required to operate the 5V LED's? PORTA & PORTB pins can only sink/source 200mA...

Snake wrote:
I think I won’t need the switches either?


Maybe not right now, but when you get a little more adventurous, they may come in handy...

Snake wrote:
If I turn on the internal oscillator I won’t need the stuff on pin 15? Could you please give me the line of code to do this?


I won't give you the line, but I will point you in the right direction...have a look at the datasheet ( http://ww1.microchip.com/downloads/en/D ... 40300C.pdf ) Section 14 - pages 91 to 95, where you will see how to set up the config word.

Hint: in Demo1.asm, look at this line :

__CONFIG _BODEN_ON & _CP_OFF & _DATA_CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_ON & _XT_OSC


Snake wrote:
I just don’t understand why I need power on the Vpp pin. I thought this is some kind of programming voltage and not needed during runtime?


From the datasheet:
"When configured as MCLR, this pin is an active low RESET to the device. Voltage on MCLR/Vpp must not exceed Vdd during normal device operation."

In the config word, pin 4 is set as MCLR (See __CONFIG........... above)

Snake wrote:
I have to admit that there was no fitting power supply around and my resistors are gone so I used the USB port power. I think this is regulated?


It should be regulated by the motherboard/PC PSU, but I would strongly suggest that you dedicate a PSU solely for powering your project boards. If you manage to release the magic smoke that makes electronic circuits work, you will only need to get another PSU and not a new PC.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 9:02 pm 
Offline
Member
Member

Joined: Mon Feb 11, 2008 4:01 pm
Posts: 8
Hello

__CONFIG _BODEN_ON & _CP_OFF & _DATA_CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_ON & _INTRC_OSC_NOCLKOUT
I hope I've changed this line right.

Means this I can turn off this MCLR. Or make it this way "pin function is digital Input". So I won't have to care about it any more? Can I do this with changing the CONFIG to this "_MCLRE_OFF"?

I have to admit I was aware of the problem with the "new PC". I didn't take the power the directly from the motherboard. Long story... Anyway it wasn't good.

S.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 9:51 pm 
Offline
Member
Member

Joined: Sun May 13, 2007 10:03 pm
Posts: 60
Snake wrote:
Hello

__CONFIG _BODEN_ON & _CP_OFF & _DATA_CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_ON & _INTRC_OSC_NOCLKOUT
I hope I've changed this line right.


Yes, this is correct.

Snake wrote:
Means this I can turn off this MCLR. Or make it this way "pin function is digital Input". So I won't have to care about it any more? Can I do this with changing the CONFIG to this "_MCLRE_OFF"?


To be honest, I'm not entirely sure about this and since it only requires one resistor, I'd just insert one...you will probably find one easily enough from some "junk" circuit board. 3K3 Ohm - Orange Orange Red Gold.

Snake wrote:
I have to admit I was aware of the problem with the "new PC". I didn't take the power the directly from the motherboard. Long story... Anyway it wasn't good.


If you have any doubt in your mind, it is usually for a good reason....which sometimes gets ignored, ending up with disastrous outcomes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group