Pyro Propeller Clock POV

Questions and Comments on All Projects
ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Wed Apr 09, 2014 10:38 pm

lukeee wrote:Hi, I'm working on a project in college and I've based it on your Propeller clock. Which is great btw, its the only one I've found that is detailed and guided so well. :)
I'm making a PCB instead of wire-wrapping and I've come across a couple of problems..

I couldn't work out from your pictures or schematic which 74ls373 held the LEDs farthest away from the centre. is it the one connected to RB5 or RB4? I really need to know this because I'm taking away the last 3 LEDs as you did, and I don't want to remove the ones of the wrong 74ls373. The picture should explain what I'm on about. If you could get back to me that would be great.


Hi Luke,

In the software I defined the 16 leds (even though only 13 are used) as 8 bits upper (high byte) and 8 bits lower (low byte)

Code: Select all

#define LED_LATCH_H PORTBbits.RB4
#define LED_LATCH_L PORTBbits.RB5


The bit to enable or clock inputs to outputs on the 74_373/374 for the lower 8 bits is RB5.

The bit to enable or clock inputs to outputs on the 74_373/374 for the upper 8 bits (in my design i only used 5 of these bits) is RB4.

I REALLY, REALLY recommend that you get comfortable the software because you will likely need to tune it for your specific cpu fan or spinning motor.

GlmooD
Newbie Pyro
Posts: 2
Joined: Mon May 12, 2014 4:53 pm

Re: Pyro Propeller Clock POV

Postby GlmooD » Mon May 12, 2014 5:51 pm

hello,
am a newbie so bear with me, my 1st question is about the pin connections between the PIC18 and the CLK374,
pic18f252 pins>>>clk374 pins.. 2>>>3... 3>>>4... 4>>>7... 5>>>8... 15>>>13... 16>>>14... 17>>>17... 18>>>18... is this right?
and you said i have to change something in the software if i used a different frequency (am using 20MHz instead of 40MHz) so what do i have to change exactly, am using Pyoelectro_Pov.c..
and
saransound wrote:Hello , I want to know if the LED's have to be connected in an order to latch. The circuit shows 16 LEDs but i have used 13 LEDs so which latch do i fill up first. And how to wire the remaining 5 leds to the other latch.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Wed May 14, 2014 11:19 pm

GlmooD wrote:hello,
am a newbie so bear with me, my 1st question is about the pin connections between the PIC18 and the CLK374,
pic18f252 pins>>>clk374 pins.. 2>>>3... 3>>>4... 4>>>7... 5>>>8... 15>>>13... 16>>>14... 17>>>17... 18>>>18... is this right?
and you said i have to change something in the software if i used a different frequency (am using 20MHz instead of 40MHz) so what do i have to change exactly, am using Pyoelectro_Pov.c..
and
saransound wrote:Hello , I want to know if the LED's have to be connected in an order to latch. The circuit shows 16 LEDs but i have used 13 LEDs so which latch do i fill up first. And how to wire the remaining 5 leds to the other latch.


I'm not sure I understand this 100%
pic18f252 pins>>>clk374 pins.. 2>>>3... 3>>>4... 4>>>7... 5>>>8... 15>>>13... 16>>>14... 17>>>17... 18>>>18...

Can you draw it on a schematic?

If you're in doubt about how the data pins are connected from the 74_373 to the microcontroller, look at the software. There's a function for updating the LEDs that I used.

If you're going to slow the clock speed from 40 MHz to 20 MHz, then you'll need to chop the timer values in half. This way, like with the original program, you can output unique values every 1 degree.

RyanV
Newbie Pyro
Posts: 3
Joined: Mon Feb 24, 2014 5:52 pm

Re: Pyro Propeller Clock POV

Postby RyanV » Thu May 15, 2014 2:54 am

Chris,

I was wondering if you could provide clarification on your crystal oscillator. You state it is 40MHz, but the part number at jameco is for a 20MHz so which is it. Also, how did you get the crystal to function without the 20pF shunt capacitors? When I scope a 40MHz crystal with my PIC it only oscillates at approx. 13.3MHz and when I remove the shunt caps the oscillator does not oscillate at all. To achieve the 40 MHz could a 10MHz oscillator be used with the PLL to get 4 times the 10Mhz clock speed?

Oh and could I get your last name as I keep getting marks taken off for not citing the original author completely.

If you could get back to me asap it would be appreciated, I'm at my wits end and I've been prototyping this for my senior project since Jan. and have yet to get it to do more than the initial set_leds function.

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Thu May 15, 2014 7:27 pm

RyanV wrote:Chris,

I was wondering if you could provide clarification on your crystal oscillator. You state it is 40MHz, but the part number at jameco is for a 20MHz so which is it. Also, how did you get the crystal to function without the 20pF shunt capacitors? When I scope a 40MHz crystal with my PIC it only oscillates at approx. 13.3MHz and when I remove the shunt caps the oscillator does not oscillate at all. To achieve the 40 MHz could a 10MHz oscillator be used with the PLL to get 4 times the 10Mhz clock speed?

