DSPRelated.com
Forums

Reading HPIC on dsk6713

Started by mich...@oit.edu February 22, 2011
Hi,

I am trying to read the HPIC register on the 6713 (dsk board). \

Here is what I am doing on the host side:

1. Setting HCNTL1:0 to 00; HRW' to 1 (read); HHWIL to 0 (1st read)

2. HCS' goes low and stays that way for both reads

2. HDS1' Tied High, HDS2' used as strobe

I am reading off an 8 bit port on the host, as only the bottom 4 bits of the HPIC register are relevant.

My scope shows HRDY going High when HDS2' goes high, and HHWIL = 1( for the second read )

Scope values for the HD0:7 pins shows values 0xEF; which is the same value the pins have when unconnected at startup

CCS shows HPIC = 0x00000008.

Does not the HPIC register value get sent to the HD pins?

Also, HRDY' going high after rising edge of HDS2' (strobe) is exactly the opposite of the waveform in Figure 7, case 2 of the HPI user's guide.

Anybody have any suggestions?

Thanks,

Mike J.

_____________________________________
Mike-

> I am trying to read the HPIC register on the 6713 (dsk board). \
>
> Here is what I am doing on the host side:
>
> 1. Setting HCNTL1:0 to 00; HRW' to 1 (read); HHWIL to 0 (1st read)
>
> 2. HCS' goes low and stays that way for both reads
>
> 2. HDS1' Tied High, HDS2' used as strobe
>
> I am reading off an 8 bit port on the host, as only the bottom 4 bits of the HPIC register are relevant.
>
> My scope shows HRDY going High when HDS2' goes high, and HHWIL = 1( for the second read )
>
> Scope values for the HD0:7 pins shows values 0xEF; which is the same value the pins have when unconnected at startup
>
> CCS shows HPIC = 0x00000008.
>
> Does not the HPIC register value get sent to the HD pins?
>
> Also, HRDY' going high after rising edge of HDS2' (strobe) is exactly the opposite of the waveform in Figure 7, case 2
> of the HPI user's guide.
>
> Anybody have any suggestions?

One possible idea. You mention "CCS shows HPIC = 0x00000008"... are you trying to read HPI with CCS connected? There
are no soft/free mode bits for HPI on C6713 like there are for serial ports and timers, so if you have any JTAG
activity then HPI is likely not to work. You might try "free run" (under Debug menu) and see if that helps (which in
turn implies you have a valid program running).

Also, the DSP cannot be in Reset.

-Jeff

_____________________________________
Hi,
>
>I am trying to read the HPIC register on the 6713 (dsk board). \
>
>Here is what I am doing on the host side:
>
>1. Setting HCNTL1:0 to 00; HRW' to 1 (read); HHWIL to 0 (1st read)
>
>2. HCS' goes low and stays that way for both reads
>
>2. HDS1' Tied High, HDS2' used as strobe
>
>I am reading off an 8 bit port on the host, as only the bottom 5 bits of the HPIC register are relevant.
>
>My scope shows HRDY going High when HDS2' goes high, and HHWIL = 1( for the second read )
>
>Scope values for the HD0:7 pins shows values 0xEF; which is the same value the pins have when unconnected at startup
>
>CCS shows HPIC = 0x00000008.
>
>Does not the HPIC register value get sent to the HD pins?
>
>Also, HRDY' going high after rising edge of HDS2' (strobe) is exactly the opposite of the waveform in Figure 7, case 2 of the HPI user's guide.
>
>Anybody have any suggestions?
>
>Thanks,
>
>Mike J.
>
>_____________________________________
>
Jeff,
As you suggested, I removed CCS from the equation.
I flashed a simple audio "talk-through" program onto the DSP, so
it just run stand-alone.

Same problems.

Two things troubling me.
1. You mentioned about a month ago that the drive capability of my uC needed to be around 15-20mA. The HCS12 has a max drive of 10mA.

2. To get the voltages in spec I placed a voltage translation IC's b/w the
HCS12 and the DSP. pt#SN74CBT3384. The datasheet for this part is stating
pretty low current output for a 5V supply, with a 3.3V output Voltage, around 100uA.

Do you think I will need line drivers? Different uC?

