Search found 23 matches

Return

by kersing
Mon Aug 19, 2013 11:40 pm
Jump to forum
Jump to topic

Re: Loop keeps repeating

I think the watchdog timer could be an issue. If you do not reset the watchdog periodically it will reset the controller. Try setting it to 'off'.
In the Build menu, choose 'Project Options', Push 'Configure chip' and set 'Watchdog timer' to 'Off'.
by medelec35
Tue Aug 20, 2013 12:02 am
Jump to forum
Jump to topic

Re: Loop keeps repeating

Hi Dutch, I was also going to mention Watchdog timer, but kersing beat me to it. That causes a fair amount of issues if left enable and not using clear watch dog commands like kersing has stated. Having Auto clear watch dog enabled will only clear WDT when a delay is reached, or a delay within a com...
by Spanish_dude
Tue Aug 20, 2013 4:15 pm
Jump to forum
Jump to topic

Re: Loop keeps repeating

The watchdog timer is a timer, that when it reaches it's max value (or something like that) it resets the microcontroller. This is used to prevent the microcontroller of getting stuck inside a loop (or something similar). Let's say you have a program with a main loop and you are using the watchdog t...
by medelec35
Sun Aug 25, 2013 4:14 pm
Jump to forum
Jump to topic

Re: Desission question and loop number question

Hi Dutch,
I Have made some same minor modifications to your flowchart so it will only loop for the value of portB (bits 0 to 3)
From that should be able to change the flowchart to suit your needs.

Martin
by kersing
Tue Sep 03, 2013 7:47 pm
Jump to forum
Jump to topic

Re: Programmable pull-up resistors.

It i not an option as far as I know, you will need to use a C icon to turn weak pull up on.

To turn weak pull up on for all pins:

Code: Select all

option_reg = option_reg & 0x7f;
wpub = 0b11111111;


Use wpub = 0b00000001 for B0 only, wpub = 0b00000010 for B1 only etc.
by medelec35
Tue Sep 03, 2013 9:59 pm
Jump to forum
Jump to topic

Re: Programmable pull-up resistors.

Hi Dutch, Another way. If you see in a data sheet to clear bit 7 of option_reg Then you can use clear_bit(option_reg , 7); Or if you know what register and bits are called: E.g looking at page 25 of 722 data sheet and you want a weak pullup only on RB7 you have: WPU1.png Register is outlined in oran...
by kersing
Mon Jun 01, 2015 7:13 pm
Jump to forum
Jump to topic

Re: Trying to get a C code in

This is not C code so embedding it in a C code block will not work. The code only contains chip settings and variable declarations in assembly, no instructions to execute.
by kersing
Fri Sep 04, 2015 10:24 pm
Jump to forum
Jump to topic

Re: showing bus data on a LCD display

Angelo, J1850 VPW is a vehicle data bus, but it is not CAN. The two are different and using the CAN component will not work. The simplest solution to interface to the bus would be to use the ELM322. It can be found for sale at this site which has the data sheet as well. Apparently that chip is a PIC...
by STibor
Tue May 30, 2017 4:44 am
Jump to forum
Jump to topic

Re: WS2812B first project

Hi, WS2811 INIT WS2811 SET LED COLOR starting LED position 0 WS2811 SET LED COLOR 1 WS2811 SET LED COLOR 2 WS2811 SET LED COLOR 3 WS2811 REFRESH I uploaded the program. The microcontroller is not set! The PIC16F88 is slow. Use a faster controller for PIC 8bit> 48MHz. I tested with WS2811 and WS2812B...
by Jay Dee
Tue May 30, 2017 10:33 am
Jump to forum
Jump to topic

Re: WS2812B first project

Hi, Before Ben and the guys wrote the component for these, I played around with NeoPixels which use these LEDs. https://www.matrixtsl.com/mmforums/viewtopic.php?f=54&t=16757&p=78652&hilit=neopixel#p78652 You will need a pretty quick PIC as the timing required for the LED relys on very sh...
by Benj
Tue Jun 20, 2017 10:02 am
Jump to forum
Jump to topic

Re: WS2812B first project