Oh and could I get your last name as I keep getting marks taken off for not citing the original author completely.

If you could get back to me asap it would be appreciated, I'm at my wits end and I've been prototyping this for my senior project since Jan. and have yet to get it to do more than the initial set_leds function.


Hi Ryan,

Unfortunately I wasn't able to properly source a 40 MHz crystal for the parts list, so I did the next best thing I could think of and put a 20 MHz. Sorry about that...but a 20 MHz crystal could be installed and used with minimal changes to the firmware code (or at least that was my thought process).

I've never scoped a crystal, but I've used all different types of crystals on breadboards with PIC 18F452/252's and they worked fine without the caps. I'm not saying you should omit the caps, but most of what I've done was for fun to make something work and timing always worked. Some PICs do have internal PLLs that can be used, I never had to use them. I just set the oscillator control bit to HS (high speed) and it always worked for me.

Please credit/cite your source as http://www.pyroelectro.com. I collaborate and build with many people and do not wish to take full credit for all the things we've built.

Good luck!

RyanV
Newbie Pyro
Posts: 3
Joined: Mon Feb 24, 2014 5:52 pm

Re: Pyro Propeller Clock POV

Postby RyanV » Thu May 15, 2014 10:37 pm

Ummm, ok. So, now I would like to know if the WriteTimer0( 0xFE49) in the InterruptHandlerLow() is the only WriteTimer0 that needs to be changed for a 20MHz crystal. It would need to be 0xFF24 for it to delay 21.9us or 219.3 PIC instructions, right?

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Fri May 16, 2014 2:12 am

RyanV wrote:Ummm, ok. So, now I would like to know if the WriteTimer0( 0xFE49) in the InterruptHandlerLow() is the only WriteTimer0 that needs to be changed for a 20MHz crystal. It would need to be 0xFF24 for it to delay 21.9us or 219.3 PIC instructions, right?


Anywhere the writetimer0() function is used to reset the timer, you'll need to verify the value is how you want it to be.

I documented the I calculation I used to arrive at 0xFE49 on this page:
http://www.pyroelectro.com/projects/pyro_propeller_clock_pov/perfect_timing.html It looks like i messed up the last part of the formula, should be: [43.86us / (1 / 10,000,000) ]

If your fan motor also does 3800 RPM, then when we plug in 5,000,000 for the clock you get 219 instruction cycles out giving us 0xFF24. Sounds like you got it!

GlmooD
Newbie Pyro
Posts: 2
Joined: Mon May 12, 2014 4:53 pm

Re: Pyro Propeller Clock POV

Postby GlmooD » Sun Jun 22, 2014 4:57 pm

Hello,
my project finally worked perfectly :P , but i have a tiny problem, i was asked to draw a flow chart for the software, and write a description for each part of the software for my final presentation :shock: . So if any1 can help me with that i would be really appreciated.
and i got a question about the circuit the 47uF capacitor, what is it for and how do you determine its value..?!
the circuit and the software are attached..
i hope to get a reply before Thursday :oops:
schematic_large.png
schematic_large.png (34.5 KiB) Viewed 15788 times
Attachments
pyoelectro_pov.c
(4.81 KiB) Downloaded 440 times

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Wed Jun 25, 2014 3:51 pm

GlmooD wrote:Hello,
my project finally worked perfectly :P , but i have a tiny problem, i was asked to draw a flow chart for the software, and write a description for each part of the software for my final presentation :shock: . So if any1 can help me with that i would be really appreciated.
and i got a question about the circuit the 47uF capacitor, what is it for and how do you determine its value..?!
the circuit and the software are attached..
i hope to get a reply before Thursday :oops:


Awesome!

Can you take a photo of your project? I'd really like to see it.

47uF on the output side of the 7805 acts like a water-tower of electrical current, storing it. Sometimes some devices in the circuit need a surge of electrical current that the 7805 cannot provide, so the capacitor (like a water tower) will feed the excess electrical current it is storing to wherever it is needed. This value is chosen based off of how much current you expect to flow through the circuit. The more current, the larger the capacitor value. It is common for small circuits like this one to use 10uF - 100uF directly off of the 7805 output.

I'll describe the software in more detail, hopefully you can build a visual diagram from my words:

The software flows in a circle. Using one timer interrupt (low priority) and one external input interrupt (high priority).

[1]
The main loop sets up the interrupts and initializes values. Then it goes into a forever while loop that monitors the digits being displayed and increments them every second.

[2]
If the P-O-V passes over the IR emitter LED (the home location), the (high priority) external interrupt pauses the main loop, resets the location counter, sets up the timer and returns to the main loop.

[3]
When timer0 reaches 0xFFFF from 0xFFE0 (counting up), it triggers (low priority) interrupt, checks which led_count location (0-360 degrees) we are at and sets the output LEDs for the specific location (i.e. if(led_count < 0x11D && led_count > 0x117) then - set LEDs for first digit ).

