Shop OBEX P1 Docs P2 Docs Learn Events
HELP Wit 74LV8153N Shitft register , can't get the thing working — Parallax Forums

HELP Wit 74LV8153N Shitft register , can't get the thing working

Igor_RastIgor_Rast Posts: 357
edited 2011-06-30 13:54 in Robotics
hi there , for some time now im playing around with a propeller ,
now im trying to get this 74lv8153 that I already have to work with the prop

im not so good with the prop and can't seem to find any good explination to get it to work
. my pins are conectend like

1- 5v
2-ground
3--ground
4-ground
5-datapin conecte to p.1
6-low
7-ground
8-ground
9
10-ground

11-ground
12-19 led's
20 5v

the program

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

RS = 1 {lcd control}
RW = 2 {lcd control}
E = 3 {lcd control}
DBLow = 4 {lcd control}
DBHigh = 7 {lcd control}


OBJ

SPI : "SPI_Spin"


PUB main |mount,RESET,ClockDelay,ClockState,Celsius

dira[8]:=1

SPI.start(50,8000)



repeat
SPI.SHIFTOUT(17, 18, SPI#MSBFIRST , 10, 0100011011) '' Request Configuration Write
SPI.SHIFTOUT(17, 17, SPI#MSBFIRST , 10, 0100010011) '' configure for ; CPU / Free-run mode
'' release the DS1620

waitcnt(cnt+clkfreq*10/1000) '' Pause for 10ms
!outa[8]
waitcnt(cnt + clkfreq)
PUB HIGH(Pin)
dira[Pin]~~
outa[Pin]~~

PUB LOW(Pin)
dira[Pin]~~
outa[Pin]~


i got a led at p8 just to see if ther's activity


question , i don't know if there is shomething wrong with the code so the prop sends the wrong signal , ORRRRR

the shift register is not wired properly

i wired the adress lines to ground to get 000 . that good right ?

hope to get some rely so I can get this working

igor
IMG00053-20110617-1547.jpg
IMG00054-20110617-1619.jpg
1024 x 768 - 112K
1024 x 768 - 134K

Comments

  • LeonLeon Posts: 7,620
    edited 2011-06-29 14:54
    It appears to have an async serial input, like a UART. You won't get anywhere using SPI with it.
  • Igor_RastIgor_Rast Posts: 357
    edited 2011-06-29 14:57
    ok, I only know it's supose to get the data via 1 line , self syn or somthing,

    01 start bit
    000 adress
    0101 data
    1 stop

    so 0100001011 msb fist

    what do you sugest i use then
  • LeonLeon Posts: 7,620
    edited 2011-06-29 15:05
    UART code.
  • Igor_RastIgor_Rast Posts: 357
    edited 2011-06-29 15:23
    OBJ

    SPI : "FullDuplexserial"


    PUB main

    dira[8]:=1

    SPI.start(31,30,2,9600)

    repeat
    SPI.bin(0100011011,10)
    SPI.bin(0100011011,10)


    waitcnt(cnt+clkfreq*10/1000) '' Pause for 10ms
    !outa[8]
    waitcnt(cnt + clkfreq)

    getting close ????

    is the IC wiring good if you know the ic ?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-06-30 05:49
    Igor, just change your serial mode from 2 to 0 (31,30,0,9600) as you don't need to invert the data.

    A few tips:
    The name of the object is also a bit misleading, it has nothing to do with SPI and although we are not name police we must remember that the whole reason for naming anything is to make it identifiable. Formating the code correctly for posting isn't a bad idea either. Also the device will run up to a maximum of 24000 baud and remember that you don't have to lock it to a standard baud rate either. This may be handy if you do not want to dedicate a cog to full duplex since all you need is some simple Spin code generating a serial bit stream without the need for any input either.
  • Igor_RastIgor_Rast Posts: 357
    edited 2011-06-30 13:54
    thanx for the advice peter , I could made up better names , it was chaning tring ,changing again and trying ,anyway
    thnx

    i got it working with a simpel dira outa code
    :p
    eureka moment
Sign In or Register to comment.