Powered by Invision Power Board


Forum Rules Forum Rules (Please read before posting)
  Reply to this topicStart new topicStart Poll

> Propeller Display
Just4Kason
Posted: December 05, 2009 10:42 am
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




i wish to make a propeller display and i hope that i can get some help from all of you.
i use pic16f877a in this project. below i the schematic of the project:
http://i21.photobucket.com/albums/b260/kslim_84/sch.jpg
if i want to change my Vcc to 3v then do i need to change a lower resistance resistor?
what i think is if i don't change the resistor, my led might not bright enough.
i would very appreciate if i can get help for all of you.
PMEmail Poster
Top
Shocker
Posted: December 05, 2009 02:02 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




Yes you do need to change the resistor to keep the original brightness.

Resistor = (Vs - Volt drop of LED)/desired current


Although, since your only flashing the LEDs on and off. You might want to put more current through the LED than usual.
PMEmail Poster
Top
Just4Kason
Posted: December 05, 2009 02:09 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




thanks for your help.
is it i only need to change those resistor?
anything else?
PMEmail Poster
Top
Shocker
Posted: December 06, 2009 01:00 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




QUOTE (Just4Kason @ December 05, 2009 02:09 pm)
thanks for your help.
is it i only need to change those resistor?
anything else?

The resistor is the only thing you need to change for the LED.

Can the PIC itself operate on 3V?
PMEmail Poster
Top
Just4Kason
Posted: December 06, 2009 02:51 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




before this, i did an experiment by using a dc motor and the pic, i change the input voltage in between 1 to 5v the motor still can run.
so, it should be no problem in this project.
i will build up the circuit board asap. only in the coding part, i still need u to give me ur help and opinion.
thanks for advance.
PMEmail Poster
Top
Just4Kason
Posted: December 10, 2009 08:28 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




from the calculation, i found that if i change the source to 3v, i dun need to add a resistor to led because led can stand for 3v.
according to the original circuit i post above, led voltage is 4.34v and current is 2mA.
hence, i take out the resistor have no problem, is it?
PMEmail Poster
Top
Just4Kason
Posted: December 19, 2009 12:36 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




i use green led connect in series with 10ohm resistor to MCU with 3v source.
i connect the circuit on breadboard and transfer the code into MCU already but it is not functioning.
even i increase my source to 4.5v and change the resistor to 33ohm but it still not functioning. i check the citcuit with multimeter, i found the there is no current flow through led. although i tested with a vry simple coding it also cannot function.
what else can i do or how to troubleshoot the problem?
PMEmail Poster
Top
Shocker
Posted: December 19, 2009 10:02 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




Hi,

All LEDs need a resistor unless it specifies otherwise. Look up semiconductor thermal runaway and it should explain the reason why you need a resistor.

You could have burnt the LED out or you could have burnt the microcontroller out by not using the resistor.

For a brief second attach the voltage source directly across the LED without the microcontroller or anything else. If the LED is working it should light up straight away so long as your powering it off a source that is big enough.

If this is working, next check to see if the microcontroller is functioning correctly. Load an old program in it and make sure it still operates correctly.

If both of these are functioning correcly, it looks like your either wired it up incorrectly or there is something wrong with your code. Load your code on the internet somewhere and let us have a look at it and we might be able to debug it for you.

I am assuming you do have your MCLR line and your second set of Vss and Vdd wired up. If not then this is probably the reason why its not functioning.
PMEmail Poster
Top
Just4Kason
Posted: December 22, 2009 03:48 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




the PIC i'm using is P16F877A
here is my coding. i write a very simple coding to test my PIC. i tried it with virtual breadboard software and it can function.

PROCESSOR P16F877a
#INCLUDE "P16F877a.inc"
__CONFIG _HS_OSC & _CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF

ORG 0X00
GOTO MAIN
ORG 0X04
GOTO MAIN

MAIN
BANKSEL TRISB
MOVLW H'00'
MOVWF TRISB

BANKSEL PORTB
MOVLW H'FF'
MOVWF PORTB

END

this is the circuit i am connecting. for testing purpose, now i only connect 1 led at port b. can i connect all the led to 1 resistor as in the circuit?
user posted image
when i put the power supply, there is no current flow to pin MCLR. why?

for crystal, im using 20MHz, if i use from different manufacturer crystal, i need to change the configure in my coding? do i need to change to XT, HS or EC?

do i need to on back all those LVP, WDT and CP in the config ?

This post has been edited by Just4Kason on December 22, 2009 03:54 pm
PMEmail Poster
Top
Ice-Tea
Posted: December 22, 2009 04:11 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 3,077
Member No.: 462
Joined: October 07, 2003




