Search found 238 matches
- 14 Nov 2008 19:03
- Forum: mikroBasic General
- Topic: C to MBasic porting
- Replies: 1
- Views: 1065
C to MBasic porting
HI Group, I have the following line in C that I need to port in MikroBasic if(phase > 0 && phase <= (dim_level >> 1)) { and so far I have ported it to this : Which isn't working obviously if (phase >0) AND phase <= (dim_level >>1) then can anybody tell me the right synthax ? Or what am I doing wrong...
- 22 Oct 2008 17:57
- Forum: mikroBasic General
- Topic: bitwise not operator
- Replies: 5
- Views: 2315
- 22 Oct 2008 13:09
- Forum: mikroBasic General
- Topic: bitwise not operator
- Replies: 5
- Views: 2315
OK thanks for the input . But none of the examples you gave me seems to work for only one bit. So here is my ridiculously long code that works . Any possible shorter variant ? if Button(PORTB, 0, 1, 1) then oldstate = 255 end if if oldstate and Button(PORTB, 0, 1, 0) then flag1 = not flag1 if flag1>...
- 22 Oct 2008 09:51
- Forum: mikroBasic General
- Topic: bitwise not operator
- Replies: 5
- Views: 2315
bitwise not operator
Hi , I have a relay that I would like to switch on button release. But the problem is my not operator . I have defined the relay with symbol. I simply would like to change state of PORTB.4 or in my case relayA. Allthough it turns it on the first time it never turns it off. What am I doing wrong here...
- 03 Aug 2008 21:40
- Forum: mikroBasic General
- Topic: PIC SDRAM Interface
- Replies: 5
- Views: 4175
- 28 Jul 2008 16:22
- Forum: Development Boards
- Topic: microE cards usability
- Replies: 5
- Views: 2507
- 15 Jul 2008 09:34
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
Ohh I 'm sorry then Janni :D . Of course you're right about the clocking and RBInterrupt ! I 'll get rid off the interrupt routine right away and take the easy way out . Which is: I just read all the buttons and compare them if they changed. :D And not messing with the RB interrupt . Thank you Csaba
- 14 Jul 2008 21:20
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
- 14 Jul 2008 18:55
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
Janni, The clk and sl pins are in the lower nybble of PORTB and therefore not affecting the change on PORTB. Only when dtin PORT RB4 has changed from high to low. And only then the two bytes are being clocked it. Freeing up the processor for other stuff. But during that time the RBIE Interrupt is di...
- 14 Jul 2008 13:43
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
Hi everybody, I have cleaned up my messy code and commented it. I also put something together on my website explaining the use of shift register and rotary encoder and what I was working on. The video explains a lot more than my written words. I tend to write very confusing, when in a hurry . And I ...
- 13 Jul 2008 22:25
- Forum: mikroBasic General
- Topic: Rotary Encoder
- Replies: 2
- Views: 3116
- 13 Jul 2008 18:21
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
Thanks XOR for the link to the document. It seems to work now. Apparently when I save PORTB to a variable j for instance. And write it back before I clear the rbif flag it works. sub procedure interrupt() if testbit(intcon,rbif)= 1 then j=PORTB .... ISR code end if PORTB=j intcon.rbif=0 end sub And ...
- 13 Jul 2008 16:46
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
Here is what I read : bit 0 RBIF: RB Port Change Interrupt Flag bit 1 = At least one of the RB7:RB4 pins changed state (must be cleared in software) 0 = None of the RB7:RB4 pins have changed state Note: A mismatch condition will continue to set this bit. Reading PORTB will end the mismatch condition...
- 13 Jul 2008 16:41
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
I have modified my code to this now. I am using a PIC 18F452@10MHz. I have read that we need to read PORTB in order to clear RBIF in the datasheet of the 18F452 page 75 "mismatch condition...".And then read it again on microchips page in a thread. The RBIF gets set again or something I don't underts...
- 13 Jul 2008 15:37
- Forum: mikroBasic General
- Topic: clearing RBIF flag
- Replies: 19
- Views: 8070
clearing RBIF flag
Ok I searched the internet ,read datasheets and erratas. And kind of understand that there is a 18Fxx RBIF clearing bug. I have a code where I read PORTB into j then clear the INTCON.RBIF and read PORTB again. But still I get one shot of an interrupt and never again. How does anybody else has this p...