Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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
What activity does your scope show on U2 pins RST, SDI, SFTCLK and LCHCLK?Here is the schematic of my testing board. The LED on portA.1 blinks as it should and the LED om portA.4 stays on. but no leds on QA - Q-H?
Trying to troubleshoot a clocked logic circuit is like running the Boston marathon in snowshoes.I don't have a scope but following the code in post#345, it has SDO connected to portA.4