Pin mclr is a reset pin and is not supposed to draw current beyind the uA range.
PMEmail PosterUsers Website
Top
Just4Kason
Posted: December 22, 2009 04:53 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




if it is up to mA, will it burn the MCU?
wat i refer from book is, it connect 5V to 10K resistor, it is alr 0.5mA
so, wat value should i put?
PMEmail Poster
Top
Shocker
Posted: December 22, 2009 08:00 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




QUOTE (Just4Kason @ December 22, 2009 04:53 pm)
if it is up to mA, will it burn the MCU?
wat i refer from book is, it connect 5V to 10K resistor, it is alr 0.5mA
so, wat value should i put?

A 10k resistor will be fine. The microcontroller will take as much current as it needs. I think the 10k resistor is for a 'just in case' situation.

Eg. Just in case the PIC decides to do something random and pull a lot of current through the pin. The resistor then saves the day by not allowing your PIC to burn out from over current and to stop the power supply voltage lowering.
PMEmail Poster
Top
Shocker
Posted: December 22, 2009 08:09 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




QUOTE (Just4Kason @ December 22, 2009 03:48 pm)
the PIC i'm using is P16F877A
here is my coding. i write a very simple coding to test my PIC. i tried it with virtual breadboard software and it can function.

  PROCESSOR P16F877a
  #INCLUDE "P16F877a.inc"
                __CONFIG _HS_OSC & _CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF

    ORG  0X00
    GOTO  MAIN
    ORG  0X04
    GOTO  MAIN
   
MAIN
  BANKSEL  TRISB
  MOVLW  H'00'
  MOVWF  TRISB

  BANKSEL  PORTB
  MOVLW  H'FF'
  MOVWF  PORTB

  END

this is the circuit i am connecting. for testing purpose, now i only connect 1 led at port b. can i connect all the led to 1 resistor as in the circuit?
user posted image
when i put the power supply, there is no current flow to pin MCLR. why?

for crystal, im using 20MHz, if i use from different manufacturer crystal, i need to change the configure in my coding? do i need to change to XT, HS or EC?

do i need to on back all those LVP, WDT and CP in the config ?

It would be a good idea to tell the compiler that your using an external oscillator. It doesnt matter about the manufacturer at all. You need to use XT, ive always used XT with a crystal. What is HS and EC for again? It should be in the datasheet for the PIC.

Ive never seen "H'00'" before. Does this actually work? For hex i thought you usually stated that it was hex by typing "0X" infront of the hex value.

Yes you can only use one resistor but the outcome isnt brilliant. As the brightness of the LED's change depending on the amount of resistors turned on. If you have only one LED lit, it will be bright. If you have all eight LED's lit, they will be dim. Because the LED's have to share the current capabilities of that one resistor. Try it and you'll see what i mean.
Preferably, you should have one resistor for each LED and the brightness will stay the same regardless of how many is lit.
PMEmail Poster
Top
Just4Kason
Posted: December 23, 2009 05:12 am
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




that's sond correct. so it better to put 1 resistor for each led.
how about the LVP, WDT and CP? do i need to turn them ON?
instantly, what i wan to test is my MCU alr burn or not. if so, no matter how i try also will not get the result.

for ur information,
for hex, H'00' and 0x00 will have the same result.
for binary, usually i'll use B'00101100'. i think u also write in such a way.
for decimal, D'255' and .255 both also will get the same result.

just share with u wat i found
The LP oscillator
The LP, or low power oscillator, is designed to trade speed for low power operation. Although this circuit shares the same topology (schematic) as the XT
oscillator, the transistors used in the LP oscillator have a higher Rdss value and draw considerably less current. This configuration is optimum for low frequency
operation, because it trades the away unnecessary high frequency responses for dramatically reduced operating currents.

The XT oscillator
The XT oscillator is designed to give a compromise between high frequency performance and modest power consumption. The gain of this oscillator is as
much as 15 times higher than the LP oscillator. This middle range will be used for frequencies up to 4 MHz.

The HS oscillator
The HS oscillator is designed to give the maximum gain and frequency response. The current consumption is accordingly higher. The gain is roughly five times higher than that of the XT oscillator. This gives the PICmicro the ability to operate at frequencies up to 20 MHz.

This post has been edited by Just4Kason on December 23, 2009 05:14 am
PMEmail Poster
Top
Shocker
Posted: December 24, 2009 01:02 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




QUOTE (Just4Kason @ December 23, 2009 05:12 am)
that's sond correct. so it better to put 1 resistor for each led.
how about the LVP, WDT and CP? do i need to turn them ON?
instantly, what i wan to test is my MCU alr burn or not. if so, no matter how i try also will not get the result.

