Search found 116 matches

by Bachman
Tue Feb 07, 2023 11:41 am
Forum: Flowcode V6
Topic: Current LCD 4X20 fluctuation
Replies: 21
Views: 68238

Re: Current LCD 4X20 fluctuation

Show us the PCB and schematic. I think, you got high noise and/or something not connected properly. Can you check the ADC input pin with Oscilloscope?
by Bachman
Thu Jan 12, 2023 11:52 pm
Forum: Flowcode V8
Topic: Migration from PIC16F18345 to PIC16F18444
Replies: 4
Views: 11915

Re: Migration from PIC16F18345 to PIC16F18444

Interrupt errors:

The two PICs have different interrupt table. Delete the interrupt an recreate. PIC changed, contents of interrupt enable, disable and handle code not. Maybe same error with EEPROM.
ScreenShot_594.jpg
ScreenShot_594.jpg (137.94 KiB) Viewed 11866 times
by Bachman
Thu Jan 12, 2023 11:40 pm
Forum: Flowcode V8
Topic: Migration from PIC16F18345 to PIC16F18444
Replies: 4
Views: 11915

Re: Migration from PIC16F18345 to PIC16F18444

The first time I tried to compile, only replacing the PIC module (properly reconfigured) I had this error: I've seen this type of inexplicable errors in earlier versions of Flowcode after same step. I'm not sure what is causing this, maybe some cache problems. Until Benj solve this, try the followi...
by Bachman
Thu Jan 12, 2023 11:26 pm
Forum: Flowcode V8
Topic: UART Communication
Replies: 8
Views: 11143

Re: UART Communication

Looks like, i've mixed up the things... :D Well, the Nextion display needs around 250 - 300 ms after power up to initialize itself. Just an idea, you can use this time. In the display, create a "welcome" screen (logo, picture etc.) as the startup screen (page 0). Initialize the controller, after ini...
by Bachman
Thu Jan 12, 2023 9:13 am
Forum: Flowcode V8
Topic: UART Communication
Replies: 8
Views: 11143

Re: UART Communication

Hi Abhi! Try to add 250-300 ms delay before UART initialization. If you turn on the Nextion display, it's send out some data and it can make overflow condition in the PIC's receive side. Or, right after the UART initialization, try this C code: U1CON2bits.RUNOVF=1; U1 means UART1, modify it, if usin...
by Bachman
Thu Oct 20, 2022 10:29 pm
Forum: Flowcode V6
Topic: Arduino nano, multiple DS18B20 problem
Replies: 16
Views: 21047

Re: Arduino nano, multiple DS18B20 problem

This must be some kind of RS232 problem. My hint is buffer overrun problem. For test, put delays between the print commands. Eg: print temperature 1 delay 250 ms print temperature 2 delay 250 ms print temperature 3 delay 250 ms etc. 250 ms delay must be more than enough, later you can test, what is ...
by Bachman
Sun Oct 09, 2022 2:45 pm
Forum: General Programming
Topic: PIC TO PIC USING BLUETOOTH
Replies: 7
Views: 6816

Re: PIC TO PIC USING BLUETOOTH

Bluetooth is for data transfer, see Wikipedia: https://en.wikipedia.org/wiki/Bluetooth

You can't use it to transfer pure square wave. HC-05 bluetooth module is an UART - Bluetooth module. You can use it to send (and receive) data from a device to another.
by Bachman
Tue Sep 06, 2022 7:54 am
Forum: General Programming
Topic: I2C no longer decoding
Replies: 2
Views: 3399

Re: I2C no longer decoding

Build menu -> Project options: set the CPU clock speed (Hz) to the correct value.

In the CPU configuration menu, change some values:
ScreenShot_336.png
ScreenShot_336.png (17.31 KiB) Viewed 3390 times
by Bachman
Fri Sep 02, 2022 3:45 pm
Forum: Flowcode V8
Topic: HC-12 433 mHz module + Ard + Kerui PIR
Replies: 94
Views: 440420

Re: HC-12 433 mHz module + Ard + Keuri PIR

What modulation is used by K7? Not the last point of view.
by Bachman
Fri Aug 19, 2022 6:13 am
Forum: General Programming
Topic: SFP Module Comms
Replies: 2
Views: 3615

Re: SFP Module Comms

This type of work is suitable for FPGAs, not for microcontrollers. You can buy Ethernet-to-Fiber converters with Gigabit speeds. A simple microcontroller can handle up to 115200 Baud via UART, it's far away from acceptable Ethernet speed. Your linked modules good for long distance UART but not for E...
by Bachman
Sun Jul 31, 2022 8:23 am
Forum: General Programming
Topic: Programme corruption if switched off in sleep mode
Replies: 2
Views: 3904

Re: Programme corruption if switched off in sleep mode

Normally, it's not possible.
by Bachman
Sun Jul 17, 2022 11:49 am
Forum: General Programming
Topic: PIC12F675 display
Replies: 4
Views: 7848

Re: PIC12F675 display

I think, you should choose other PIC. PIC12F675 don't have enough memory regions to handle I2C and displays. Check for PIC12F1840.
by Bachman
Wed Jun 01, 2022 9:56 am
Forum: 8-Bit PIC
Topic: TIMER 2
Replies: 6
Views: 9190

Re: TIMER 2

