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.

using a RTC in SF basic

MrDEB

Well-Known Member
I have a DS-1302 RTC module but how to use it?
I recall Jon Chandler made a vu meter clock but what he used for timing?
Am planning on a clock that has no hands, just LEDs but precision would be nice.
 
I need to recheck but the post in 315 is same but without the pushbuttons
 
So, looking at post 315, do you have any connection to hc595 pin 10 RST?

List how the "microcontroller_input" connector pins 1-5 are connected.
What is the schematic for the pcb with the k22 on it?

I don't trust much of anything you've posted after 300+posts on this
 
if your connections are anything like they were a few posts ago, try this:

Code:
Device = 18F43K22
Clock = 8

// int osc and IO pin libraries
Include "intosc.bas"
#option DIGITALIO_INIT = true       // automatically call setalldigital
Include "setdigitalio.bas"
Include "SHIFT.BAS"

Dim LATCH As PORTB.4        // hc595 pin 12 LCHCLK
Dim DATA As PORTA.1         // hc595 pin 14 SDI
Dim CLK As PORTB.3          // hc595 pin 11 SFTCLK
Dim RST As PORTB.1          // hc595 pin 10 RSTn (no connection to pcb)
Dim SDO As PORTA.4          // hc595 pin 9 SDO QH' shift out

Dim Leds As Byte

// set pin modes
Shift.SetClock(CLK)
Shift.SetOutput(DATA)
Shift.SetInput(SDO)
high(RST)
low(LATCH)
 

 // if there was a connection...
low(RST)
delayus(100)
high(RST)


// cycle leds
leds = 0
while (true)
    if (leds = 0) then
        leds = 1
    endif
    Shift.Out(MSB_FIRST, leds, 8)
    LATCH = 1
    LATCH = 0
    delayms(250)
    leds = leds << 1
end while

It corrects a few issues with the code I posted previously
 
I asked about pin 10 a number of pages ago. You could connect it as your schematic shows, or tie it high.

SDO isn't used in the code... it's just there since you showed it connected at one time.
 
I don't have a scope but following the code in post#345, it has SDO connected to portA.4
Trying to troubleshoot a clocked logic circuit is like running the Boston marathon in snowshoes.

U2 Pin is an output and does not ned to be connected to anything unless you're using the signal that will be there. It's OK to connect it to your uC, but that pin must be set as an input so it doesn't fight the U2 pin 9 state.
 
Today I am rechecking ALL my connections and tying the RST pin 10 to HIGH.
Hopefully get this project back on track.
Using the schematic in post#346. but connecting pin 10 of the 74hc595 to Vcc
 
You'll never see this project from MrDEB - he's still struggling to find a clue about using shift registers in another thread. It's not looking good.
 
BIG QUESTION? how does leds rotating around make for a clock? that's what the video is showing in post 356.
While waiting for parts to assemble a shift register board with 10 -74hc595s I decided to maybe redesign my HAWK CLOCK but looking over the thread I am skeptical about how to tell time.
 
Last edited:
THAT video was just a test pattern ... here is another video from 12:59pm to 1:00am. The minutes are on the outer ring with the seconds and use a SINGLE led, while the hours are on the inner ring and use TWO led's with a gap in the middle. This way they can traverse over the 12, 3, 6, and 9 hour ticks and you can still see where they are on the display.

BTW) My clock is still running :)

 

Latest threads

New Articles From Microcontroller Tips

Back
Top