for ur information, 
for hex, H'00' and 0x00 will have the same result.
for binary, usually i'll use B'00101100'. i think u also write in such a way.
for decimal, D'255' and .255 both also will get the same result.

just share with u wat i found
The LP oscillator
The LP, or low power oscillator, is designed to trade speed for low power operation. Although this circuit shares the same topology (schematic) as the XT
oscillator, the transistors used in the LP oscillator have a higher Rdss value and draw considerably less current. This configuration is optimum for low frequency
operation, because it trades the away unnecessary high frequency responses for dramatically reduced operating currents.

The XT oscillator
The XT oscillator is designed to give a compromise between high frequency performance and modest power consumption. The gain of this oscillator is as
much as 15 times higher than the LP oscillator. This middle range will be used for frequencies up to 4 MHz.

The HS oscillator
The HS oscillator is designed to give the maximum gain and frequency response. The current consumption is accordingly higher. The gain is roughly five times higher than that of the XT oscillator. This gives the PICmicro the ability to operate at frequencies up to 20 MHz.

LVP is low voltage programming which is only used on certain devices and you need a special programmer for it like the pic start plus for the microchip version.

WDT is a watch dog timer. If your program runs off with it self or gets stuck somewhere, the watch dog timer kicks in and resets the microcontroller for you. You only need to use this with a bigger program where there might be a bug. You have to calculate/estimate when the watch dog timer will kick in and clear the timer at intervals to make sure it doesnt reset your microcontroller when you dont want it to.

I cant remember what CP is. It will be in the datasheet and it should give you a good explanation. Im pretty sure that you dont need it.

The H'00' thing actually makes sense and ive never thought about it properly. As ive always entered binary the same way as you and ive always put decimal in with D'00'.


I know why its not working......GOD DAMN! I cant believe i didnt spot it before.
The PIC that your using has an ADC on it doesnt it?
If it does, you have to tell the PIC that the I/O's are digital and not analogue.
I cant remember exaclty how you do it. I think you need to look at ADCON. Its been a while since i last programmed. I cant find any of my old programs otherwise id be able to tell you.


EDIT: I found my programs whilst doing some work. Try putting this in to your code if your PIC has an ADC. This should do the trick. I cant remember what they do exactly.

MOVLW 07H
MOVWF CMCON
CLRF ANSEL
PMEmail Poster
Top
Just4Kason
Posted: December 24, 2009 09:08 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




yes, the MCU can be used in AC or DC and it is tested, everything fine. with mean my MCU is fine. by default, dun it self alr set to DC?
nevermind, i will try with teh code that u gave. i'll away for a few day, after come back i will try it.
PMEmail Poster
Top
Shocker
Posted: December 24, 2009 09:46 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,603
Member No.: 3,558
Joined: November 06, 2005




QUOTE (Just4Kason @ December 24, 2009 09:08 pm)
yes, the MCU can be used in AC or DC and it is tested, everything fine. with mean my MCU is fine. by default, dun it self alr set to DC?
nevermind, i will try with teh code that u gave. i'll away for a few day, after come back i will try it.

By default, PICs configure themselves to analogue.
PMEmail Poster
Top
Just4Kason
Posted: December 30, 2009 07:11 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




i found out what is the problem, it is crystal having problem only.
everytime i press the reset button it cannot function properly. after replaced with another crystal then t it can function properly.
test for so many day, just because of crystal...
i bought a spoil crystal, so many day alr dun know still can go to claim a new one or not? else i need to buy another
PMEmail Poster
Top
Just4Kason
Posted: January 08, 2010 01:05 pm
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 11
Member No.: 27,237
Joined: November 17, 2009




i done my propeller display last night. thank you so much for your helps. i found that the most imortant part is the balancing of the propeller. else it will not spin smoothly. other than that, delay time alsi very important in order to display the word or picture. i feel very happy since i did it.
i will make another to overome the problems i met in the project. i hope that you can still help me and give your opinion to me.
anyway, thanks again.
PMEmail Poster
Top
pal.eragon
Posted: January 11, 2010 08:29 pm
Reply to this postQuote Post


Newbie
*

Group: Members+
Posts: 2
Member No.: 27,934
Joined: January 11, 2010




i also want to make an propellerdisplay or magic stick where do i start with
PMEmail Poster
Top
pal.eragon
Posted: January 11, 2010 08:33 pm
Reply to this postQuote Post


Newbie
*

Group: Members+
Posts: 2
Member No.: 27,934
Joined: January 11, 2010




can i do it with atmega16 or 32 microcontroller please help with buikding it from scratch hope a quick reply
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


:: support us ::




ElectronicsSkin by DutchDork & The-Force