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.

PIC16F627A

Status
Not open for further replies.

Tumelo

New Member
Hello everyone, i am seriously in need of your help. I've got a project on PIC16F627A that i should submit in two days time. Well if i had an idea of what was going on with this, i wouldn't have asked for help... thanks to our useless lecturer.

Here are the projects specifications, please help, anyone?
 

Attachments

  • IIE20BT_Practical_1 Semeste2 (2015) - Copy.txt
    1.3 KB · Views: 292
The project is simple enough, although the exact details don't seem to make any sense? - but if you're incapable of doing it, then your lecturer needs to know this - cheating helps no one.

The examples in my tutorials include everything you need to implement it though.
 
I'LL HAVE TO TAKE A LOOK AT YOUR TUTORIALS, THEY SEEM TO BE HELPFUL... AS FOR MY LECTURER, HE JUST COMES IN CLASS AND TALK JOKES, THAT'S WHY I OUGHT TO DO SOMETHING ABOUT IT. I WOKE UP TODAY AND LOOKED FOR SITES LIKE THIS ONE. I CAN'T STAND AND WAIT FOR JESUS TO COME BACK, I'VE GOT SOME CODING TO DO. SO NIGEL GOODWIN, WHERE DO I START TO LOOK AT FOR ME TO UNDERSTAND THIS PROJECT WELL. I WILL DO IT AND I'LL SHOW YOU. I JUST NEED A LIGHT, AND I'LL FIND A WAY.
 
Tumelo... Are you prepared to put some effort in ? what do you know / understand about PIC mcu ? do you have a basic electronic ( Ohms Volts Amps ) knowledge , if so start here ..... add in some voltage connections / values ... etc
twoleds.jpg
 
Do you know, I have been in electronics for 50 years and I don't have a clue about what is required.

Do the LEDs continue to blink for the whole time the circuit is active?
What rate of blinking is required?

This is just another mess from an electronics lecturer that does not have a clue what he is talking about.
 
The way I read it is..

Two LED's connected to RB0 and RB1.....
Set the LED's to blink ( at a rate set by you )

Whilst RB0 is blinking, RB1 should be off..
Whilst RB1 is blinking, RB0 should be off..

The blink rate should be slow enough to be visible but fast enough to see that its blinking..

I would set the blink to 5 times a second!!!

As Nigel has already said... All the code is on his tutorial page ( the pic16f628a is a pic16f627a with twice the program memory so the code will be fine...)
 
Are you going to use negative logic as required in the diagram above or be sensible and use positive logic ??????
 
This is the text of the task....
Please note this Practical is due Tuesday 15 September for practical group 1, failing to submit can and will lead to subtraction in marks.
Design a system that will blink two LEDS for 1 seconds using PIC16F627A.
Electrical connections
Connect LED1 to RB0
Connect LED2 to RB1
PIC16F627A
The circuit operates like this:
When the power is ON LED at RB0 it should blink for 1 second, The LED at RB1 is OFF while the LED at RB0 is blinking.
When the LED at RB1 is blinking, the LED at RB0 is OFF.
Tasks
Draw a fully labeled diagram of the circuit explained above.
Develop a flowchart to indicate how your program will execute.
Demo your project and submit the document together with the mark sheet attached to this assignment


Working 70% Weight Obtained
Electrical Connections (Is LEDs connected to Rb0 and Rb1) 20
Is LED Rb0 blinking 20
Is LED Rb1 blinking 20
LEDS are blinking 1 seconds and according to the question? 40
TOTAL 100

Paperwork 30% Weight Obtained
Aim of the Project 10
Circuit diagram 10
Comment Block (Check for: Student Number, Name, Description) 10
Efficient comment throughout the code. 20
Is the flowchart designed using the right symbols? 20
Does the code correspond to the flowchart design? 30



Colin ... The lecturer may be lacking.. does not mean the students should be... the explanation is vague perhaps deliberately ? I think what it means is LED 1 and LED 2 should not be ON at the same time ie 1 second ( a blink ).... positive / negative at this point it is irrelevant ...
Lets be positive...
 
Last edited:
For 5Hz you just need 100mS delay and a bit of coding to turn on the bits and make them high and low.
 
Do you know, I have been in electronics for 50 years and I don't have a clue about what is required.

Colin Did you really mean to say this.?:rolleyes:

Like Granddad has shown, it is fairly obvious what the OP is asking ie: for alternate blinking of two LED's at a 1 Sec rate. eg: post #11
 
Last edited:
Colin Did you really mean to say this.?:rolleyes:

Like Granddad has shown, it is fairly obvious what the OP is asking ie: for alternate blinking of two LED's at a 1 Sec rate. eg: post #11

I wouldn't say it's "fairly obvious" at all, and that's only one way you 'might' interpret what it says.

I'd like to imagine that the OP has translated it from some foreign language, and that's NOT exactly how the question is worded.
 
I wouldn't say it's "fairly obvious" at all, and that's only one way you 'might' interpret what it says.

I'd like to imagine that the OP has translated it from some foreign language, and that's NOT exactly how the question is worded.

We can probably agree that the period of the blinking for each LED is undefined. It is clear they are not on at the same time, and the total "blinking period" for each is defined as 1 sec. Aside from not knowing the period for the blinking, can you show at least two different interpretations of the rest of the assignment? It seems to me that should the OP be able to complete the design, regardless of the individual LED blink period, then adjusting that rate can come later.

John
 
Hello everyone, thank you for your replies, i am getting somewhere. Fins attached below my code. The LED's are blinking, problem now lies with this 1 sec, the lecturer told us we should calculate 1 sec, which ofcourse i don't know. My other problem is i get an error message after few minutes of simulating my code. The error states "Stack overflow hardware" something like that. I can't fix it; i still have to connect it on the bread broard. HERE IS MY CODE: Please advise me.

fx equ h'20'

org 0
bsf 3,5
movlw 40h
movwf 86
bcf 3,5
delay movlw 161
movwf fx

main
bsf 6,0
bcf 6,0
bsf 6,1
bcf 6,1
call delay
goto main

end ;END OF THE PROGRAM
 

Attachments

  • New Text Document.txt
    891 bytes · Views: 218
There are many resources for calculating loop constants to generate a delay. Here is a popular one:
I entered an assumed oscillator frequency of 4 MHz, and here is what you get for a 1 sec delay:
Code:
; Delay = 1 seconds
; Clock frequency = 4 MHz

; Actual delay = 1 seconds = 1000000 cycles
; Error = 0 %

cblock
d1
d2
d3
endc

;999997 cycles
movlw 0x08
movwf d1
movlw 0x2F
movwf d2
movlw 0x03
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0

;3 cycles
goto $+1
nop

I am not sure that simple approach will help you, as you have to be flashing an LED for the for the 1 second delay period. On the other hand, if you flash at, say 6 times per second, you can just add a counter (n=6) and when that expires, switch the output pin and continue the flashing routine. There are, of course, other ways to skin this cat.

John
 
Sir Jpanhalt, how and where do i put the code in conjuction with my source code... it gives me some errors.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top