You can download the application from here (pCloud folder): https://u.pcloud.link/publink/show?code=kZecJyVZlAY1x9LRv5Xq5Jeujg0zDyoi9ySk Please note: the application contain caclulations that are not available for every PIC microcontrollers. Check datasheet of the microcontroller. Eg.: you can use T...
by Bachman
Wed Jun 01, 2022 7:28 am
Forum: 8-Bit PIC
Topic: TIMER 2
Replies: 6
Views: 9190

Re: TIMER 2

Try to use these values (with 8 MHz clock):

Prescaler: 1:64
Postscaler: 1:13
PR2: 59 (40.064 Hz)
PR2: 48 (49.058 Hz)
by Bachman
Wed Apr 20, 2022 11:06 pm
Forum: Flowcode V8
Topic: PIC18F25K42 problems with SPI
Replies: 7
Views: 11275

Re: PIC18F25K42 problems with SPI

C code, SPI example (check datasheet for explanation): Setup SPI module: SPI1CON1 = 0b11000000; SPI1CON2 = 0b00000011; SPI1CLK = 0; SPI1BAUD = 39; SPI1CON0 = 0b10000011; Using SPI module: cs = 0; SPI1TXB = 0; while (!PIR3bits.SPI1RXIF); data_0 = SPI1RXB; SPI1TXB = 0; while (!PIR3bits.SPI1RXIF); data...
by Bachman
Tue Apr 19, 2022 6:23 am
Forum: Flowcode V7
Topic: C icon with asm code
Replies: 8
Views: 12840

Re: C icon with asm code

by Bachman
Mon Apr 18, 2022 8:06 pm
Forum: Flowcode V7
Topic: C icon with asm code
Replies: 8
Views: 12840

Re: C icon with asm code

Because nothing to optimise on a simple instruction and doesn't matter, what you're using, C or ASM.

Code: Select all

_asm
    sleep
_endasm
or

Code: Select all

asm("sleep");
or

Code: Select all

_asm sleep _endasm
by Bachman
Mon Apr 18, 2022 7:02 pm
Forum: Flowcode V7
Topic: C icon with asm code
Replies: 8
Views: 12840

Re: C icon with asm code

Try:

Code: Select all

SLEEP();
or

Code: Select all

Sleep();
by Bachman
Thu Dec 09, 2021 7:16 pm
Forum: Flowcode V8
Topic: SDI/MISO pin in DAC application
Replies: 2
Views: 1814

Re: SDI/MISO pin in DAC application

Hello!

Yes, you can use it but in this case, only for digital input because the MSSP module. The Flowcode input macro using the PORT register. The PORT register reflects the PIN voltage (over the limit (H) or under the limit (L)), regardless of the pin type, input or output.
by Bachman
Sun Oct 17, 2021 6:40 pm
Forum: Flowcode V6
Topic: PIC18F45K22 Clock setup
Replies: 19
Views: 11886

Re: PIC18F45K22 Clock setup

Maybe not too late info. Check the datasheets. The trick is in the SPI waveform modes.
SPI_Modes.png
SPI_Modes.png (116.45 KiB) Viewed 11021 times
by Bachman
Thu Sep 02, 2021 7:06 pm
Forum: General Programming
Topic: HOW PRECISE IS PWM
Replies: 6
Views: 7758

Re: HOW PRECISE IS PWM

Check IC (module) AD9833. With 25 MHz clock, you can get output frequency (for example) 19,999.96602535247802734375 Hz. This close enough to 20 kHz. I think, for home projects, it's more than enough. One step is 0.0931322574615478515625 Hz (25 MHz/2^28). In this chip, one step (bit) is always the sa...
by Bachman
Mon Aug 30, 2021 4:34 pm
Forum: General Programming
Topic: HOW PRECISE IS PWM
Replies: 6
Views: 7758

Re: HOW PRECISE IS PWM

For example, let's see the datasheet of PIC12F1840. The PWM frequency is based on Timer2 settings (prescaler + PR2 values) and Fosc. The frequency is not is linearly related to the PR2 value. For equation, see datasheet. You can't say, one step in PR2 equals n Hertz. PWM_PR2.png PWM_PR2_2.png As you...
by Bachman
Sun Jul 11, 2021 1:42 pm
Forum: User Components
Topic: Component for MCP47X6, MCP44XX,45XX,46XX Family,
Replies: 19
Views: 18666

Re: Component for MCP47X6, MCP44XX,45XX,46XX Family,

I've got only Flovcode v6. If it's ok, I'll share a working example.
by Bachman
Wed Jul 07, 2021 7:34 pm
Forum: User Components
Topic: Component for MCP47X6, MCP44XX,45XX,46XX Family,
Replies: 19
Views: 18666

Re: Component for MCP47X6, MCP44XX,45XX,46XX Family,

Hello Abhi! Easier than you think. Start up SPI and check datasheet. You have to send only two bytes. First byte upper bits is command bits, the others are the data for the DAC. UInt variable (base) BYTE variable (data_h) BYTE variable (data_l) UInt variable (data) base=0b0011000000000000 //upper fo...
by Bachman
Wed Jul 07, 2021 7:08 pm
Forum: General Programming
Topic: Convert to Unix time
Replies: 1
Views: 5972

Re: Convert to Unix time

Get the UNIX time for 2021. jan. 01. ; 0:00:00 from here: https://www.unixtimestamp.com/

Count completed days, completed hours, minutes and seconds. Additions, done.