Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I feel like, problem is detected. Spi_send and spi_receive is not right I guess. As, the terminal displaying 0b 1111 1111 i.e. FF which is in form of byte not in form of bit reception and than display i.e. 0b 0000 0001 i.e. 01
This is what my terminal display:
do
{
dummy_clock(10)...
Hi,
I got the value display on monitor using :;
void UART_Write_Ascii(char data){
char buf[5];
unsigned char i;
sprintf(buf,"%x",data);
i = 0;
while (buf!='\0')
{ while(!PIR1bits.TXIF);
TXREG = buf[i++];
}
}
But still not getting 0x01 as response. I am getting 0 as response...
Is it the right way to test spi_receive and write?
spi_single_send(0x01); buff = spi_single_receive(); UART_Write_Text("Go");UART_Write_Char(buff);
UART_Write_Text("Starting SD card initialization...\n");
Where buff is unsigned char and spi_single_send and spi_single_receive is same code...
Hello,
Thanks for the response. I am using PIC18F4520.
Here is the SPI Code:
#include <xc.h>
#include "spi.h"
#include "uart.h"
#define SCK RC3 //Serial Clock
#define SDI RC4 //Serial Data In
#define SD0 RC5 //Serial Data Out
#define CS RC2 //Slave Select: Not used in this application...
Okay, Understood. I found one code on internet https://www.microchip.com/forums/m1132376.aspx
Is it the right code to convert ascii to hex?
uint16_t data;
char buff[10];
sprintf(buff, "%x", data);
In CS pin, when I start the controller, it shows pulse for high and then it turn low (I assume...
Hence, you mean, I have to write a code which convert ascii to hex not hex to ascii. Right? I am bit confuse.
In scope, at CS pin, when I start the controller, I got high signal for microsecond and than their is dc signal.
At CLK signal, there is some 10 pulse signal and later it is dc line...
I already shared volt value:
SCK: 0.1V
MOSI: 2.7V
CLK: 0.01 - 0.9V
MISO: 2.7V
I am getting 0V at CS pin. I am unsure abut CLK pin.. I want to understand, why I need to convert hex to ascii? As terminal already displaying ascii value Íõ§´l¤ã ok]W㎜..ýK¨\
1604740481
Ple
Please check post #6
I...
On my terminal, I just saw this:
This means that, code rotate in do-while(buff!=0X01) loop continously and never comes out for a long time, and hence, it didnt move forward. Which also mean that, it didnt respond 0x01 to the controller. What do you think? What am I suppose to do now...
Hi, I want to use SD Card. I am using MPLAB X IDE and XC8 compiler. I am using PIC18F4520 and 16MHz crystal. I am following https://openlabpro.com/guide/raw-sd-readwrite-using-pic-18f4550/ article to initialize the SD Card.
Code:
void dummy_clock(int n){
LATCbits.LATC2 = 1; // set CS high...
Hi, I did nothing. And I just change the terminal. It display text there. But, now I want to display the value of "function called"
For example, if I want to display the value of "buff"
unsigned char buff;
do{
buff = response();
count++;
}while((buff!=0X01) &&...
Hi, I am ussing PIC18F4520 microcontroller. I want to display circuit information using UART RS232. I am using PIC development board which have inbuilt connection to Rx Tx pin of UARt to C6 and C7 pin of controller. I am using HyperTerminal to display the read. XTAL = 16M, baudrate is 9600
When...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.