Search found 42 matches
- 04 Sep 2022 23:29
- Forum: mikroC PRO for PIC General
- Topic: SPI and UART Together on PIC18F45K22
- Replies: 2
- Views: 655
Re: SPI and UART Together on PIC18F45K22
Thank you hexreader! Your suggestion fixed it!
- 03 Sep 2022 00:09
- Forum: mikroC PRO for PIC General
- Topic: SPI and UART Together on PIC18F45K22
- Replies: 2
- Views: 655
SPI and UART Together on PIC18F45K22
Hello, I would like to use both SPI and UART on the same chip (PIC18F45K22) I can only get SPI to work if I set the "4 x PLL Enable Bit" to 0 I can only get UART to work if I set the "4 x PLL Enable Bit" to 1 FOSC is set to 32MHz Am I able to get both of them working together? Thanks for any help, Jim
- 30 Aug 2022 22:11
- Forum: mikroC PRO for PIC General
- Topic: StrToInt only works once with UART data
- Replies: 5
- Views: 1100
Re: StrToInt only works once with UART data
After some playing around I have worked out what was wrong - it was the settings I was using in the MikroElektronika USART Terminal
For it to work every time, the "Append New Line" option should be left unchecked, and the new line settings should be set to CR+LF
Thanks,
Jimbo
For it to work every time, the "Append New Line" option should be left unchecked, and the new line settings should be set to CR+LF
Thanks,
Jimbo
- 30 Aug 2022 10:21
- Forum: mikroC PRO for PIC General
- Topic: StrToInt only works once with UART data
- Replies: 5
- Views: 1100
Re: StrToInt only works once with UART data
Hi Thomas,
I tried your suggestion, placing at the end of the loop but I'm afraid it didn't make a difference
Thanks,
Jimbo
I tried your suggestion, placing
Code: Select all
memset(uart_rd, 0, sizeof(uart_rd));
Thanks,
Jimbo
- 30 Aug 2022 00:31
- Forum: mikroC PRO for PIC General
- Topic: StrToInt only works once with UART data
- Replies: 5
- Views: 1100
StrToInt only works once with UART data
Hello, I'm trying to write a program which will receive a value on UART1 which ends with 'OK', converts the value into another, and then writes the result out in hex on UART1. What I have works, but only once. All subsequent data is incorrectly calculated until the program is reset. I believe this i...
- 09 May 2021 12:40
- Forum: mikroC PRO for PIC General
- Topic: PIC16F87 Clock Frequency Confusion
- Replies: 10
- Views: 1886
Re: PIC16F87 Clock Frequency Confusion
Hello, I've worked out what the problem was - my interrupt routine was too busy. It contained too many operations which were messing up the timing. If I reduce my interrupt to just the following, the compare registers work as expected: void interrupt() { // Compare interrupt if (PIR1.CCP1IF) { PORTB...
- 04 May 2021 23:30
- Forum: mikroC PRO for PIC General
- Topic: PIC16F87 Clock Frequency Confusion
- Replies: 10
- Views: 1886
Re: PIC16F87 Clock Frequency Confusion
Thanks, I will take a look at the compare options in more detail. I am not using it to generate my pulses at the moment because I will eventually want to modify/shape the pulse train - ie sometimes miss a pulse My next step is to get a signal on the CLKO pin as this will tell me exactly what clock i...
- 02 May 2021 13:50
- Forum: mikroC PRO for PIC General
- Topic: PIC16F87 Clock Frequency Confusion
- Replies: 10
- Views: 1886
Re: PIC16F87 Clock Frequency Confusion
Hello, I want to output a stream of fourteen 900usec pulses every time input A1 is pressed. I am using the compare feature of the PIC16F87 in conjunction with Timer 1 to do this. I am using the EasyPIC v7 development board. * When RA1 is pressed the compare interrupt is enabled. * Every time the tim...
- 02 May 2021 00:02
- Forum: mikroC PRO for PIC General
- Topic: PIC16F87 Clock Frequency Confusion
- Replies: 10
- Views: 1886
Re: PIC16F87 Clock Frequency Confusion
Hello, Thanks for your reply. I set OSCON to 0x70 but I still need to set CCPR1H = 0x01 and CCPR1L = 0xC2 in order to get an interrupt every 900usec For an 8MHz clock I would expect: FOSC / 4 would be 8MHz / 4 = 2,000,000 1 / 2,000,000 = 0.0000005 seconds per count 0.0000005 * 1800 = 0.0009 So the c...
- 01 May 2021 14:19
- Forum: mikroC PRO for PIC General
- Topic: PIC16F87 Clock Frequency Confusion
- Replies: 10
- Views: 1886
Re: PIC16F87 Clock Frequency Confusion
Hello, Thank you for your reply. Sorry for my slow response. Here are the values of my configuration bits: CONFIG1 : $2007 : 0x2F58 CONFIG2 : $2008 : 0x3FFF I am using internal FOSC (at least I hope I am). My T1CON of 0x01 should select FOSC/4, as according to the PIC16F87 manual, "Timer mode is sel...
- 29 Apr 2021 22:03
- Forum: mikroC PRO for PIC General
- Topic: PIC16F87 Clock Frequency Confusion
- Replies: 10
- Views: 1886
PIC16F87 Clock Frequency Confusion
Hello, I am using a PIC16F87 and would like to call an interrupt every 0.9msec. I have got this working but I am confused about the chip clock frequency. It works if I set the CCPR1 to 450, but this would imply that the clock frequency is 2MHz instead of 8MHz? As FOSC / 4 would be 2MHz / 4 = 500,000...
- 18 Mar 2021 01:05
- Forum: PIC AI compilers
- Topic: mikroSDK 2.0 Project with PIC16F87
- Replies: 1
- Views: 1538
mikroSDK 2.0 Project with PIC16F87
Hello, If I start a new project in Necto Studio 1.5.1, select the mikroSDK 2.0 project template, then the EasyPIC v7 board, then I am only able to select PIC18Fxxxx MCUs. I would like to use a 16 series chip (PIC16F87). It looks like only the Legacy project template has these MCUs available (and lot...
- 17 Mar 2021 00:00
- Forum: IDE
- Topic: Necto Undeclared identifier errors with example projects
- Replies: 7
- Views: 2594
Re: Necto Undeclared identifier errors with example projects
Thanks Filip Installing Necto version 1.5.1 sorted it. For anyone reading this, the complete steps for using a legacy development board (such as an EasyPIC v7), with the MikroC example projects, are: Install version 1.5.1 of Necto, and version 2.9 of mikroProg Suite Select Open project and select th...
- 16 Mar 2021 00:41
- Forum: IDE
- Topic: Necto Undeclared identifier errors with example projects
- Replies: 7
- Views: 2594
Re: Necto Undeclared identifier errors with example projects
Hi Filip, No I have never programmed the EasyPIC v7 from Necto before. I have only used MikroC and I am now trying to migrate to Necto. I have found the following tutorial page, https://help.mikroe.com/topics/mikroprog-for-pic.htm and have installed mikroProg Suite v2.90 as it suggested. However, I ...
- 11 Mar 2021 00:40
- Forum: IDE
- Topic: Necto Undeclared identifier errors with example projects
- Replies: 7
- Views: 2594
Re: Necto Undeclared identifier errors with example projects
Hi Filip, It turned out the solution was to run a build on the code. It appears that the variables are not recognised by the editor until an initial build is made. Once it has been built, all variables are recognised the next time the project is opened. It actually looks like the screenshot in that ...