Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Tennsy4.0 Port manipulation

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    3

    Tennsy4.0 Port manipulation

    Hi there,

    I'm wondering how can I perform port manipulation, like using DDRD, PORTx to do faster digital read, use Tennsy4.0? I need to do a digital read of 8 bits of data at a very fast speed. I checked through the pin_arduino.h. It seems like the port definition is something defined at the hardware chip level.

    I don't know if my understanding here is correct. I would be very thankful if u can offer some advice.

    Thanks,
    Leo

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,871
    Yes, you can. See chapter 11 in the reference manual.

    However, the GPIO registers only support 32 bit access. So you must read all 32 bits and then mask off the 24 if you didn't want.

  3. #3
    Junior Member
    Join Date
    Dec 2019
    Posts
    3
    Hi there,

    Thanks for the response! I read through the chapter 11. Im still a bit confuse about how should I directly access to the 32bit DR. Also, based on what I saw in core_pins.h, looks like there are mutiple GPIO DR as shown in my picture attach.Click image for larger version. 

Name:	core_pins Data Register.png 
Views:	18 
Size:	32.1 KB 
ID:	18478

    Could u give me more clues how should I access to that DR? Should I directly read from the memory map? Or I should modify the Tennsy4.0 core files like digital.c

    Sorry for the borthering! Thanks in advance

    Leo

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •