Search found 619 matches

by Sobrietytest
10 Nov 2010 11:24
Forum: mikroC PRO for PIC General
Topic: pic18f4520
Replies: 4
Views: 1955

Re: pic18f4520

Very strange Nart, perhaps there is something else in your software/settings that is causing the problem. Incidentally, there is no need to set CMCON = 0x07, this is the default condition of the register after all resets (POR, BOR & MCLR).
by Sobrietytest
10 Nov 2010 11:07
Forum: mikroC PRO for PIC General
Topic: PIC 16F88 PORT PIN READ PROBLEM.
Replies: 6
Views: 2711

Re: PIC 16F88 PORT PIN READ PROBLEM.

Have you tried using the bitwise and operator...

if (PORTA.F1 & PORTA.F2) run_function();

I'm not certain why the and comparison doesn't work but my reasoning is that you are trying to deduce a 1 or 0 mathematically, hence the bitwise operator.
by Sobrietytest
06 Nov 2010 10:39
Forum: mikroC PRO for dsPIC30/33 and PIC24 General
Topic: dspic33fj128gp802 UART at 40MIPS / 80MHz clockspeeds
Replies: 13
Views: 6760

Re: dspic33fj128gp802 UART at 40MIPS / 80MHz clockspeeds

As a side issue, which GPS module are you using? Most of them have adjustable baud rates these days.
by Sobrietytest
02 Nov 2010 12:30
Forum: mikroC PRO for dsPIC30/33 and PIC24 General
Topic: Help with initialization SD CARD
Replies: 16
Views: 5550

Re: Help with initialization SD CARD

A couple of observations; it looks like you're using FAT16 so you should use Mmc_FAT_Init(). Secondly, the logic of while (mmc_init()); is wrong, that call returns zero if the initialisation was successful. Try something like this... //Fire up SPI channel 1 at low speed... Spi1_Init_Advanced(_SPI_MA...
by Sobrietytest
02 Nov 2010 10:01
Forum: mikroC PRO for PIC General
Topic: Problem with Soft_UART_Read
Replies: 5
Views: 1948

Re: Problem with Soft_UART_Read

The main problem with the Soft_Uart functions is that there is no buffering for incoming data, the hardware Uart has a FIFO buffer which means you can read the incoming data in the right order after it has arrived. You can't do this with the Soft_Uart reads; you have to read each character before th...
by Sobrietytest
29 Oct 2010 09:56
Forum: mikroC PRO for PIC General
Topic: Problem with UART1_Read_Text(output, "OK", 10);
Replies: 4
Views: 1911

Re: Problem with UART1_Read_Text(output, "OK", 10);

Have a look at escape sequences in the Help files. To send 'hello' along with a carriage return you would type " hello\r ", where \r is the escape character for 0x0D. It's worth pointing out that there is an unwritten standard for terminating ASCII strings which uses both the carrige return and a li...
by Sobrietytest
28 Oct 2010 09:20
Forum: mikroC PRO for PIC General
Topic: Problem with UART1_Read_Text(output, "OK", 10);
Replies: 4
Views: 1911

Re: Problem with UART1_Read_Text(output, "OK", 10);

How have you declared 'output'? And what is the text that you are sending over the UART comms? It may be that 'output' is not large enough to receive the entire message or that the delimiter character (0x0D) is not being received within the 10 read attempts.
by Sobrietytest
18 Oct 2010 07:41
Forum: mikroC PRO for PIC General
Topic: Arrays and pointers question
Replies: 8
Views: 2461

Re: Arrays and pointers question

Is this a standard way of using arrays or is it MikroC specific?. The ANSI C language uses pointers extensively for all types of variables, not just arrays. MikroC adheres to the ANSI C standard so pointers are available for us to use. However, as I mentioned earlier, care needs to be taken so that...
by Sobrietytest
17 Oct 2010 12:18
Forum: mikroC PRO for PIC General
Topic: Arrays and pointers question
Replies: 8
Views: 2461

Re: Arrays and pointers question

The pointer declaration simply points to a particular memory location where the first byte of 'text' can be found, subsequent memory bytes contain the rest of the array. There is no limitation to the size of the array at this stage, however, in the ME example the array size has been controlled by th...
by Sobrietytest
10 Oct 2010 11:39
Forum: mikroC General
Topic: Problem with Reading data through serial communication
Replies: 3
Views: 1861

Re: Problem with Reading data through serial communication

Try this...

Code: Select all


void interrupt(){
char i = 0;

if (PIR1.RCIF) {
while (Usart_Data_Ready()){      //CHANGE THIS LINE
Rx_buff[i] = Usart_Read();
i++;
}
New_Flag = 1;
}
}

by Sobrietytest
03 Oct 2010 09:42
Forum: mikroC General
Topic: function in mikroc
Replies: 4
Views: 2115

Re: function in mikroc

Hi Velimir, this could happen for many reasons, can you post your code along with PIC details, clock speed, etc?
by Sobrietytest
03 Oct 2010 09:35
Forum: mikroC PRO for PIC General
Topic: Little? Problem with RS232 and PIC18F45K22 on EasyLV-18fv6
Replies: 3
Views: 1568

Re: Little? Problem with RS232 and PIC18F45K22 on EasyLV-18f

I agree with the Doc, you need to prioritise each stage of the program and use some kind of interrupt sequence. At the moment it seems that the UART buffer is receiving data from different parts of the program and spewing it out all together. I would split each part of the program into distinct func...
by Sobrietytest
02 Oct 2010 09:10
Forum: mikroC General
Topic: I2C / EEPROM Problem
Replies: 4
Views: 2415

Re: I2C / EEPROM Problem

Check out the Lo, Hi, Higher and Highest operators, using these you will be able to deconstruct values between 2 and 4 bytes in length and save them as single byte chunks in your EEPROM. Remember to use the bitshift operators (<<) when you reconstruct the values after reading from memory.
by Sobrietytest
26 Sep 2010 09:44
Forum: mikroC General
Topic: How to calculate "G" value from 3 Axis Accelerometer Board ?
Replies: 2
Views: 1655

Re: How to calculate "G" value from 3 Axis Accelerometer Boa

In that zip folder there's an example of how to calibrate and read G. The board's outputs are analogue voltages which are proportional to G in the three planes.
by Sobrietytest
26 Sep 2010 09:14
Forum: mikroC PRO for dsPIC30/33 and PIC24 General
Topic: initialising srm400
Replies: 2
Views: 1392

Re: initialising srm400

do i have to initialise my transducer?
Not according to the datasheet.

one transducer is for sending pulse and one for receiving.
You only need one transducer, the echo appears on the same line as the trigger pulse (see the circuit diagram on the datasheet).

Go to advanced search