Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).
|
Rick, I use the timer channel for inputs and outputs to simulate an I2C bus. It works very well for me. Here is some sample code you can look at. Timer Channel B0: Set as output: ( this changes the output polarity as well as configures for an output ) { periphMemWrite(0x0001, &ArchIO.TimerB.Channel0.StatusControlReg); // Set as output and = 0. periphMemWrite(0x0003, &ArchIO.TimerB.Channel0.StatusControlReg); // Set as output and = 1. } Timer channel B1: Set as input: ( you need to select the secondary count source as the input you will read ) { periphMemWrite(0x0080, &ArchIO.TimerB.Channel1.ControlReg); // config for input read TB1 } Read input (recall that you need to have the selected input to read from, otherwise it will default to pin 0) { bool status; status = (periphMemRead(&ArchIO.TimerB.Channel1.StatusControlReg) & 0x0100); } -----Original Message----- From: Richard Kis [mailto:] Sent: Wednesday, October 16, 2002 7:50 AM To: Subject: [motoroladsp] Timer input as general purpose input ? Hi, Please do somebody know if (or how if yes) it is possible to use DSP56807 timer inputs/outputs (TA0..TA3, TB0..TB3, TC0..TC3, TD0..TD3) as a general purpose inputs i.e read a status of this pin? Thanks Richard Yahoo! Groups Sponsor ADVERTISEMENT _____________________________________ /groups.php3 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. |
|
Hi, Please do somebody know if (or how if yes) it is possible to use DSP56807 timer inputs/outputs (TA0..TA3, TB0..TB3, TC0..TC3, TD0..TD3) as a general purpose inputs i.e read a status of this pin? Thanks Richard |
|
|
|
Sure, just
disable the output( bit 0 of SCR), and observe the value at bit 8 of the appropriate SCR
(Status and Control register). I am not using the SDK timer functions, I examine
those pins directly with periph.h functions. The timer does not need to be counting to
observe the input.
Since A0-3
and B0-3 are shared with the decoder0-1 modules, in some processors, you can also get those
inputs with the monitor register of the decoder module(s).
Jerry.
|
|
Richard, please see my message "RE: [motoroladsp] Timer Pins, more I/O" that
was posted to this discussion group on September 25, 2002, at about 6:44am. It has information about how we use the Quad Timer pins as general purpose inputs and outputs. Regards, Art Johnson Senior Systems Analyst PMC Prime Mover Controls Inc. 3600 Gilmore Way Burnaby, B.C., Canada V5G 4R8 Phone: 604 433-4644 FAX: 604 433-5570 Email: http://www.pmc-controls.com -----Original Message----- From: Richard Kis [mailto:] Sent: Wednesday, October 16, 2002 7:50 AM To: Subject: [motoroladsp] Timer input as general purpose input ? Hi, Please do somebody know if (or how if yes) it is possible to use DSP56807 timer inputs/outputs (TA0..TA3, TB0..TB3, TC0..TC3, TD0..TD3) as a general purpose inputs i.e read a status of this pin? Thanks Richard _____________________________________ /groups.php3 |