Search found 428 matches
- Mon May 13, 2019 10:59 am
- Forum: 8-Bit PIC
- Topic: Help with SPI component
- Replies: 16
- Views: 12094
Re: Help with SPI component
Here is the SPI Write macro spi_write.jpg Here is the SPI Read macro spi_read.jpg I should refer that, with the same SPI Read-Write macros I have success in the communication of the P16F18877 with an ATM90E32AS energy monitor IC connected to SPI Channel 1. The Semtech SX1272 is connected to SPI chan...
- Mon May 13, 2019 10:43 am
- Forum: 8-Bit PIC
- Topic: Help with SPI component
- Replies: 16
- Views: 12094
Help with SPI component
Hi everyone. I try to establish SPI communication between a P16F18877 (master) and a Semtech SX1272-LoRa module (slave) without success. I try to read the status registers but the Return byte is always 186d. For example, when I try to read the register 0x42 which contains the Semtech ID revision num...
- Wed May 08, 2019 9:38 am
- Forum: General Programming
- Topic: Not sure if this macro is correct
- Replies: 3
- Views: 3301
Re: Not sure if this macro is correct
Thanks, Leigh. You are right, I was a bit confused from the lot of macros and "GOTOs" within the code. A further question regarding the parameter F in this instruction: 8. RLF RXDATA,F ;Rotate Left RXDATA Does it mean that the destination of the result is again the RXDATA register? Thanks
- Wed May 08, 2019 8:17 am
- Forum: General Programming
- Topic: Not sure if this macro is correct
- Replies: 3
- Views: 3301
Not sure if this macro is correct
Hi everyone I try to convert this ASM macro "GETBYTE_RF" to FC: 1. GETBYTE_RF: 2. CLRF RXDATA ;Clear RXDATA 3. MOVLW .8 ;W = 8d 4. MOVWF TEMP ;Load TEMP 8d 5. RECLOOPDAT 6. BSF RFSCK ;SCK = 1 7. NOP 8. RLF RXDATA,F ;Rotate Left RXDATA 9. BSF RXDATA,0 ;Set bit 0 of RXDATA 10. BTFSS RFSDI ;Test bit SD...
- Sat Apr 06, 2019 8:19 pm
- Forum: General Programming
- Topic: LCD prints erroneously
- Replies: 7
- Views: 4848
Re: LCD prints erroneously
Hi fotios one important thing to remember is : A value in a calculations involving floats e.g 32768 are treated as integers. You need to cast it to a float by adding a real portion i.e always as .0 at the end. So I would do A_FLP = (A_UINT * 32767.0 * 0.001) / 32768.0 Hi Martin Thanks a lot, you sa...
- Sat Apr 06, 2019 8:40 am
- Forum: General Programming
- Topic: LCD prints erroneously
- Replies: 7
- Views: 4848
Re: LCD prints erroneously
I finally solved the problem by removing the division. I make the division with the calculator and then put the result to be multiplied on the formula of Gain calculation. It is not a problem, because is calculated one time and then is stored permanently. However, it remains a problem with the ATM90...
- Fri Apr 05, 2019 8:33 am
- Forum: General Programming
- Topic: LCD prints erroneously
- Replies: 7
- Views: 4848
Re: LCD prints erroneously
Just now I realized that the problem arises from the division by 32768. To explain: Let's suppose: A_FLP = (A_UINT * 32767 * 0.001) / 32768 Which is the same with: A_FLP = (A_UINT * 0.001) * (32767 / 32768) If I place: A_FLP = A_UINT * 0.001 * 0.9999 Then the actual display prints correctly. :? :roll:
- Fri Apr 05, 2019 8:00 am
- Forum: General Programming
- Topic: LCD prints erroneously
- Replies: 7
- Views: 4848
Re: LCD prints erroneously
Hi Fotis, I'd suspect some over flow errors are occurring. Try changing your variables to 32 Bit - 16 bit only allow 0...65535' but in think that the simulation works with 32 bit values. Martin Hi Martin and thanks for the reply. How I could do that? The floating point variable is standard and the ...
- Fri Apr 05, 2019 7:11 am
- Forum: General Programming
- Topic: LCD prints erroneously
- Replies: 7
- Views: 4848
LCD prints erroneously
Hi everyone I have a Uint variable: A_UINT I have a multiplier that gets values from 1000d - 65535d: GAIN I have a floating point variable: A_FLP I have a string type variable: A_STR I use the following calculation: A_FLP = (A_UINT * GAIN * 0.001) / 32768 Then the A_FLP is converted to string for pr...
- Wed Mar 27, 2019 12:55 pm
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
Re: SPI bus Char and String variables?
I think have good news :D I tried with 8-bit variables: Add_H, Add_L, DatIN_H, DatIN_L, DatOUT_H, DatOUT_L I did the same as in Martin's example by transmitting the High - Low bytes separately and in sequence. Now I can see on the LCD the two bytes of the Read-only "LastSPI" Data register of ATM90E3...
- Tue Mar 26, 2019 9:01 pm
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
Re: SPI bus Char and String variables?
Hi everyone I tried Martin's solution without success. However, I couldn't be sure that I did the correct selections. I've just followed the logic of Martin as much as I could understand. The SPI bus format of ATM90E32 is as usual: 1. Register Address = 16-bit wide, of which the MSB (16th) should be...
- Mon Mar 25, 2019 11:27 pm
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
Re: SPI bus Char and String variables?
Hi Fotis, You don't need to use C. For example in my flowchart that communicates via SPI:Typical SPI commands.png Just make sure address variables are assigned of course. :) Hi Martin Glad to hear you after so long :D I'm not sure that understand, but I've read for the tricky dummy byte on the web....
- Mon Mar 25, 2019 11:10 pm
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
- Mon Mar 25, 2019 10:09 pm
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
Re: SPI bus Char and String variables?
Thanks, Leigh
I tried your C code as you suggest but during compiling I receive errors regarding the Uint variables Address, Data, HighByte, LowByte: are not defined
Something is missing and I'm not an expert in C.
I tried your C code as you suggest but during compiling I receive errors regarding the Uint variables Address, Data, HighByte, LowByte: are not defined
Something is missing and I'm not an expert in C.
- Mon Mar 25, 2019 11:09 am
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
Re: SPI bus Char and String variables?
I have another question:
In FC7 SPI Call Component Macro, to receive data I suppose you have to select "GetChar" which returns a variable. Where I could place the register address of which I want to read the data?
Thanks
In FC7 SPI Call Component Macro, to receive data I suppose you have to select "GetChar" which returns a variable. Where I could place the register address of which I want to read the data?
Thanks
- Sun Mar 24, 2019 9:11 pm
- Forum: General Programming
- Topic: SPI bus Char and String variables?
- Replies: 9
- Views: 5670
SPI bus Char and String variables?
Hi everyone. First of all, I try to implement an SPI bus for the first time. I have a project with an 8-bit P16F18877 that retrieves data from a slave ATM90E32 through SPI. The addresses of registers of ATM90 are fixed, 15-bit wide and they follow the 16th bit, which defines the Read = 1 or Write = ...
- Sun Mar 24, 2019 8:30 pm
- Forum: Flowcode V7
- Topic: PIC16F18877 TQFP44 - SPI bus
- Replies: 1
- Views: 2147
PIC16F18877 TQFP44 - SPI bus
Hi everyone I have an application PCB with a TQFP44 PIC16F18877/PT, which offers dual SPI bus. By default, the SPI 1 bus lines are allocated: MOSI - RC4 (pin 42), MISO - RC5 (pin 43), SCLK - RC3 (pin 37). Because in FC7 only the PDIP40 version of PIC16F18877/P is included, the SPI 1 bus is allocated...
- Sun Mar 24, 2019 7:57 pm
- Forum: E-blocks
- Topic: BL0080 + ICSP problem
- Replies: 1
- Views: 5037
BL0080 + ICSP problem
Hi everyone I have an application PCB with target micro the PIC16F18877/PT in TQFP44 package. The PCB includes an ICSP header. From my BL0080 board, I have removed the PDIP40 PIC16F18877/P for making an effort to flash the TQFP44 via its ICSP header. I tried to flash a small FC7 project to the targe...
- Wed Mar 20, 2019 11:59 am
- Forum: E-blocks
- Topic: Ghost to application PCB
- Replies: 3
- Views: 5999
Re: Ghost to application PCB
Hi Ben
Thanks for the reply. Flowkit looks pretty good and inexpensive.
Few questions:
Is it compatible with Flowcode v7?
It could be used, except PIC, with an STM32 ARM micro?
Thanks
Thanks for the reply. Flowkit looks pretty good and inexpensive.
Few questions:
Is it compatible with Flowcode v7?
It could be used, except PIC, with an STM32 ARM micro?
Thanks
- Wed Mar 20, 2019 8:00 am
- Forum: E-blocks
- Topic: Ghost to application PCB
- Replies: 3
- Views: 5999
Ghost to application PCB
Hi everyone I was wondering if Ghost could be used to monitor a targeted micro mounted on an application PCB. Actually, I have this problem with an application that includes an ATM90E32 energy monitor and a P16F18877. To follow the measurements that provide the ATM90E32 to PIC through SPI, I have at...
- Wed Jun 13, 2018 8:28 am
- Forum: E-blocks
- Topic: Re: BL0061+STM32F401 ADC working
- Replies: 0
- Views: 9014
Re: BL0061+STM32F401 ADC working
Hi everyone
I've just checked the ADC and is working flawlessly.
No bug!
A simple test file:
I've just checked the ADC and is working flawlessly.
No bug!
A simple test file:
- Sat Jun 09, 2018 8:40 am
- Forum: E-blocks
- Topic: BL0061+STM32F401 PWM bug
- Replies: 6
- Views: 7825
Re: BL0061+STM32F401 PWM bug
Hello Leigh Yes, the new CAL file is correct and works flawlessly. :D The bug is fixed. A big thank for your effort. By the chance given, the formula to calculate the period of a PWM is: Period = [ Prescaler X ( Period Register + 1 ) ] / [ 4 X Fosc ]. For period expressed in seconds, the Fosc should...
- Fri Jun 08, 2018 8:00 am
- Forum: E-blocks
- Topic: BL0061+STM32F401 PWM bug
- Replies: 6
- Views: 7825
Re: BL0061+STM32F401 PWM bug
Hi Ben
- Tue Jun 05, 2018 9:53 am
- Forum: E-blocks
- Topic: BL0061 USB drivers
- Replies: 29
- Views: 21611
Re: BL0061 USB drivers
Hi Ben
Just to let you know that both CAL and Component new files are working flawlessly.
A big thank again.
Just to let you know that both CAL and Component new files are working flawlessly.
A big thank again.
- Mon Jun 04, 2018 12:02 pm
- Forum: E-blocks
- Topic: BL0061+STM32F401 PWM bug
- Replies: 6
- Views: 7825
Re: BL0061+STM32F401 PWM bug
Hi Ben
Yes, still in FC v7.
Do you think that would be better, for both of us , an upgrade to FC v8?
Thanks a lot
Yes, still in FC v7.
Do you think that would be better, for both of us , an upgrade to FC v8?
Thanks a lot