Search found 12 matches
- 14 Dec 2009 23:21
- Forum: mikroC General
- Topic: Soft PWM for RGB LEDS
- Replies: 6
- Views: 4888
Hello I tested my code on PIC18F452 and it work perfectly I got fade in and fade out without any jumping in the end of the fade I test the code on PIC12F629 or PIC12F683 and I got a jump in the end of the loop : PWM_FADE_0_TO_1(); ends with '1' but jump to 0 for 1mSec PWM_FADE_1_TO_0(); ends with '0...
- 14 Dec 2009 01:07
- Forum: mikroC General
- Topic: Problem using function in main and in Interrupt
- Replies: 3
- Views: 1662
Thanks for your reply and the corrections The code you wrote is realy working but if I had in my main more functions and not just one function it won't work do{ if(ThirdUART == 1){ // this section can only be true if the // ext int took place Usart_Write(51); // third uart access ThirdUART = 0; // c...
- 13 Dec 2009 21:14
- Forum: mikroC General
- Topic: Problem using function in main and in Interrupt
- Replies: 3
- Views: 1662
Problem using function in main and in Interrupt
Hello I am working with - PIC18F452 I had a problem of Reentrancy I need to use the fucntion Soft_Uart_Write() in 2 place in my code but the compiler give me that error: "Reentrancy not allowed: function [Soft_Uart_Write] called in both main and interrupt threads" My code : #define GIE INTCON.F7 voi...
- 06 Dec 2009 08:26
- Forum: mikroC General
- Topic: Soft PWM for RGB LEDS
- Replies: 6
- Views: 4888
Thanks for your replay I haven't seen those delay functions before, I guess you're not using MikroC? I forgot to put the function void Delay(int num) { while(num > 0) num--; } I used this function because I need to change the argument of the the delay function and the MikroC delay fucntion arguments...
- 05 Dec 2009 21:17
- Forum: mikroC General
- Topic: Soft PWM for RGB LEDS
- Replies: 6
- Views: 4888
Soft PWM for RGB LEDS
Hello I want do fade to RGB LEDS with my MCU - PIC12F683 My problem is that : In the end of the loop - (Duty cycle 0% --> 100%) the line ends with '1' but jump to low state '0' for a 1 mSec and from end of the second loop - (Duty cycle 100% --> 0%) the line ends with '0' but jump to high state '1' f...
- 08 Oct 2009 20:06
- Forum: mikroC General
- Topic: Using multiple Soft_Uart\ Soft_SPI in one program
- Replies: 8
- Views: 2492
Another code example
Hello Is that the way to do it ?? unsigned short data = 0, ro = 5; unsigned short *rec; void main() { // PORTA Soft_Uart_Init(PORTA, 0,1, 2400, 0); do { Soft_Uart_Write(data++); // Send data via UART } while (ro--); // PORTB Soft_Uart_Init(PORTB, 2, 3, 4800, 0); do { Soft_Uart_Write(data++); // Send...
- 08 Oct 2009 19:19
- Forum: mikroC General
- Topic: Using multiple Soft_Uart\ Soft_SPI in one program
- Replies: 8
- Views: 2492
Code example
Hello Thanks for your reply - Nikola & Mince-n-Tatties For example this code : unsigned short i = 0,data = 5; void main() { Soft_Uart_Init(PORTB, 1, 2, 2400, 0); // I Soft_Uart_Init(PORTB, 3, 4, 2400, 0); // II for(i = 0; i < 10; i++) Soft_Uart_Write(data); // Send data via UART ..... // rest of the...
- 07 Oct 2009 19:28
- Forum: mikroC General
- Topic: Using multiple Soft_Uart\ Soft_SPI in one program
- Replies: 8
- Views: 2492
Example og using
Thanks for the answer Mince-n-Tatties
How to call the function ??
How to address the function Soft_Uart_Init_1 to specific pin of the MCU ??
Can you give me an example code ??
Thanks for the help
Mayer
How to call the function ??
How to address the function Soft_Uart_Init_1 to specific pin of the MCU ??
Code: Select all
Soft_Uart_Init_1()
Soft_Spi_Config_1()
Soft_Uart_Init_2()
Soft_Spi_Config_2()
Thanks for the help
Mayer
- 07 Oct 2009 00:50
- Forum: mikroC General
- Topic: Using Adc_Read - sampling rate ??
- Replies: 6
- Views: 3225
Using Adc_Read - sampling rate ??
Hello When I using ADC Library (Adc_Read) funcion How I set the sampling rate of the ADC ? or Should I do it by my self throw the regular registers ?? I f i don't touch the registers what is the defalut sampling rate ? what is the default states of the port that had multiple function on them analog ...
- 06 Oct 2009 22:05
- Forum: mikroC General
- Topic: Using multiple Soft_Uart\ Soft_SPI in one program
- Replies: 8
- Views: 2492
Using multiple Soft_Uart\ Soft_SPI in one program
Hello
Can I use the Software UART Library or Software SPI Library - twice ???
I want for example to use one port of 8 bit as 4 UART or 2 SPI
Can it be done ???
Thanks in advance
Mayer
Can I use the Software UART Library or Software SPI Library - twice ???
I want for example to use one port of 8 bit as 4 UART or 2 SPI
Can it be done ???
Thanks in advance
Mayer
- 30 Sep 2009 15:16
- Forum: mikroC General
- Topic: Interrupt handle question
- Replies: 4
- Views: 2102
Interrupt Code handeling
Hello Thanks for the answer In the example - there is just one interrupt , so it don't help so much If I understand correct - I should check the flag for the interrupt to find out from who was the interrupt Is that code is correct ?? void Interrupt(void) { if(INTCON.INTF == 1) // External Interrupt ...
- 29 Sep 2009 19:32
- Forum: mikroC General
- Topic: Interrupt handle question
- Replies: 4
- Views: 2102
Interrupt handle question
Hello I am working with PIC12F683 I want to handle 2 interrupts : 1- External Interrupt 2- Timer 0 Interrupt void interrupt(void) // External Interrupt { INTCON.F1 = 0; // External Interrupt Flag bit clear } void interrupt(void) // Timer 0 Interrupt { // Some instructions } void main(void) { TRISIO ...