Also, I have attached my readHPIC(); function code.
Any more pointers or suggestions would be helpful.

Thanks,
Mike Jones
//-------------------------------
unsigned char readHPIC()
{
//Variable to be Returned only reading bottom 8 LSB's of HPIC
unsigned int a; a = 0;//

//Wait Here Until DSP Ready
while((PTT&HRDY)){}

//Control Signals: HHWIL(3) = 0,HRW'(2)=1,HCNTL(1:0)
PTP = 0xF4; //1 1 1 1 | 0 1 0 0

//Enable HCS': HCS'(7) = 0 HDS2'(6) = 1
PTE = 0x7F; //0 1 1 1 | 1 1 1 1

//Wait Here Until DSP Ready --added
while((PTT&HRDY)){}

//HSTROBE' Low: HCS'(7) HDS2'(6) --Latch Control Signals
PTE ^= HDS2; //0 0 1 1 | 1 1 1 1

//Wait Here Until DSP Ready
while((PTT&HRDY)){}

//Read the data before toggling HDS2'(i.e. DSP's HSTROBE')
a = HD8;

//HSTROBE' High: HCS'(7) HDS2'(6)
PTE ^= HDS2; //0 1 1 1 | 1 1 1 1

//Setup for 2nd Read: HHWIL(3) = 1,HRW'(2) = 1,HCNTL(1:0) = 00
PTP ^= HWIL; //1 1 1 1 | 1 1 0 0

//HSTROBE' Low: HCS'(7) HDS2'(6)
PTE ^= HDS2; //0 0 1 1 | 1 1 1 1

//Wait Here Until DSP Ready
while((PTT&HRDY)){}

//HSTROBE' High: HCS'(7) HDS2'(6) -->8 LSBs' of HPIC Read
PTE ^= HDS2; //0 1 1 1 | 1 1 1 1

return(a);
}
>

_____________________________________
Mike-

>>I am trying to read the HPIC register on the 6713 (dsk board). \
>>
>>Here is what I am doing on the host side:
>>
>>1. Setting HCNTL1:0 to 00; HRW' to 1 (read); HHWIL to 0 (1st read)
>>
>>2. HCS' goes low and stays that way for both reads
>>
>>2. HDS1' Tied High, HDS2' used as strobe
>>
>>I am reading off an 8 bit port on the host, as only the bottom 5 bits of the HPIC register are relevant.
>>
>>My scope shows HRDY going High when HDS2' goes high, and HHWIL = 1( for the second read )
>>
>>Scope values for the HD0:7 pins shows values 0xEF; which is the same value the pins have when unconnected at startup
>>
>>CCS shows HPIC = 0x00000008.
>>
>>Does not the HPIC register value get sent to the HD pins?
>>
>>Also, HRDY' going high after rising edge of HDS2' (strobe) is exactly the opposite of the waveform in Figure 7, case
>> 2 of the HPI user's guide.
>>
>>Anybody have any suggestions?
>>
>>Thanks,
>>
>>Mike J.
>>
>>_____________________________________
>>
> Jeff,
> As you suggested, I removed CCS from the equation.
> I flashed a simple audio "talk-through" program onto the DSP, so
> it just run stand-alone.
>
> Same problems.
>
> Two things troubling me.
> 1. You mentioned about a month ago that the drive capability
> of my uC needed to be around 15-20mA. The HCS12 has a max
> drive of 10mA.

10 mA should be Ok for a very short cable. Have you made dig scope rise/fall time measurements? If you're within
TI's specs for these you're fine (look in the HPI timing section of the C6713 data sheet).

> 2. To get the voltages in spec I placed a voltage translation IC's b/w the
> HCS12 and the DSP. pt#SN74CBT3384. The datasheet for this part is stating
> pretty low current output for a 5V supply, with a 3.3V output Voltage, around 100uA.
>
> Do you think I will need line drivers? Different uC?

It shouldn't... but again, what's on the dig scope? Can you post a scope capture showing:

/HDS2
HR/W
HRDY
HCNTL0
HCNTL1

during an HPIC read cycle? HHWIL won't matter for HPIC reads, as its upper 16 bits are a duplicate of its lower 16
(to allow for correct reads regardless of initial endian setting). This assumes you're holding /HCS low (see next
comment).

