4D Systems + XBee + Propeller Activity Board - Need Some Help
RobertW
Posts: 66
in Propeller 1
Hello,
When the time allows, I have been working on connecting (2) Propeller Activity Boards through (2) XBee modules to blink the LEDs connected to P26 and P26 on both activity boards.
Connected to the 'base' board is a 4D Systems LCD. I created a 'screen' using the 4D Systems Workshop Visi-Genie software. Please see attached pictures in the PDF. I am only using the (2) buttons in the upper left corner of the screen. Ignore the other things shown on the screen, they are not being used.
I wrote a program based on the following idea. Press a button on the LCD display, send a command to the node board, turn on the appropriate LED, have the node board send a command to the base board, turn on the same LED on the base board, wait for the buttons on the LCD to change state.
I wrote a program to turn on/turn off an individual LED and it seems to work properly. When I modified this turn on/turn off both LEDs (depending on the button pressed), the LED connected to P26 works properly, but the LED connected to P27 only turns on/off on the node board. I can not figure out why it is not turning P27 on/off on the base board.
I have attached the code for both the base and node boards. If someone can help me find a solution, I would appreciate. Thank you.
-Rob
When the time allows, I have been working on connecting (2) Propeller Activity Boards through (2) XBee modules to blink the LEDs connected to P26 and P26 on both activity boards.
Connected to the 'base' board is a 4D Systems LCD. I created a 'screen' using the 4D Systems Workshop Visi-Genie software. Please see attached pictures in the PDF. I am only using the (2) buttons in the upper left corner of the screen. Ignore the other things shown on the screen, they are not being used.
I wrote a program based on the following idea. Press a button on the LCD display, send a command to the node board, turn on the appropriate LED, have the node board send a command to the base board, turn on the same LED on the base board, wait for the buttons on the LCD to change state.
I wrote a program to turn on/turn off an individual LED and it seems to work properly. When I modified this turn on/turn off both LEDs (depending on the button pressed), the LED connected to P26 works properly, but the LED connected to P27 only turns on/off on the node board. I can not figure out why it is not turning P27 on/off on the base board.
I have attached the code for both the base and node boards. If someone can help me find a solution, I would appreciate. Thank you.
-Rob
Comments
I don't see any reason why the LED on P27 wouldn't light up but you are dumping a lot of data. It could be the P27 command got flushed.
IMO, you're using the following too often.
I think you'd do well to use one call to "rxflush" before your main loop and then not again. I personally think you'd be fine not to use the "rxflush" at all.
You have a debug port setup but then you don't use it. I think you should use the debug port to monitor the program. Here's one example of how you could do this.
You're sure P27 on the base board is working? It's possible for individual pins to be burned out on the Propeller.
It has been a while since I posted my original "I need help" message, but, as I have found time, I have continued to work on getting the connection between my 4D Systems uLCD-32PTU touch display and my Propeller Activity board to work. Based on Duane's comments, I went back and tried to start with the basics (i.e. get the communication between the LCD and the PAB to work correctly). I used the Parallax Serial Terminal to report a message and I used the LEDs on the PAB as an output to report a button press. This sort of worked, and sort of did not work.
I originally downloaded Mathew Brown's Visi-Genie object from the Object Exchange to use as the basis of the object to communicate with the LCD. After I could not figure out the problem, I went back and re-read the 4D Systems paperwork and re-read Mathew's code to better understand it. 4D Systems seems to have a lot of App Notes that were pretty helpful to me in better understanding how to communicate with the LCD.
My original program was calling the PollReport method in the Visi-Genie object. If I understand the method correctly, if it was not commanded to wait, it would roll right through the method, possibly detecting a button press or possibly not. I believe this depends on the speed through the object and the time it takes for the button to be pressed on the screen. Sometimes it seems like it would report that the button was pressed, other times it would not.
The 4D Systems information says that a button can be configured to report a message when an event had changed, and this is exactly what I wanted to do. I added a method to wait for a reported event. This is a simple repeat loop. The main object looks to the report event method in the Visi-Genie object and waits until a message is received from the LCD. Then, the main object processes the received event based on what button was pressed.
The next step will be connecting the XBees and communicating between 2 activity boards. I now believe this will work better since the Visi-Genie object is detecting the button presses more accurately. Thank you again Duane for your suggestions.
Attached is a quick, and very rough, YouTube showing the setup and sections of my program.
Thanks,
-Rob