Patch upgrade from v5.0 to 5.1

Support-Forum für Deutschsprachige, die in ihrer Muttersprache schreiben möchten.

Moderator: Benj

Post Reply
DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Patch upgrade from v5.0 to 5.1

Post by DirkB »

Hello Matrixmultimedia Team.

Nach dem Update von v5.0 -> 5.1 sind die Inputs auf dem Panel nicht mehr invertiert.

http://www.matrixmultimedia.com/mmforum ... 47&t=10207

Allerdings ist das Component-Makro für Switches "wait until high (or low)" im Flowchart noch immer invertiert. Das betrifft scheinbar
nur Momentary Switches, bin mir aber nicht sicher. In der Simulation funktioniert alles sehr gut, auf dem Chip funktioniert es nicht mehr.
Ich denke man muss die Funktionen "active low" und "active high" der Switches wirklich auf einer Hardware testen. Im Flowchart sollten
die Componenten Makros die gleiche Polarität haben wie die Switches. In der v4 war die Polarität der Componenten Makros zwar zu den
Entscheidungen (decide) invertiert, aber es hat auf dem Chip funktioniert. Mit der V5 Läuft keines meiner Programme auf den PICs.

Regards

DirkB
Last edited by DirkB on Tue Feb 14, 2012 11:39 am, edited 1 time in total.

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by DirkB »

Ich vergaß, dass Problem mit dem Entprellen (debouncing) der Switches ist noch nicht behoben. Bei einer Entprellung über
1 ms läuft das Programm auf dem Chip extrem langsam. Es sieht aus als wenn die Entprellung mit dem Factor x 10 oder
mehr stattfindet.

DirkB

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by Benj »

Hallo,

Die Entprellzeit Funktionalität wird warten, bis der Schalter-Eingang ist vollständig stabil und dass kein Bounce hat innerhalb der von Ihnen angegebenen Zeit aufgetreten ist. Zum Beispiel, wenn ein Schalter springt für 10ms und Sie haben den Debounce auf 5ms gesetzt dann wird der Ausgang entprellte dauert 15ms dauern. Dies wird sich natürlich noch viel schlimmer für Schalter mit großen Debounce Zeiten.


Hello,

The debounce functionality will wait until the switch input is completely stable and that no bounce has occurred within the time you specified. For example if a switch bounces for 10ms and you have set the debounce to 5ms then the debounced output will take 15ms to complete. This will obviously be much worse for switches with large debounce times.

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by DirkB »

Unter v4 hat das wunderbar funktioniert. Wenn man einen Taster hält, läuft das Programm in v5 ununterbrochen, da das Component Macro invertiert (Bug) ist.
Das Programm läuft dann mit 1 Hz maybe! Wenn man die Debounce Time reduziert auf 1 ms, die switches werden nicht debounced.

- Inputs on Panel OK, Switches, EEProm .........
- Decide ist NO für Switch low active, ok?
- Component Macro ist "wait until low" (?) for Switch low active, Simulation funktioniert, auf PIC keine Funktion
- Component Macro geändert auf "wait until hight", Simulation keine Funktion, kurze Funktion auf PIC, aber viele Fehlfunktionen bis Stillstand
- Debouncing keine Funktion
Hier ein kleines Test Programm. Es funktioniert in der Simulation, aber nicht auf einem PIC.

Regards

DirkB
Attachments
TestV5.zip
(194.05 KiB) Downloaded 329 times
Last edited by DirkB on Thu Feb 23, 2012 8:00 am, edited 2 times in total.

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by DirkB »

Gibt es Neuigkeiten wegen diesem Problem? Ich kann meine Projekte nicht beenden!!!
Es ist wichtig die Programme auf einem PIC zu testen. In der Simulation scheint alles
prima, nur auf der Hardware nicht.

DirkB

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by Benj »

Hallo Dirk,

Sorry für die Verspätung. Ich habe hier einige Tests gemacht und es geschafft, das Problem mit dem Schalter Komponente de-Bounce-Funktionalität zu lösen. Ich habe eine aktualisierte Komponente, die in Ihre "Flowcode v5/Components"-Ordner platziert werden soll befestigt. Lassen Sie mich wissen, wie Sie zu erhalten.


