Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 21st May 2007, 07:39 PM   (permalink)
Experienced Member
 
pasanlaksiri is a jewel in the roughpasanlaksiri is a jewel in the rough
Send a message via Yahoo to pasanlaksiri
Smile LCD Alarm clock with PIC16F877 ( some pics included )

This is the link for schematics and info








This is the link for schematics and info

Last edited by pasanlaksiri; 23rd May 2007 at 08:03 AM.
pasanlaksiri is offline   Reply With Quote
Old 21st May 2007, 08:24 PM   (permalink)
Experienced Member
 
Blog Entries: 2
gramo is just really nicegramo is just really nicegramo is just really nicegramo is just really nice
Default

Very Shnazzy!

__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline   Reply With Quote
Old 21st May 2007, 09:31 PM   (permalink)
Experienced Member
BeeBop is just really niceBeeBop is just really niceBeeBop is just really nice
Default

I agree, it is very shnazy! Nice!
BeeBop is online now   Reply With Quote
Old 22nd May 2007, 01:27 AM   (permalink)
Experienced Member
 
Blog Entries: 1
Sceadwian is just really niceSceadwian is just really niceSceadwian is just really nice
Send a message via AIM to Sceadwian Send a message via Yahoo to Sceadwian
Default

For the love of sanity scale your images!!!!
__________________
Curiosity killed the cat; That's why they have nine lives.

Sceadwian is offline   Reply With Quote
Old 22nd May 2007, 01:47 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

You win the prize for the longest delay routine ever.
Code:
procedure delay_1us( byte in x ) is
   if target_cpu == sx_12 then

      pragma keep page, bank
      
      -- cycles for argument passing, call and return
      const call_overhead = 14

      if target_clock > 10_000_000 then

         const once_through        = 16
         const overhead            = 
            ( ( ( call_overhead + once_through ) * 1_000_000 ) / target_clock )

         const one_us_cycles       = target_clock / 1_000_000
         const outer_loop_overhead = 12
         const inner_loops         = 
            ( one_us_cycles - outer_loop_overhead - 6 )  / 4

         var byte outer_counter, inner_counter
         const byte yy = - ( overhead + 1 )
         const byte zz = inner_loops + 1
         assembler
            local outer_loop, inner_loop
            -- get argument, substitute zero if too small
                 movlw   yy
            bank addwf   x, w
                 skpc
                    movlw 0
            -- make local copy
            bank movwf   outer_counter
                 incf    outer_counter, f

            -- outer loop must take 1uS 
         outer_loop:

            -- inner loop takes 6 + 4 * n
                 movlw zz
            bank movwf   inner_counter
            page inner_loop
         inner_loop:
                 decfsz  inner_counter, f
                    goto    inner_loop 

            -- outer loop again?
            page outer_loop
            bank decfsz  outer_counter, f
                    goto    outer_loop

         end assembler

      elsif target_clock == 10_000_000 then

         const overhead_us = ( call_overhead + 16 ) / 10

         var byte counter
         const byte abc = - overhead_us
         assembler
            local loop, next
            -- get argument, correct for overhead, minimum is zero
                 movlw   abc
            bank addwf   x, w
                 skpc
                    movlw 0
            -- loop, total cycles in assembler block is 16 + 10 * n
            bank movwf   counter
                 incf    counter, f
         loop:
                 nop
            page goto    next
         next:
            page loop
                 decfsz  counter, f
                 goto    loop
         end assembler

      elsif target_clock == 4_000_000 then
      
         const overhead_us = ( call_overhead + 11 ) / 4

         var byte counter
         var byte xyz = - overhead_us
         assembler
            local loop
            -- get argument, correct for overhead, minimum is zero
                 movlw   xyz
            bank addwf   x, w
                 skpc
                    movlw 0
            -- loop, total cycles in assembler block is 11 + 4 * n
            bank movwf   counter
                 incf    counter, f
            page loop
         loop:
                 decfsz  counter, f
                    goto    loop
         end assembler

      else
         pragma error -- clock must be 4 or >=10 MHz
      end if

   elsif ( target_cpu == pic_14 ) | ( target_cpu == pic_12 ) then
 
      const ips = target_clock / 4
      if target_clock >= 10_000_000 then

         const i_iteration  = 5
         const i_overhead   = 9 
         const d_iteration  = ( i_iteration * 1_000_000 ) / ips
         const d_overhead   = ( i_overhead * 1_000_000  ) / ips
         const x_iteration  = - d_iteration
         const x_overhead   = - ( d_overhead + ( d_iteration / 2 ) + 1 )
         
         var byte v_overhead   = x_overhead
         var byte v_iteration  = x_iteration

         assembler 
         local loop
            page loop
            movfw x
            addwf v_overhead, w
         loop: 
            skpc
               retlw 0
            addwf v_iteration, w
            goto loop
         end assembler

      elsif target_clock == 4_000_000 then

         const i_iteration  = 4
         const i_overhead   = 9 
         const d_iteration  = ( i_iteration * 1_000_000 ) / ips
         const d_overhead   = ( i_overhead * 1_000_000  ) / ips
         const x_iteration  = - d_iteration
         const x_overhead   = - ( d_overhead + ( d_iteration / 2 ) + 1 )

         var byte v_overhead   = x_overhead
         var byte v_iteration  = x_iteration

         assembler 
         local loop
            page loop
            movfw x
            addwf v_overhead, w
            skpc
               retlw 0
         loop:
            addwf v_iteration, w
            skpnc
               goto loop
         end assembler

      else
         pragma error -- clock must be 4 or 10 MHz
      end if
   else
      pragma error -- cpu must be sx_12 or pic_14
   end if
