Comments (7)
diff --git a/Serial_HelloWorld/Makefile b/Serial_HelloWorld/Makefile
index 920f9e9..f025148 100644
--- a/Serial_HelloWorld/Makefile
+++ b/Serial_HelloWorld/Makefile
@@ -1,5 +1,5 @@
-DEVICE = PFS154
+DEVICE = PFS173
F_CPU = 8000000
TARGET_VDD_MV = 4000
TARGET_VDD = 4.0
diff --git a/SleepWake/Makefile b/SleepWake/Makefile
index 49bf6ee..531d2e6 100644
--- a/SleepWake/Makefile
+++ b/SleepWake/Makefile
@@ -1,6 +1,6 @@
-DEVICE = PFS154
-F_CPU = 70000
+DEVICE = PFS173
+F_CPU = 8000000
TARGET_VDD_MV = 4000
TARGET_VDD = 4.0
@@ -20,7 +20,7 @@ SOURCES = main.c
OBJECTS = $(patsubst %.c,$(BUILD_DIR)/%.rel,$(SOURCES))
# http://sdcc.sourceforge.net/doc/sdccman.pdf
-COMPILE = sdcc -m$(ARCH) -c --std-sdcc11 --opt-code-size -D$(DEVICE) -DF_CPU=$(F_CPU) -DTARGET_VDD_MV=$(TARGET_VDD_MV) -I. -I$(ROOT_DIR)/include
+COMPILE = sdcc -m$(ARCH) -c --std-sdcc11 --opt-code-size --fverbose-asm -D$(DEVICE) -DF_CPU=$(F_CPU) -DTARGET_VDD_MV=$(TARGET_VDD_MV) -I. -I$(ROOT_DIR)/include
LINK = sdcc -m$(ARCH)
EASYPDKPROG = easypdkprog
diff --git a/SleepWake/main.c b/SleepWake/main.c
index a07ddd9..1ae9963 100644
--- a/SleepWake/main.c
+++ b/SleepWake/main.c
@@ -43,7 +43,8 @@ void main(void) {
setup();
// Main processing loop
- while (1) {
+ while (1)
+ {
for (int i = 0; i < 3; i++) {
turnLedOn();
_delay_ms(400);
@@ -51,7 +52,7 @@ void main(void) {
_delay_ms(400);
}
- sleep();
+ //sleep();
}
}
diff --git a/include/delay.h b/include/delay.h
index d189df9..d577a37 100644
--- a/include/delay.h
+++ b/include/delay.h
@@ -59,7 +59,7 @@ __asm
subc __delay_loop_16_PARM_1+1 ; 1 cycle
mov a, __delay_loop_16_PARM_1+0 ; 1 cycle
or a, __delay_loop_16_PARM_1+1 ; 1 cycle
- t1sn f, z ; 1 cycle + 1 cycle for final skip
+ t1sn.io f, z ; 1 cycle + 1 cycle for final skip
goto 00001$ ; 2 cycles
// ret ; 2 cycles
__endasm;
@@ -88,7 +88,7 @@ __asm
or a, __delay_loop_32_PARM_1+1 ; 1 cycle
or a, __delay_loop_32_PARM_1+2 ; 1 cycle
or a, __delay_loop_32_PARM_1+3 ; 1 cycle
- t1sn f, z ; 1 cycle + 1 cycle for final skip
+ t1sn.io f, z ; 1 cycle + 1 cycle for final skip
goto 00001$ ; 2 cycles
// ret ; 2 cycles
__endasm;
diff --git a/include/pdk/util.h b/include/pdk/util.h
index 0838541..7b5563d 100644
--- a/include/pdk/util.h
+++ b/include/pdk/util.h
@@ -29,9 +29,10 @@
//macros so we can use defines in assembler strings
#define _STRINGIFY(x) #x
-#define _STR(x) _STRINGIFY(x)
#define _STR_VAR(x) "_"_STRINGIFY(x)
+#define _STR(x) _STRINGIFY(x)
#define _VAR(x) _ ## x
+#define _ASMS(x) VAR(x)
//definitions for built in opcodes
#define __nop() __asm__("nop\n")
@@ -41,8 +42,8 @@
#define __stopexe() __asm__("stopexe\nnop\n")
#define __reset() __asm__("reset\n")
#define __wdreset() __asm__("wdreset\n")
-#define __set0(var,bit) __asm__("set0 "_STR_VAR(var)", #"_STR(bit)"\n")
-#define __set1(var,bit) __asm__("set1 "_STR_VAR(var)", #"_STR(bit)"\n")
+#define __set0io(x,y) __asm__("set0.io "_STR_VAR(x)", #"_STR(y)"\n")
+#define __set1io(x,y) __asm__("set1.io "_STR_VAR(x)", #"_STR(y)"\n")
// BIT definitions
#define BIT0 (1)
diff --git a/include/serial.h b/include/serial.h
index 913d32f..16b7eeb 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -23,9 +23,9 @@ void serial_setup() {
void serial_irq_handler() {
if (txdata) { // Does txdata contains bits to send?
if (txdata & 0x01) // Check bit (1/0) for sending
- __set1(PA, SERIAL_TX_PIN); // Send 1 on TX Pin
+ __set1io(PA, 7); // Send 1 on TX Pin
else
- __set0(PA, SERIAL_TX_PIN); // Send 0 on TX Pin
+ __set0io(PA, SERIAL_TX_PIN); // Send 0 on TX Pin
txdata >>= 1; // Shift txdata
}
}
from free-pdk-examples.
done.
from free-pdk-examples.
yes i had similar issue
for me i had to
__asm
set1.io __pa, # SERIAL_TX_PIN
__endasm;
instead of
//__set1(PA, SERIAL_TX_PIN); // Send 1 on TX Pin
from free-pdk-examples.
i found the actual place that needs to be modified is util.h
#define __set0(var,bit) __asm__("set0 "_STR_VAR(var)", #"_STR(bit)"\n")
#define __set1(var,bit) __asm__("set1 "_STR_VAR(var)", #"_STR(bit)"\n")
#define __set0(var,bit) __asm__("set0.io "_STR_VAR(var)", #"_STR(bit)"\n")
#define __set1(var,bit) __asm__("set1.io "_STR_VAR(var)", #"_STR(bit)"\n")
from free-pdk-examples.
Thank you for looking into this!
Strangely enough, I also had issues where no error occured, but this example still would not work.
Does Serial_HelloWorld work for you in SDCC4.4.0 after implementing these changes?
from free-pdk-examples.
Nice, thank you! Would you be willing to provide your diff as a pull request?
from free-pdk-examples.
Can you check if this issue is fixed for you now?
from free-pdk-examples.
Related Issues (10)
- Still missing LICENSE HOT 7
- Remove the notes about using development version of Easy PDK Programmer HOT 1
- Finalize serial.h and Serial examples
- Add additional examples
- include structure HOT 1
- About PFS173 reset pin HOT 1
- SDCC function _sdcc_external_startup will be changing to __sdcc_external_startup HOT 4
- Finish ReadAnalog examples possible? HOT 1
- Serial Hello World does not work on PFC161 due to PA7 code option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from free-pdk-examples.