Since the counter doesn't need all 360 degrees, I used 325 counts just so that I could get the digits to appear at the top of the P-O-V.

It's before thursday...hopefully this helps you out.

alexfenix
Newbie Pyro
Posts: 1
Joined: Mon Aug 04, 2014 9:20 pm

Re: Pyro Propeller Clock POV

Postby alexfenix » Mon Aug 04, 2014 9:24 pm

can i have the .hex file? i can´t make it with mplab x :(

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Mon Aug 04, 2014 10:30 pm

alexfenix wrote:can i have the .hex file? i can´t make it with mplab x :(


Hello,

Download & install the C18 compiler, connect it & make a project with it in MPLABX.

Then setup the configuration bits as appropriate for the PIC you're using.

yogesh909
Newbie Pyro
Posts: 1
Joined: Sat Aug 23, 2014 3:43 pm

Re: Pyro Propeller Clock POV

Postby yogesh909 » Sat Aug 23, 2014 4:04 pm

Hey Chris,
I tried to bulid the propeller clock as my project ,which you have build using only one latch(LS373) and only 8 leds ,but the MCU i have used is same(PIC 18f252).
I have completed the hardware part.
So could you help me in the software part i.e can you say which part of the software has to be modified..
And also i am using a hard disk for rotation purpose, whose speed is around 7200 rpm but after keeping the pcb, battery and wood, it might decrease !!!
So how to calculate delay time or the MCU will calculate itself using ir emiiter and reciever??
So my questions are
1. Any problems in using 1 latch and 8 leds.? :?:
2. What are the modifications in the code? :|
3. What does the big if else loop does ??( i didnt understand)! :(
4.What about the delay time? :|
5.Can you provide a code for analog type clock code? :!:

Plz help me out!(Tuesday is the deadline for me to submit my project)
Any help would be appreciated!! :)
Plz reply asap
only one more day left!!!

nhatvu1605
Newbie Pyro
Posts: 1
Joined: Fri Nov 14, 2014 4:36 am

Re: Pyro Propeller Clock POV

Postby nhatvu1605 » Fri Nov 14, 2014 4:40 am

Hi, i need your software libraries:
delays.h
timers.h
capture.h
Can you send these file to my email?
thank you ;)

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: Pyro Propeller Clock POV

Postby ThePyroElectro » Sat Nov 15, 2014 12:36 am

nhatvu1605 wrote:Hi, i need your software libraries:
delays.h
timers.h
capture.h
Can you send these file to my email?
thank you ;)


These are part of the MPLAB C18 compiler. Please find them for free download at http://www.microchip.com under compilers.

jaaml1377
Newbie Pyro
Posts: 1
Joined: Fri Dec 18, 2015 3:19 pm

Re: Pyro Propeller Clock POV

Postby jaaml1377 » Fri Dec 18, 2015 3:29 pm

hello,

i have got a question. did you do the schematic with i.e. EAGLE ? if so could you upload that file so i could create myself a PCB, that would save me some wireing :P

if not i have got an about those blue bus lines.

from PIC18F252 you connect RC4 -- RC 7 to 13,14,17,18 of 374 but which to which ? (also RA0 -- RA3 to 3,4,7,8)

Got that answer on page 3


EDIT:

i also use a 20MHz and i would like to know where i would need to change the values. i searched for WriteTimer0 and found only this entries

\pyoelectro_pov.c (3 hits)
Line 131: WriteTimer0( 0xF094 ); //0x3CAF );
Line 209: WriteTimer0( 0xFE49 ); //Reset Timer0 for 20mS Delay
Line 242: WriteTimer0( 0xFFE0 );
\pyro_pov_text.c (3 hits)
Line 152: WriteTimer0( 0xF094 ); //0x3CAF );
Line 223: WriteTimer0( 0xFE49 ); //Reset Timer0 for 20mS Delay
Line 248: WriteTimer0( 0xFFE0 );
\pyro_pov_light_show.c (3 hits)
Line 83: WriteTimer0( 0xFF94 ); //0x3CAF );
Line 136: WriteTimer0( 0xFE00 ); //Reset Timer0 for 20mS Delay
Line 167: WriteTimer0( 0xFFE0 );
\pyro_pov_logo.c (3 hits)
Line 202: WriteTimer0( 0xF094 ); //0x3CAF );
Line 260: WriteTimer0( 0xFD89 ); //Reset Timer0 for 20mS Delay //315--FCEA
Line 283: WriteTimer0( 0xFE49 );



so like you wrote here: viewtopic.php?f=2&t=409&start=75#p2949

i need to change it to 0xFF24. so do i only need to change the 0xFE49 to 0xFF24 ?

EDIT: i also understand your calculation but how did you calculate that 219 is 0XFF24 ? if 219 is DEC than DB would ne HEX


Return to “Projects”

Who is online

Users browsing this forum: No registered users and 3 guests