PropBOE LMM and CMM modes
Rsadeika
Posts: 3,837
I am having a weird problem with my PropBOE when running the program below in CMM mode. I have the R1 LED wired to P7, when I run the code in LMM, it flashes as expected. When I run the program in CMM, the LED turns on and stays on, it does not flash. I ran the code below on my QuickStart, and it worked as expected in both LMM and CMM modes. When I run some code without the threaded cogstart, in CMM, the code works as expected. I also wired an LED on the breadboard, and the same thing occurs, works as expected in LMM mode, and does not work as expected in CMM mode.
I am at a loss on this one, it looks like a software problem, but how would that be occurring? I did not see anything that was weird looking on the board, so I make an assumption that it is not a hardware problem. Anybody experience something like that with their PropBOE? Still scratching head ...
Ray
I am at a loss on this one, it looks like a software problem, but how would that be occurring? I did not see anything that was weird looking on the board, so I make an assumption that it is not a hardware problem. Anybody experience something like that with their PropBOE? Still scratching head ...
Ray
/** * @file RBot1.c * This is the main RBot1 program start point. * * * */ #include <propeller.h> #include <stdio.h> void do_job1(void *arg) { while(1) { high(7); sleep(1); low(7); sleep(1); } } int high(int WCpin) { unsigned int bits = 1 << WCpin; DIRA |= bits; OUTA |= bits; return 0; } int low(int WCpin) { unsigned int mask = 1 << WCpin; DIRA |= mask; OUTA &= ~mask; return 0; } /** * Main program function. */ int main(void) { /* high(7); sleep(2); low(7); */ int stacksize = sizeof(_thread_state_t)+sizeof(int)*3; int *stack = (int*) malloc(stacksize); int cog; cog = cogstart(do_job1, NULL, stack, stacksize); waitcnt(CLKFREQ + CNT); printf("Start of program\n"); while(1) { sleep(1); } return 0; }
Comments
I can't reproduce the problem here using P20 on the quickstart. There have been some updates to propeller-gcc, but I don't think anything has been done that will change the results of this program. I'm going to build a new propeller-gcc package and post it just in case. It will take a few hours to build the Windows version. Will post an update when it's ready.
--Steve
The problem is not with the QuickStart board, it is with the PropBOE board, in CMM mode. That particular program snippet works with all my other boards, when run in CMM mode, it just does not run with the PropBOE board in CMM.
Ray
Propeller-GCC v0_3_5 for Windows is being uploaded if you want to try that - it is the most recent propeller-gcc version 0-3-5 which has all official features. The package should replace the C:\propgcc directory. Don't overwrite your old directory. Rename it if you like.
I am running 0-8-5 on my Windows 8 Pro computer, I can not imagine that the OS would have an effect on something like this. I have to try to figure this out somehow, a $130 is a $130.
Ray
https://code.google.com/p/propgcc/downloads/detail?name=propellergcc_v0_3_5-i686-windows.zip
Maybe I will have to revisit using my C3 board for the boebot project, the only thing I will have to do is somehow glue the XBee module in a convenient place, boy, this project is really going in a weird direction.
Ray
Can you post your .side file for CMM and LMM modes? You are still running the same C file as posted?
Thanks
Ray
That is using LMM mode. You simply change to CMM, reload, and the LED doesn't blink?
Have you by chance tried replacing all occurences of sleep(1) with waitcnt(CLKFREQ+CNT) ?
Does your propboe have anything attached to it other than mounting screws for the BOT and the LED?
I wish I could reproduce this, but I can't. How did you install the updated compiler?
At first I had a uSD card inserted, the XBee module inserted, but I pulled it all out, and the problem was still showing up. Since I do not have my boebot yet, I do not have anything bolted to the PropBOE board. It is starting to look like the RemoteBot project will be done in Spin. I think trying to use the C3 for that would not work out the way I want it to.
Ray
Perhaps you changed mode without compiling or saving the project.
Ok, well this is disturbing. Maybe we can get Parallax to send you a known good exchange board so we can get the one you have for analysis. Would you be willing to swap boards?
Thanks,
--Steve
Ray - lifetime warranty! Drop me your address and I'll get you a replacement in time for Christmas. We can ship the replacement board tomorrow and you can keep your current PropBOE until the replacement arrives, too. My e-mail address is below. \\
For kicks, be sure to test it with a bit of Spin code just be sure you've got the I/O pin problem.
Now, for testing it with some Spin code, I am not sure how to approach that, in order to determine the problem with CMM mode. I also had a chance to see if I could get the XBee module to work with the threaded cognew function, I could get it to work in LMM mode, but it would not work in CMM mode. I think I might have to try to get the uSD to work, just to see if that is a problem.
Ray
It is beyond me why the latest (or any) propeller-gcc CMM supported version would fail only on Ray's PropBOE with CMM but work on Ray's Quickstart. There must be some factor, but it is illusive so far. Reproducing problems can be difficult - all we can do is make sure the failing board has minimum changes before it gets shipped back. I wonder if it's some on board marginal power issue or other problem.
Ray, once you get the new board post your results here with nothing connected but the LED. I think we need to get the old board for analysis in any case.
Ray
Ray
Ray
Can you try loading it with Propeller-Tool ?
That is an interesting observation. I'm not entirely convinced, but its worth a try.
The program fails for me on either LMM or CMM mode reducing the allocated stack size by 1.
Add 5 (or more) -vs- 3 ints. I.E.
int stacksize = sizeof(_thread_state_t)+sizeof(int)*5;
Ray
It ran fine both ways as LMM and CMM.
As I read the problem description, I keep going back and forth between hardware and software.
I'll try Dave's program on my PropBOE as soon as I find one of those pesky little microSD cards on my desk.
Ray
I forgot that you are running Windows 8 - I wonder if Windows 8 is monitoring power usage too tightly. Could you use a power brick on the PropBOE in addition to the USB? The hypothesis is that just USB power may be a problem, and we need to try and eliminate that possibility.