Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 7:13ae8d34cc97
- Parent:
- 6:64a3bea8be86
- Child:
- 8:3af851c7bb8d
diff -r 64a3bea8be86 -r 13ae8d34cc97 main.cpp
--- a/main.cpp Wed Nov 30 21:32:58 2016 +0000
+++ b/main.cpp Wed Jan 04 15:12:43 2017 +0000
@@ -1,48 +1,83 @@
#include "mbed.h"
//********************************************************
//** Nucleo-144 Stm32F746 and Stm32F767 bitbanging ******
-//** Jovan Ivkovic - 2016 ******
+//** Port setting and pattern generation ******
+//** Speed - Benchmark ******
+//** Jovan Ivković - 2016. ******
+//** JovanEps (jovan.eps@gmail.com). ******
//********************************************************
+
DigitalOut myled(LED1);
DigitalOut PD7(PF_13);
-DigitalOut PD5(PE_11); //introduce D5 pin-out
+DigitalOut PD5(PE_11); //introduce D5 pin-out it ping faster :)
DigitalOut PD13(PA_5); //introduce D13 pin-out
Serial pc(USBTX, USBRX);
+Timer timer;
-void pingg(){
- while(1) {
+void Pinging()
+{
+ int vreme = 0;
+ while(1) {
+ // Pattern and port setting speed benchmark
+ timer.start();
+ vreme = timer.read_us();
+ for(int ii=0, ii<99, ii+) {
+ PD5 = 1; // D5 go low 1 go LOW in next 74..75ns
+ PD5 = 1; // D5 go low 2
+ PD5 = 1; // D5 go low 3
+ PD5 = 0; // D5 go inv-high on SN74vhc14 - >1.6..2.4V < 1.75ns
+ PD5 = 1; // D5 go low 5
+ PD5 = 1; // D5 go low 6
+ PD5 = 1; // D5 go low 7
+ PD5 = 1; // D5 go low 8
+ PD5 = 1; // D5 go low 9
+ PD5 = 1; // D5 go low 10
+ }
+ vreme = timer.read_us() - vreme;
+ wait_us(0.2);
+ pc.printf("Circle time... %4.4f \n", ( float ) vreme / 1000 ); //1k sets of PD5
+ pc.printf("\n\n");
+ timer.stop();
+
+ /* // Alternative
+ while(1) {
PD5 = 0; // D5 go low 1
PD5 = 0; // D5 go low 2
PD5 = 0; // D5 go low 3
- PD5 = 1; // D5 go inv-high on 74vhc14 - 1v
+ PD5 = 1; // D5 go inv-low on 74vhc14 - <0.6v..0.9V < 1.6ns
PD5 = 0; // D5 go low 5
PD5 = 0; // D5 go low 6
PD5 = 0; // D5 go low 7
PD5 = 0; // D5 go low 8
PD5 = 0; // D5 go low 9
PD5 = 0; // D5 go low 10
- pc.printf("One Run\n");
- }
+ wait_us(0.3);
+ */
+ //pc.printf("\n");
}
-
-int main() {
+}
+
+int main()
+{
myled = 1; // LED is ON - working
pc.baud(115200);
- //pc.baud(921600);
- pc.printf("Starting\n");
- wait(0.2); // 200 ms
+ //pc.baud(921600); // Max garanted UART/seriall speed
+ pc.printf("Starting...\n");
+ wait(0.2); // 200 ms
+
+ //NVIC_DisableIRQ(XXX); // Disable NVIC interrupt;
+ Pinging(); //Call of Pinging methode
- //NVIC_DisableIRQ(XXX); // Disable NVIC interrupt;
/*
while(1) {
- // PD7 = 1; // D7 go high in 75ns
- //PD13 = 1; // D13 go high has delay of
+ // PD7 = 1; // D7 go high in ~75ns
+ //PD13 = 1; // D13 go high has delay of
// myled = 1;
-
+
PD5 = 0; // D5 go high
//wait(0); // 1ns - exclude, we need as fast as we can get
// PD7 = 0; // D7 go low in next 74ns
- //PD13 = 0; // D13 go high
+ //PD13 = 0; // D13 go high
// PD7 = 1;
//PD13 = 1; // D13 go high
PD5 = 0;
@@ -63,7 +98,7 @@
PD5 = 1; // D5 go inv-high on 74vhc14 - 4v
PD5 = 0; // D5 go low 4v
//wait(0);// 1nsec - exclude, we need as fast as we can get
-
- } */
- pingg();
+
+ }
+ */
}