And another question for Bean..reference PROPBASIC
denno
Posts: 223
Bean...below is some code that I use to send stuff to the "terminal" aka computer screen in the IDE , and not to my LCD. (two different BAUD rates)
The "10" is a NEWLINE and the "13" is a CARRIAGE RETURN. What is the/a control character for "HOME" aka 0,0? Is there a list of control characters, more then you list in 00.01.43?
Thank you...Denno
SEROUT 30, baud2, 13 SEROUT 30, baud2, 10 SEROUT 30, baud2, "TEMP_100 = " valueSTR_1 = STR TEMP_100,3,5 SEROUT 30, baud2, valueSTR_1
The "10" is a NEWLINE and the "13" is a CARRIAGE RETURN. What is the/a control character for "HOME" aka 0,0? Is there a list of control characters, more then you list in 00.01.43?
Thank you...Denno
Comments
The following code is for the basic stamp
Question...how do I do that in PROPBASIC?
I keep getting the error message in PROPBASIC.."To many parameters"...aka...Error 7
Thank you...
The compiler seems to like this:
I'll see if it runs when I finish the whole program...
Thank you...
https://forums.parallax.com/discussion/164268/propbasic-i2c-what-is-the-default-speed#latest
Thank you...
Yes
What do you want to know?
Dave
Not sure if you followed the link regarding the I²C default speed? It wasn't about documentation.
Would you mind sharing you code?
Thank you..
Will have to dig it out but there is nothing clever just straight forward shiftout and shiftin
for shifting out I use-
SHIFTOUT DataIO, Clock, LSBFIRST, reg0 '(SHIFTOUT datapin,clockpin,mode,data)
and for shifting in
SHIFTIN DataIO, Clock, LSBPRE, ioByte '(SHIFTIN datapin,clockpin,mode,data)
works for me.
Show me your code and I can test it.
Dave
What are you defining as the "reg0"....? The following is the code I am trying to get things started....
You will notice that there are 3 different GOSUB's that do the same thing, but I tried it the other way, and it still did not work. Then here is the rest of the code....
I'm sure it's something simple....duh?
My suspicion is that you are trying to use pbasic syntax for propbasic the two are NOT the same.
This is a test program that requires you use the serial port to both program and communicate with the prop.
Set up a terminal program -I use Tera term -
Disable it so you can program the prop
Then re-enable and watch the output.
Study the code and compare the syntax used and use and adapt the bits you need.
Its not exactly the most elegant code but it should give you a start.
dave
With trepidation this UNTESTED code is your code in PropBasic form
The code in previuos post IS tested.
Dave
PLC programmers would learn this a heck of a lot quicker than ladder logic and a fast scan for those guys is 2ms
"Mon/ 1/Jan 20 0 0: 0:80 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0
0"
Any thoughts..
And thank you for your help/time.
When I run the code I sent you I get......
Think its time to post the EXACT code you are using to produce the result you showed.
Then we'll have a handle on what is going on.
Dave
And this is the output on the Parallax Serial Terminal..and I "uncommented" the part to enter the date and time..
Well its a puzzle.
It looks as though you are reading in mostly zero's so I wonder if the pins are mixed up- remember the first pin on the prop is I/O pin 0 not pin 1 (ie prop pin 1 is I/O pin 0) so pins...
pin 13 refers to I/O pin 13 NOT physical pin 13. and so on so on my clock board the CS pin is labelled RST !!!!!
Mine is running off 3.3v with 2.2k resistor on the DAT line, left on after starting with 5v then finding 3.3v worked.
Dave
I have tried running on 5 volt and 3.3 volt. No difference. The only thing I have not done, is use a 2.2K resistor on the data line to the prop. But, that was only for the 5 volt operation of the DS1302. Must be something on my end...even when I "uncomment" the section to set time and date, there is no change...
Just took a look at the flip module- yep all the I/O pins are clearly labelled so that can't be it.
I wonder if when you tried it using 5v that the data line pin got damaged when the clock output a 5v signal?
Might be worth while connecting to 3.3v and try new pins.
Otherwise I'm out of ideas.
Actually the guy having trouble in the SPI thread found his I/O pin had blown- so worth a try.
Dave
Don't have a clue, what I did. But, thank you for your guidance and help. If you don't mind, I will use your program with another project..I'm building my own, programmable home heating thermostat. Yes, I know you can just buy one, but what is the fun in that...really. And I needed a time source. I have always paid attention to the temperature of different things...especially on my boat...etc..
Again, thanks
It happens- after a while you start believing in ghosts!!
Glad its sorted.
Re-inventing the wheel is great fun.. because its your wheel.
Dave
And here...
The thermostat has two functions...One is controlled by the time, if selected, left push buttons control time, and the other function is setting by temperature, right push buttons. If the time function is selected, the heater will come on at selected hour, unless the temperature is already above the set temperature. If the temperature function is selected, then the heater will only come on if the temperature drops below the set temperature.
I'm guessing I don't understand BCD to decimal...
Anyways, I will be designing a PCB for ExpressPCB and use the PROPMINI instead of the FLIP...
Thank you again for your time and knowledge.
Ok. BCD stands for Binary Coded Decimal. It's the way the time is stored in the clock chip. See the data sheet clip-
The time is broken down into two decimal numbers-one representing tens and the other units, the tens is stored as the most significant nibble (4 bits) and the units as the least significant nibble (4 bits) and combined to make a byte. So 32 minutes would be- (You can see that if you take the BCD and display in hexadecimal format you get what looks to be the right number- but that's just an artifact that only works for nibbles 0-9, hexadecimal goes up to F. If you find that confusing ignore it!)
So since we deal in 8 bit binary units there is a need to be able to convert back and for.
Phew!
I leave the other conversion as an exercise for the reader....
Dave