View previous topic :: View next topic |
Author |
Message |
hayee
Joined: 05 Sep 2007 Posts: 252
|
I/O ports of PIC24HJ128GP306 |
Posted: Thu Apr 07, 2016 11:42 pm |
|
|
Hi,
I wanna ask one question. I am using PIC24HJ128GP306 microcontroller.
In it only PORT B has complete 16 bits (B0 -> B15) other ports contains partial bits like (PORT C contains C1,C2,C12 -> C15),(PORT G contains G0->G3,G6->G9,G12->G15).
It means only PORT B input & output 16-bit data.
e.g
Can other ports be use for input & output 16-bit data? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Fri Apr 08, 2016 5:54 am |
|
|
You write some bits out one port, and then the others out another. However there is obviously a time penalty.
It's very unusual to want to be doing anything involving 16bit parallel data though. You could (for instance use an external shift register, and drive this from SPI. Given the speed this can be clocked it'll probably be faster than trying to split parts onto internal ports. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Fri Apr 08, 2016 5:54 am |
|
|
I don't use the 24 series PICs but depending on the speed of data , sure ANY PIC can read/write 16 bits.
Simply create a function to read 1 port then the 2nd,saving in two inline mem locations. Use make16() if needed.
The 16 bits don't have to be 2 complete I/O ports either, can easily be split over 2-3-4 ports. Though the more ports the slower the function will be,but PICs are real fast these days!
The specs of the data transfer ( what's connected to the PIC) is important. Anything 'slow', say microseconds is not a problem, now nanosecond transfers could be.
Jay |
|
|
|