> Also, I have attached my readHPIC(); function code.
> Any more pointers or suggestions would be helpful.

I see in your code below that you check HRDY before you enable /HCS. As I mentioned before, this is invalid. For
now, just set /HCS and leave it.

-Jeff
> //-------------------------------
> unsigned char readHPIC()
> {
> //Variable to be Returned only reading bottom 8 LSB's of HPIC
> unsigned int a; a = 0;//
>
> //Wait Here Until DSP Ready
> while((PTT&HRDY)){}
>
> //Control Signals: HHWIL(3) = 0,HRW'(2)=1,HCNTL(1:0)
> PTP = 0xF4; //1 1 1 1 | 0 1 0 0
>
> //Enable HCS': HCS'(7) = 0 HDS2'(6) = 1
> PTE = 0x7F; //0 1 1 1 | 1 1 1 1
>
> //Wait Here Until DSP Ready --added
> while((PTT&HRDY)){}
>
> //HSTROBE' Low: HCS'(7) HDS2'(6) --Latch Control Signals
> PTE ^= HDS2; //0 0 1 1 | 1 1 1 1
>
> //Wait Here Until DSP Ready
> while((PTT&HRDY)){}
>
> //Read the data before toggling HDS2'(i.e. DSP's HSTROBE')
> a = HD8;
>
> //HSTROBE' High: HCS'(7) HDS2'(6)
> PTE ^= HDS2; //0 1 1 1 | 1 1 1 1
>
> //Setup for 2nd Read: HHWIL(3) = 1,HRW'(2) = 1,HCNTL(1:0) = 00
> PTP ^= HWIL; //1 1 1 1 | 1 1 0 0
>
> //HSTROBE' Low: HCS'(7) HDS2'(6)
> PTE ^= HDS2; //0 0 1 1 | 1 1 1 1
>
> //Wait Here Until DSP Ready
> while((PTT&HRDY)){}
>
> //HSTROBE' High: HCS'(7) HDS2'(6) -->8 LSBs' of HPIC Read
> PTE ^= HDS2; //0 1 1 1 | 1 1 1 1
>
> return(a);
> }

_____________________________________
Mike-

> I thought I was abandoned forever. . ha ha.
>
> I will get those scope measurements to you in about 2 weeks.
> I am deep in final exams right now.
>
> An additional issue is this. The first time I tried reading HPIC, I didn't have any
> voltage translation going (silly on my part) . So the HPI was hooked directly to 5V.
> It was hooked up for quite some time. (~30min.). So now I am questioning the chip.
>
> Reading previous posts, I saw that this was an issue for someone, and the only
> resolution was for them to order a new dsk.
>
> So. . . I have done the same; as a sanity check. It arrives this week. After finals, and a little break, I will be
> back at it.

That's a good idea. Probably DSK #1 is fine, but you can verify it later. 30 min shouldn't have killed the HPI pins.

-Jeff