Hello, I suggest you make a macro named SetXLEDs or something similar. The macro parameters could have the colour (R, G, B) channels as well as the start offset (Offset) and number of LEDs to set (numLEDs). Inside the macro we simply have a loop that runs for the number of leds times. e.g. While (nu...
by Benj
Wed Feb 14, 2018 11:37 am
Jump to forum
Jump to topic

Re: remove startup time ATMEGA328

Hello, The serial programming is done using the bootloader loaded on the microcontroller. To remove the bootloader and still be able to program the device you need an AVR ISP programmer, something like this. http://www.matrixtsl.com/webshop/avr-programmer.html Our E-block Arduino board has a socket ...
by jgu1
Sat Sep 08, 2018 7:21 pm
Jump to forum
Jump to topic

Re: fading in and out led

Hi Dutch! I dont know if I understand you correct, I I think you mean when the led has to ligth up, you want it more linear. I made some changes in your program. The led will ligth up fastere in the beginning and slower in the end. Hope you can see the idea in the program. You can add some more desi...
by Benj
Sat Sep 08, 2018 10:52 pm
Jump to forum
Jump to topic

Re: fading in and out led

I'm not sure how well this would work but you could maybe try the Fibonacci sequence. Store the values for the sequence in a look up table component and reference the values with an incrementing or decrementing index variable. I can provide a demo of needed 8) I'm not sure if you would use the value...
by Benj
Mon Sep 10, 2018 9:47 am
Jump to forum
Jump to topic

Re: fading in and out led

Here's a quick example.

Fibonacci_LUT.fcfx


Fibonacci is otherwise known as natural log I believe. We could use the log function instead of the LUT but this adds a lot of processing overhead dealing with the floating point maths.
by LeighM
Mon Nov 04, 2019 9:52 am
Jump to forum
Jump to topic

Re: C-code

Generally, you can add “supplementary” code via the Build->Project Options dialog All C function files would be included here… code.jpg Just the body of your “main” function would then be placed in a C icon in the Flowcode Main(flow) I’ve tried this with your project code, but there are a lot of mis...
by mnf
Wed Nov 06, 2019 6:55 pm
Jump to forum
Jump to topic

Re: C-code

Hi Dutch, I had a little play with this after your previous post.. Can I suggest that you investigate arrays - rather than saving to 8 individual variables. It will make your code much easier to follow (and shorter to enter too - always good) I'd suggest using a property for the pins too - will make...
by mnf
Wed Nov 13, 2019 12:30 pm
Jump to forum
Jump to topic

Re: C-code

- a bit more playing and I converted the C code (above) using Timer1.. - Little conversion was necessary -just added to supplementary code. This generates a steady 202us (probably within the realms of crystal errors on Arduinos?) pulse - and can be used as a starting point for a conversion. timer_te...
by Benj
Wed Nov 13, 2019 11:56 am
Jump to forum
Jump to topic

Re: C-code

Hi Martin, The GetCountMicroSeconds uses floating point maths and hence the problem in terms of stopping on a fixed delay. Normally you would time how long something takes e.g. start the timer wait for something to happen, stop the timer and then collect the time elapsed and this will provide a high...
by mnf
Sun Nov 17, 2019 9:43 pm
Jump to forum
Jump to topic

Re: C-code

- And it works !!! So one Arduino acting as a J1850 sender and one as receiver.... Note that the transmit and receive programs haven't been merged (so use Send_msg from transmit and Receive.... you get the idea.) And because it should always be done so: 'Hello World' (rotating here to keep the scope...
by EtsDriver
Tue Jan 28, 2020 7:56 pm
Jump to forum
Jump to topic

Re: SSD1322 macro crashes FC7 test

Hi Angelo,

I got it too to crash on my system.

--> Take a look at your 3d view, move the ssd1322 away... Under there, is another display (accidentally added?).
--> Remove other one and try again to compile hex. Should now compile without crashing! :)

Best Regards;
Jari
by Benj
Wed Jan 29, 2020 9:11 pm
Jump to forum
Jump to topic

Re: SSD1322 macro crashes FC7 test

I wonder if it's a file permissions or path problem. Can you create a blank project in the same folder and compile that to C?
by Benj
Wed Mar 18, 2020 10:40 am
Jump to forum
Jump to topic

Re: SSD1322 macro crashes FC7 test

Hello, I've now tried on an Arduino for you and am getting the same hanging issue you are getting. Very odd. I'll see if I can work out why. With a pixel width of 128 it is ok but with a width of 255 or 256 the device is not getting stuck but is resetting back to the start. It appears something insi...