Author |
Message |
Topic: Software SPI not work ! |
aka211
Replies: 7
Views: 8709
|
Forum: General CCS C Discussion Posted: Tue Jun 29, 2010 2:19 am Subject: Software SPI not work ! |
But what about your code that has all these 0xEA values in it ?
output_low(RN_SELECT);
SPI_XFER(SPI, 0xEA); // write enable register
SPI_XFER(SPI, 0xE5); // write enable command
SPI_XFER(SPI ... |
Topic: Software SPI not work ! |
aka211
Replies: 7
Views: 8709
|
Forum: General CCS C Discussion Posted: Tue Jun 29, 2010 1:11 am Subject: Software SPI not work ! |
That because I want to write a data to 0x07h register and then read it out.
Commands begin with 0xEA is to make a register able to be written.
The line:
SPI_XFER(SPI, 0x87); // 8-bit regist ... |
Topic: Software SPI not work ! |
aka211
Replies: 7
Views: 8709
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 10:20 pm Subject: Software SPI not work ! |
command that begins with 0xAE is used to enable write and to close write, because registers are write-protected.
read commands just begin with 0xxxxxxx (xxxxxxx is 7-bit address) |
Topic: Software SPI not work ! |
aka211
Replies: 7
Views: 8709
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 7:52 pm Subject: Software SPI not work ! |
What is your CCS compiler version ?
CCS_PCWH_4.093
I watched on oscillocope and found that the SDO pin of the slave was always high.(0xff) |
Topic: Software SPI not work ! |
aka211
Replies: 7
Views: 8709
|
Forum: General CCS C Discussion Posted: Mon Jun 28, 2010 2:28 am Subject: Software SPI not work ! |
I use PIC 16f946 to communicate with a slave through SPI.( software ) like this
http://www.fileupyours.com/files/286927/SPI.jpg
This slave device have SPI diagram like this :
#include <16 ... |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Sun Jun 20, 2010 8:09 pm Subject: Signal noise when use LCD driver (pic16f946) ! |
It's great PCM, it works well. Thank you very much. |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Sat Jun 19, 2010 10:44 pm Subject: Signal noise when use LCD driver (pic16f946) ! |
Thanks PCM, I'll try. My internet line had problem so i couldn't be online these days. I'll try and tell you the result.
Best wishes, PCM |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Fri Jun 18, 2010 2:04 am Subject: Signal noise when use LCD driver (pic16f946) ! |
I know where the problem is. It the line
setup_lcd(LCD_MUX14|LCD_STOP_ON_SLEEP,2);
I dont config the segments used for LCD ( the full syntax: setup_lcd (mode, prescale,
#define SEG0_4 1
#define ... |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Fri Jun 18, 2010 12:11 am Subject: Signal noise when use LCD driver (pic16f946) ! |
Thanks alot PCM, so how can I config the pins not used for LCD as analog pins?
See u tomorrow,
This is my LCD:
http://www.fileupyours.com/files/286927/LCD.jpg |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Thu Jun 17, 2010 10:14 pm Subject: Signal noise when use LCD driver (pic16f946) ! |
When i #include <7_lcd.c> and setup_lcd(LCD_MUX14|LCD_STOP_ON_SLEEP,2);
the program fails.
#include <16F946.h>
#fuses INTRC_IO, NOWDT, NOPROTECT, BROWNOUT, PUT
#use delay(clock=400000 ... |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Thu Jun 17, 2010 9:54 pm Subject: Signal noise when use LCD driver (pic16f946) ! |
I've tried, it works correctlly. When I don't include the "7_lcd.c", it works as i like. I think the problem is the lcd driver. |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Thu Jun 17, 2010 9:35 pm Subject: Signal noise when use LCD driver (pic16f946) ! |
1. Comment out all the LCD code. Does the LED now blink correctly ?
2. Did you buy the LCD board or did you build it by yourself ?
If you bought it, post a link to the webpage for the board. I ... |
Topic: Signal noise when use LCD driver (pic16f946) ! |
aka211
Replies: 12
Views: 19232
|
Forum: General CCS C Discussion Posted: Thu Jun 17, 2010 2:52 am Subject: Signal noise when use LCD driver (pic16f946) ! |
Hi everyone,
I'm using pic16f946 and a 7-segment LCD, I config the LCD as below:
/////////////////////////////////////////////////////////////////////////////////////////
// ... |
Topic: Software SPI help !!! |
aka211
Replies: 18
Views: 20272
|
Forum: General CCS C Discussion Posted: Sun Jun 13, 2010 9:18 pm Subject: Software SPI help !!! |
Thanks alot PCM !
So, if I config the pic16f946 as master use software SPI and a slave eeprom.
The DI pin of the PIC should be connected to SDO pin of the eeprom, right?
http://www.fileupyours.co ... |
Topic: Software SPI help !!! |
aka211
Replies: 18
Views: 20272
|
Forum: General CCS C Discussion Posted: Thu Jun 10, 2010 8:06 pm Subject: Software SPI help !!! |
I want to use software SPI, but I still have something not clear.
In the syntax #use spi(),
I've read that DI=pin " Optional pin for incoming data" so it's the data input pin but that's ... |
|