> I did change my code so it does not check HRDY
> before setting HCS. The datasheet states
> that HRDY never goes high on an HPIC access, so
> I thought it was a silly thing for me to be doing..
>
> However, HCS does stay low the whole time during the program.
>
> Again, thanks for replying, and for the help.
> Mike Jones
> ________________________________________
> From: Jeff Brower [j...@signalogic.com]
> Sent: Tuesday, March 15, 2011 12:19 PM
> To: c...
> Cc: Michael Jones
> Subject: Re: [c6x] Re: Reading HPIC on dsk6713
>
> Mike-
>
>>>I am trying to read the HPIC register on the 6713 (dsk board). \
>>>
>>>Here is what I am doing on the host side:
>>>
>>>1. Setting HCNTL1:0 to 00; HRW' to 1 (read); HHWIL to 0 (1st read)
>>>
>>>2. HCS' goes low and stays that way for both reads
>>>
>>>2. HDS1' Tied High, HDS2' used as strobe
>>>
>>>I am reading off an 8 bit port on the host, as only the bottom 5 bits of the HPIC register are relevant.
>>>
>>>My scope shows HRDY going High when HDS2' goes high, and HHWIL = 1( for the second read )
>>>
>>>Scope values for the HD0:7 pins shows values 0xEF; which is the same value the pins have when unconnected at startup
>>>
>>>CCS shows HPIC = 0x00000008.
>>>
>>>Does not the HPIC register value get sent to the HD pins?
>>>
>>>Also, HRDY' going high after rising edge of HDS2' (strobe) is exactly the opposite of the waveform in Figure 7, case
>>> 2 of the HPI user's guide.
>>>
>>>Anybody have any suggestions?
>>>
>>>Thanks,
>>>
>>>Mike J.
>>>
>>>_____________________________________
>>>
>> Jeff,
>> As you suggested, I removed CCS from the equation.
>> I flashed a simple audio "talk-through" program onto the DSP, so
>> it just run stand-alone.
>>
>> Same problems.
>>
>> Two things troubling me.
>> 1. You mentioned about a month ago that the drive capability
>> of my uC needed to be around 15-20mA. The HCS12 has a max
>> drive of 10mA.
>
> 10 mA should be Ok for a very short cable. Have you made dig scope rise/fall time measurements? If you're within
> TI's specs for these you're fine (look in the HPI timing section of the C6713 data sheet).
>
>> 2. To get the voltages in spec I placed a voltage translation IC's b/w the
>> HCS12 and the DSP. pt#SN74CBT3384. The datasheet for this part is stating
>> pretty low current output for a 5V supply, with a 3.3V output Voltage, around 100uA.
>>
>> Do you think I will need line drivers? Different uC?
>
> It shouldn't... but again, what's on the dig scope? Can you post a scope capture showing:
>
> /HDS2
> HR/W
> HRDY
> HCNTL0
> HCNTL1
>
> during an HPIC read cycle? HHWIL won't matter for HPIC reads, as its upper 16 bits are a duplicate of its lower 16
> (to allow for correct reads regardless of initial endian setting). This assumes you're holding /HCS low (see next
> comment).
>
>> Also, I have attached my readHPIC(); function code.
>> Any more pointers or suggestions would be helpful.
>
> I see in your code below that you check HRDY before you enable /HCS. As I mentioned before, this is invalid. For
> now, just set /HCS and leave it.
>
> -Jeff
>> //-------------------------------
>> unsigned char readHPIC()
>> {
>> //Variable to be Returned only reading bottom 8 LSB's of HPIC
>> unsigned int a; a = 0;//
>>
>> //Wait Here Until DSP Ready
>> while((PTT&HRDY)){}
>>
>> //Control Signals: HHWIL(3) = 0,HRW'(2)=1,HCNTL(1:0)
>> PTP = 0xF4; //1 1 1 1 | 0 1 0 0
>>
>> //Enable HCS': HCS'(7) = 0 HDS2'(6) = 1
>> PTE = 0x7F; //0 1 1 1 | 1 1 1 1
>>
>> //Wait Here Until DSP Ready --added
>> while((PTT&HRDY)){}
>>
>> //HSTROBE' Low: HCS'(7) HDS2'(6) --Latch Control Signals
>> PTE ^= HDS2; //0 0 1 1 | 1 1 1 1
>>
>> //Wait Here Until DSP Ready
>> while((PTT&HRDY)){}
>>
>> //Read the data before toggling HDS2'(i.e. DSP's HSTROBE')
>> a = HD8;
>>
>> //HSTROBE' High: HCS'(7) HDS2'(6)
>> PTE ^= HDS2; //0 1 1 1 | 1 1 1 1
>>
>> //Setup for 2nd Read: HHWIL(3) = 1,HRW'(2) = 1,HCNTL(1:0) = 00
>> PTP ^= HWIL; //1 1 1 1 | 1 1 0 0
>>
>> //HSTROBE' Low: HCS'(7) HDS2'(6)
>> PTE ^= HDS2; //0 0 1 1 | 1 1 1 1
>>
>> //Wait Here Until DSP Ready
>> while((PTT&HRDY)){}
>>
>> //HSTROBE' High: HCS'(7) HDS2'(6) -->8 LSBs' of HPIC Read
>> PTE ^= HDS2; //0 1 1 1 | 1 1 1 1
>>
>> return(a);
>> }

_____________________________________