View previous topic :: View next topic |
Author |
Message |
Carlos_Ml
Joined: 07 Aug 2004 Posts: 1 Location: Costa Rica
|
ISD4002 |
Posted: Sat Aug 07, 2004 12:49 pm |
|
|
Hi all,
I'm having problems using aN ISD4002 Chipcorder with a 16F877. The Spi_write command doesn't seem to do anything. I'm using version 3.
Any codes to help out would be aprpreciated. Thanks
Carlos |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Aug 08, 2004 12:30 pm |
|
|
If you have the CCS compiler, look at the ISD4003.C file in this folder:
c:\Program Files\Picc\Drivers
It's a similar chip to the ISD4002. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Mon Aug 09, 2004 8:16 am |
|
|
Thanks man. My problem thus far is that the SPI_WRITE command doesn't seem to work. The SCLK and MOSI pin never change.
Any ideas? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Aug 09, 2004 1:30 pm |
|
|
Quote: | My problem thus far is that the SPI_WRITE command doesn't seem to work. |
The CCS driver file, isd4003.c, uses software SPI so that means you're
not using the CCS driver.
OK. So the next thing you should do is write a test program to
prove that the CCS spi_write() function works. See the demo
program below. This program will put out groups of 8 positive-going
pulses on the SCK pin of the PIC, with 100 usec between the groups.
On the SDO pin, you will see 4 negative-going pulses. (This is the
data byte, 0x55). Run this program on your demo board and see
if you can get these pulses. (Modify the #include and the #fuses
statements as needed, to make it work with your demo board).
Code: | #include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud = 9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
void main()
{
printf("Start\n\r");
setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_16);
while(1)
{
spi_write(0x55);
delay_us(100);
}
} |
|
|
![](templates/subSilver/images/spacer.gif) |
|