Search found 69 matches

by qbasic
09 Jul 2022 00:17
Forum: mikroBasic PRO for PIC General
Topic: CMCON = 0 compiling ERROR !!!
Replies: 2
Views: 893

Re: CMCON = 0 compiling ERROR !!!

oooppsss !
Yes, you're right, thanks.
The 16F877 doesnt have the CMCON register,
only the 16F877A has the CMCON.
Many thanks !
by qbasic
08 Jul 2022 22:12
Forum: mikroBasic PRO for PIC General
Topic: CMCON = 0 compiling ERROR !!!
Replies: 2
Views: 893

CMCON = 0 compiling ERROR !!!

Hi all,
I'm programming the PIC16F877.
When compiling, I have the error "Identifier 'CMCON' was not declared" at the following line:

Code: Select all

CMCON = 0
Why ???
Any idea ?
I don't know.
Identifier CMCON was not declared.png
Identifier CMCON was not declared.png (7.25 KiB) Viewed 890 times
I'm using Mikrobasic PRO for PIC, versione 7.6.0

Thanks
by qbasic
22 Mar 2022 18:46
Forum: mikroBasic PRO for PIC General
Topic: How to set the Registers with I2C ?
Replies: 2
Views: 1070

Re: How to set the Registers with I2C ?

Ah, ok, thanks! Then it would be nice to know what values Mikrobasic sets for these registers. For example: SSPCON.SSPEN = 0 ' defult = 0 - Synchronus Serial Port Enable bit SSPCON.CKP = 0 ' defult = 0 - Click Polarity Select bit SSPCON.SSPM3 = 0 ' defult = 0 - Synchronous Serial Port Mode Select bi...
by qbasic
22 Mar 2022 17:32
Forum: mikroBasic PRO for PIC General
Topic: How to set the Registers with I2C ?
Replies: 2
Views: 1070

How to set the Registers with I2C ?

Hi all, I have a little doubt about I2C module initialization on Mikrobasic PRO for PIC (PIC16F887 and RTC DS1307) I know that using the I2C_init (100000) command, I can set the I2C module with 100kHz velocity: but the Registers of I2C ? In other words, the SSPCON, the SSPSTAT and SSPADD registers m...
by qbasic
20 Mar 2022 22:21
Forum: mikroBasic PRO for PIC General
Topic: RTC, I2C and example mikroE
Replies: 6
Views: 1482

Re: RTC, I2C and example mikroE

Sorry I was wrong. The example I took from this mikroe page (not from folder): https://www.mikroe.com/rtc2-proto-board Please, let me know if you think that there are errors so I will update my code. However, I don't undestand the following lines: could you explain me ? I2C1_Wr(0xD0) ' address DS130...
by qbasic
20 Mar 2022 02:00
Forum: mikroBasic PRO for PIC General
Topic: Read and Send values to RTC - Differences of code
Replies: 0
Views: 772

Read and Send values to RTC - Differences of code

Hi all. my ultimate rutines for Read and Write values to 1307. Could be better ? Please, your comment or your evaluation, thanks. ' Write to RTC I2C1_Start() ' issue start signal I2C1_Wr(0xD0) ' address DS1307 I2C1_Wr(0) ' start from word at address 0 I2C1_Wr(0x10) ' write SECONDS to REGISTER 0 I2C1...
by qbasic
20 Mar 2022 00:38
Forum: mikroBasic PRO for PIC General
Topic: RTC, I2C and example mikroE
Replies: 6
Views: 1482

Re: RTC, I2C and example mikroE

Hi Firewire, many thanks. I removed I2C1_Wr(0x80) ' write $80 to REG0 (pause counter + 0 sec) and also I2C1_Start() ' issue start signal I2C1_Wr(0xD0) ' address DS1307 I2C1_Wr(0) ' start from word at address 0 I2C1_Wr(0) ' write 0 to REG0 (enable counting + 0 sec) I2C1_Stop() ' issue stop signal Now...
by qbasic
16 Mar 2022 11:19
Forum: mikroBasic PRO for PIC General
Topic: RTC, I2C and example mikroE
Replies: 6
Views: 1482

Re: RTC 1307 and sample mikroe

Yes, 10k pull-up.
Maybe in the code that I have used there are an error ?
How to send the data to the DS1307: in decimal value or hex value ?
If you see the code, seems that some in hex and some in decimal.
Maybe I'm a bit confused...
Thanks
by qbasic
15 Mar 2022 19:00
Forum: mikroBasic PRO for PIC General
Topic: RTC, I2C and example mikroE
Replies: 6
Views: 1482

RTC, I2C and example mikroE

Hi all. I found a sample code on the mikroe pages website. I am building a small calendar clock with LCD module and DS1307 chip (with micro 16F887). I made some small changes to the original code because I need the 1 Hz on the Output pin of DS1307. But it doesn't seem to work. I don't understand whe...
by qbasic
15 Sep 2020 00:51
Forum: mikroBasic PRO for PIC General
Topic: SetBit, ClearBit and TestBit
Replies: 3
Views: 1293

Re: SetBit, ClearBit and TestBit

So, in a conditional statement is better NOT used the pseudo-routines meneawhile for assignment is indifferent, is right ?
by qbasic
14 Sep 2020 21:55
Forum: mikroBasic PRO for PIC General
Topic: SetBit, ClearBit and TestBit
Replies: 3
Views: 1293

SetBit, ClearBit and TestBit

Hi all.
Just a simply question, please.

In your opinion is better to use

Code: Select all

SetBit(PORTB, 2)
ClearBit(INTCON, RBIF)
if TestBit(INTCON, INTE)...
or simply statement

Code: Select all

PORTB.2 = 1
INTCON.RBIF = 0
if INTCON.INTE = ...
?
Thanks
by qbasic
14 Sep 2020 21:41
Forum: mikroC PRO for PIC General
Topic: Command number about LCD Custom Char Generator
Replies: 2
Views: 932

Re: Command number about LCD Custom Char Generator

Thanks paulfjujo.
The refecence LCD is for 1602 (16 char and 2 lines)
Regards
by qbasic
26 Aug 2020 13:11
Forum: mikroC PRO for PIC General
Topic: Command number about LCD Custom Char Generator
Replies: 2
Views: 932

Command number about LCD Custom Char Generator

Hi all.
I am creating some custom characters with the "Custom Char Generator" tool.
I didn't understand what the line is for:
Lcd_Cmd(80);
What does the "80" command correspond to?
For each new character there is a different number.
What does it mean?
Thank you

Go to advanced search