end procedure
All that to delay 1uS. WOW.

Mike.
Pommie is offline   Reply With Quote
Old 22nd May 2007, 02:35 AM   (permalink)
Experienced Member
 
bananasiong is a glorious beacon of lightbananasiong is a glorious beacon of lightbananasiong is a glorious beacon of lightbananasiong is a glorious beacon of light
Default

What does it mean by shnazzy? There is no such word in my English dictionary..
pasanlaksiri, it looked nice, but why don't you scale down your picture? It is 1.3 MP
BTW, is the LCD light always on? Or it can be controlled whether you want to on or off?
__________________
Superman Returns..
http://www.supermanhomepage.com/imag...an-returns.gif

My friend created this account for me.. LOL
http://bananasiong.myminicity.com
oh.. somemore
http://bananasiong.myminicity.com/env
bananasiong is offline   Reply With Quote
Old 22nd May 2007, 03:32 AM   (permalink)
Experienced Member
 
pasanlaksiri is a jewel in the roughpasanlaksiri is a jewel in the rough
Send a message via Yahoo to pasanlaksiri
Default

Quote:
Originally Posted by bananasiong
What does it mean by shnazzy? There is no such word in my English dictionary..
pasanlaksiri, it looked nice, but why don't you scale down your picture? It is 1.3 MP
BTW, is the LCD light always on? Or it can be controlled whether you want to on or off?
shnazzy = coool I think

Hmm LCD back light. U can use little sw for turn it off and on.
pasanlaksiri is offline   Reply With Quote
Old 22nd May 2007, 10:12 AM   (permalink)
Experienced Member
mcs51mc is on a distinguished road
Thumbs down Self made?

pasanlaksiri, did you actually make that clock?
Is code and design made by you?

I can't wait for the answer... ...
mcs51mc is offline   Reply With Quote
Old 22nd May 2007, 12:18 PM   (permalink)
Experienced Member
 
pasanlaksiri is a jewel in the roughpasanlaksiri is a jewel in the rough
Send a message via Yahoo to pasanlaksiri
Default

Quote:
Originally Posted by mcs51mc
pasanlaksiri, did you actually make that clock?
Is code and design made by you?

I can't wait for the answer... ...
Nope that is not my design. Its made by that site owner "Thomas"

Actually im wating for my ordered 20X4 LCD.
pasanlaksiri is offline   Reply With Quote
Old 22nd May 2007, 07:48 PM   (permalink)
Experienced Member
mcs51mc is on a distinguished road
Thumbs up

Quote:
Originally Posted by pasanlaksiri
Nope that is not my design.
Thanks for your honesty
mcs51mc is offline   Reply With Quote
Old 22nd May 2007, 10:36 PM   (permalink)
Experienced Member
 
Blog Entries: 2
gramo is just really nicegramo is just really nicegramo is just really nicegramo is just really nice
Default

Quote:
Originally Posted by mcs51mc
Thanks for your honesty
Don't think he ever claimed the project was his, infact, his unedited first post starts off with

This is the link for schematics and info



__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Problem with LCD code? spondootre Micro Controllers 15 29th April 2008 09:15 AM
PIC16F877 ADC programming with PicBasic Compiler Erwin_Macaraig Micro Controllers 10 4th November 2004 10:46 AM
Help me on basketball's game clock and shot clock! syaw_007 Electronic Projects Design/Ideas/Reviews 1 6th September 2004 09:50 PM
Turn 'off' a relay using alarm clock...(help) bd13 Electronic Projects Design/Ideas/Reviews 3 1st September 2004 12:01 AM
Need A Simple Alarm Clock Circuit Handiplus Electronic Projects Design/Ideas/Reviews 0 29th March 2004 02:01 PM



All times are GMT. The time now is 11:48 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.