Hello Dirk,

Sorry for the delay. I have done some testing here and managed to resolve the issue with the switch component de-bounce functionality. I have attached an updated component which should be placed into your "Flowcode v5/Components" folder. Let me know how you get on.
FC5_PIC_SWITCH.c
(6.69 KiB) Downloaded 393 times
FC5_PIC_SWITCHbank.c
(7.82 KiB) Downloaded 386 times

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by DirkB »

Hello Ben,

In v4 war für switch low active "wait until low", es hat in der simulation und auf Pic funktioniert.
Nun ist in v5 für switch low active "wait until high". Das ist ok für active low (logic level).
Das Programm arbeitet nun sehr gut auf PIC mit "wait until high". Aber es arbeitet nicht mehr in der Simulation :?
Wenn ich es ändere auf "wait until low", es arbeitet in der simulation korrekt, dann aber nicht mehr auf PIC.
Da gibt es noch eine Kleinigkeit zu korrigieren :) Ich denke dann funktioniert es prima.
Wenn man das Component Makro "Wait until high" durch eine Loop "while SW = 0" ersetzt, gibt es ein Problem mit
debouncing. Die Taster prellen in diesem Fall. Bitte noch ein check der Zeiten für das debouncing.

thanks a lot

Dirk

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by DirkB »

Ich habe noch einen Test gemacht. In der Simulation läuft das Programm korrekt. Auf dem Chip läuft es nicht.
Das debouncing habe ich mit einer sehr langen Zeit, mit 100 ms (only for testing :lol: ) getestet. Ein debouncing
findet nur bei loslassen der switches statt. Es scheint als wenn die polarity des Component Macro "wait until ..." invertiert sind.
Das aber nur im Code, nicht in der Simulation. Das erklärt auch warum das programm nicht läuft auf dem Chip.

Details:

- wait until low (for switch active low) is working in simulation, not on chip
- changing "wait until low" to "wait until high", Program works on chip, not in simulation
- in this case debouncing only when release the switches

seems the Component Macros are inverted in code.

PIC 16F684 wird in v4 und v5 nicht für 8 Mhz sondern nur für 4 Mhz kompiliert, obwohl im Flowcart der Chip auf 8 Mhz eingestellt ist ??!!
Ich verwende einen universal Burner und benötige nur das Hex-File von Flowcode. Das Brennprogramm meldet das es ein Hex-File für einen
PIC 16F84 ist, wenn es eine Hex File von V4 ist. Dieser hat ein max Speed von 4 Mhz. Man kann in Flowcode V4 nicht auf den PIC 16F684 wechseln.
Er wird nicht im Menue ->Ansicht -> Project Option- angeboten. Wenn Led ist ON für 1 Sekunde, sie leuchtet 2 Sekunden.

Ich habe hierzu das gefunden. Wie kann ich das mit Flowcode realisieren?

The 8 MHz oscillator is used as the clock source in the remaining modes, divided by a postscaler to generate frequencies from 125 kHz to 8 MHz. The
default frequency is 4 MHz, for compatibility with other PICs. If you want your code to run faster, you can select 8 MHz, or if you don‟t need so much speed and wish to save power, you can select a lower speed.
The factory calibration value in the 16F6842 is automatically used to set the frequency of the HFINTOSC; unlike the 12F629, there is no need for you code to load a calibration value.
However, if you need to adjust the speed of the HFINTOSC, you can do so by writing a non-zero value to the OSCTUNE register; see the 16F684 data sheet for details.

I think (hope) this will fix the problem.

thanks

DirkB

DirkB
Posts: 116
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by DirkB »

Ich habe es gefunden und es funktioniert!

... at the beginning of your program with "osccon = 0x70;" in it (this will set the internal oscillator to 8MHz). ...

DirkB

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Patch upgrade from v5.0 to 5.1

Post by Benj »

Hello,

Here is another update for the switch component C file. Hopefully this should give the exact same functionality as was present in v4.
Attachments
FC5_PIC_SWITCH.c
(6.99 KiB) Downloaded 359 times

Post Reply