Search found 107 matches

by Liro
20 Aug 2011 23:57
Forum: mikroBasic PRO for PIC General
Topic: UART test on 16F688
Replies: 6
Views: 3006

Re: UART test on 16F688

It seems that I'm facing another problem with the UART and the 16F688. I've a problem with the following line: if (UART1_Data_Ready() = 1) then it seems that I always got a "1", I've tried the example: program UART dim uart_rd as bytemain: UART1_Init(9600) ' Initialize UART module at 9600 bps Delay_...
by Liro
20 Aug 2011 15:51
Forum: mikroBasic PRO for PIC General
Topic: UART test on 16F688
Replies: 6
Views: 3006

Re: UART test on 16F688

OK merci pour ces précisions - thank you - gracias - danke - grazie ...
by Liro
19 Aug 2011 22:20
Forum: mikroBasic PRO for PIC General
Topic: UART test on 16F688
Replies: 6
Views: 3006

Re: UART test on 16F688

Well, the problem came from the internal clock setting. This has solved my problem: OSCCON=OSCCON or 0xF0 'set Internal Oscillator Frequency to 8MHz The question is: In Project > Edit Project I had correctly set the frequency to 8 MHz. Is this not written to the PIC? Thanks for this information
by Liro
19 Aug 2011 17:06
Forum: mikroBasic PRO for PIC General
Topic: UART test on 16F688
Replies: 6
Views: 3006

Re: UART test on 16F688

The start string "Ready" is displayed in the terminal like this:
f†fàx††f€
by Liro
19 Aug 2011 15:18
Forum: mikroBasic PRO for PIC General
Topic: UART test on 16F688
Replies: 6
Views: 3006

UART test on 16F688

I've been facing some troubles with the UART communication on a PIC16F688 (14 pin). Finally I closed my project and tested the simpliest possible code: the UART example. Even there I had strange behavior, when I send 1 I got ~, 3 I got æ etc... I'm using EP4 (and have conected Rx to RC5 and Tx to RC...
by Liro
27 Aug 2010 14:18
Forum: mikroBasic PRO for PIC General
Topic: const byref
Replies: 4
Views: 1873

const byref

Hello All, I had the following working well on previous MB versions: const charc as char[5] =(0x38,0x44,0x44,0x44,0x20) 'c sub procedure display (dim byref the_char as char[5], dim temp as byte) [....] end sub Now the compiler says "Incompatible types ("constant" to "variable by reference") ". Does ...
by Liro
15 Aug 2010 14:46
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

By the way I already test it before and as I wrote earlier, it seems that the freq of the interrupt is not correct...

Can't figure why! :(
by Liro
15 Aug 2010 11:32
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

Hello Man,

Sorry but I'm not sure to understand want you mean.
You want me to test with no prescaler, starting TMRà and then initialize R, G and B?

What's the reason for that?
Thanks
by Liro
13 Aug 2010 12:47
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

Sorry I didn't write it: it's a PIC 16F616 and TMR0 is 8 bits.
by Liro
13 Aug 2010 09:00
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

Thank you barry for your help. I only have TMR0 intterrupt thus I can reload timer on every interrupt. It really seems to be a clock problem cause with that code I have the first (RED) LED blinking every 3s! program Simple_RGB ' Declarations section '------------- Symbols ------------- symbol R_out ...
by Liro
12 Aug 2010 15:59
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

I've OPTION_REG=$06 'Prescaler = 128 TMR0=50 and tested only the following into the interrupt procedure: R_out=R_out xor 1 'toggle first LED which should lead to 1/(256-50)*0,5us*128)~76Hz frequency but... I see the LED blinking (fast but I see it!) :( The clock is set as internal and configured to ...
by Liro
12 Aug 2010 15:42
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

I would prefer knowing what's wrong and learning out of it... It suppose that something is wrong with the interruption, it's like the TMR0 overflow only every half sec or something like that... I tested setRGB(1,0,0,50) and then I see the LED flashing. The freq is so slow that I see this little 1/255!
by Liro
12 Aug 2010 13:10
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

i=i+1 forever??? never will be cleared? try this way (I don't understand well what lights have to do exactly!) while(true) setRGB(0,255,250,0) delay_ms(5000) setRGB(255,100,0,0) delay_ms(5000) i=0 wend end. On every interrupt i = i+1 that's how I get the PWM out of the interruption. Reseting i here...
by Liro
12 Aug 2010 13:08
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

255+1=0, no?

I mean it will roll over.

I've already tested with reseting i with

Code: Select all

if i=255 then
i=0
else
i=i+1
end if
I've the same problem...

Thanks for your input!
by Liro
12 Aug 2010 10:00
Forum: mikroBasic PRO for PIC General
Topic: RGB issue with TMR0
Replies: 18
Views: 5197

Re: RGB issue with TMR0

It's like something goes wrong during the interruption (seting the RED and only red and then stops) and the RED "freeze" for sometime. Here is a video of what happens with only the following code (in the main): setRGB(255,70,0,0) http://www.youtube.com/watch?v=mtpU5wLJ2Yk (the bright LED is covered ...

Go to advanced search