Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : QUESTION TO PORT COMMAND
Author | Message | ||||
rentner111 Newbie Joined: 18/03/2014 Location: AustriaPosts: 19 |
I have found when working with the PORT command, that the order of the port pins when reading and writing is different. Why is that? example: PIN1=D0 PIN2=D1 PIN3=D2 PIN4=D3 When reading: Levels at the PINs: 1-0-0-0 a = PORT(1.4) print a = 1 In writing: a = 1 PORT (1,4) = a Levels at the PINs: 0-0-0-1 With thanks for an answer |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3663 |
Your input uses 1.4 -- is that right? A single floating point number? John |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Erwin, you seem to have found a glaring bug It is so obvious that I am amazed that I never spotted it in testing, even more amazing is that no one else has spotted it since the PORT() function was introduced in V4.1 over two years ago. What is going on here? Are you the first to have used the PORT() function? I am sure that you are right but I am going off to test it - a fix will be in the next version. Geoff P.S. The bug is in the PORT() function, the bits returned are in reverse order. The port command is OK (but separately there is also a bug in the Maximite 4.5 version to be fixed). Geoff Graham - http://geoffg.net |
||||
hitsware Guru Joined: 23/11/2012 Location: United StatesPosts: 535 |
> Are you the first to have used the PORT() function? Not for lack of trying I tried with 4.5. No go. Asked here and was refered to a previous post where the problem was declared a bug. That person had reloaded 4.4 and it worked. I tried 4.4A (perhaps the 'A' was the problem) and a different problem. When I tried to use PORT I'd get (IIRC) a 'pins not declared outputs' even though I had.... edit: oops ... function rather than command |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Yes, as I said, there is a known bug in the Maximite version of the PORT command. For a simple command/function it has a lot of issues Geoff Geoff Graham - http://geoffg.net |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9066 |
I used the PORT command in the PRINTER sub that was developed here a while back with lots of input from others, and I never had a single issue with the command itself, if that is of any help. However, I was writing to the port using OC outputs. As I was never reading the port, this may have been why I never had any issues.... Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5914 |
The only time I have used the PORT function is for the Coffee machine. I do remember thinking at the time that the bit order was different to what I expected but didn't go back and investigate any further - the coffee machine does turn on. It would only be if you are using the PORT command and function that the difference would be obvious. Jim VK7JH MMedit MMBasic Help |
||||
Print this page |