K8048 – self-made circuit with PIC16F627

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.

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

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:
[forum.vellemanprojects.eu/t/migration-to-breadboard/1088/1)

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.

Here is a link to how the circuit should be constructed:

img.photobucket.com/albums/v47/M … ircuit.jpg

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?

[quote=“Snake”]Hello

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

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

[quote=“Snake”]
I think I won’t need the switches either?[/quote]

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

[quote=“Snake”]
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?[/quote]

I won’t give you the line, but I will point you in the right direction…have a look at the datasheet ( 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

[quote=“Snake”]
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?[/quote]

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)

[quote=“Snake”]
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?[/quote]

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.

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.

[quote=“Snake”]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.[/quote]

Yes, this is correct.

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.

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