• AVR Freaks

Hot!CAN

Author
verner
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2017/12/12 15:09:59
  • Location: Sweden
  • Status: offline
2019/07/20 23:41:04 (permalink)
0

CAN

I have a new problem and I can't find what I'm doing wrong. This is the receiver board and I use PORTD,6 to keep a 100k resistor to ground. Even though I put PORTD to O/P:s, they are still in high impedance mode, proved by injecting an AC signal (via 10k resistor) to port pin, looking with the oscilloscope AC signal at test point. This hi-z mode cause the rcvr to refuse ack-ing and making a hysterical transfer. By grounding the port via 10k everything works OK, receiving the sequence on LED:s 75,75,75,75,01,0E,30,00,40,10,08 as expected according to transmission and the rcvr software.

Attached Image(s)

#1

3 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24582
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: CAN 2019/07/22 16:43:01 (permalink)
    +1 (1)
    It's a PIC18F4580 for anyone that's wondering...
    Bit 4 of TRISE is "PSPMODE".
    This code is setting it
        MOVLW    b'00111111'    ; Set port data directions at init
        MOVWF    TRISE

    So you are putting PORTD into PSP mode.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    verner
    Starting Member
    • Total Posts : 43
    • Reward points : 0
    • Joined: 2017/12/12 15:09:59
    • Location: Sweden
    • Status: offline
    Re: CAN 2019/07/22 22:12:44 (permalink)
    0
    Thank you very much! I even looked at PSPMODE but didn't connect to TRISE. I hope I learn from this.
    #3
    ric
    Super Member
    • Total Posts : 24582
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: CAN 2019/07/22 22:35:24 (permalink)
    0
    That is an old chip. They used to do this sort of thing to save on registers.
    Newer chips have a much more logical register layout, keeping related bits grouped and not parking bits in strange places like that PSPMODE bit.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5