Bricxcc and firmware test versions

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc and firmware test versions

Post by afanofosc »

The new PosReg* functions referred to an output module field name that is only available when you target the enhanced firmware 1.28+ and I forgot to wrap that in #if so that when you target the standard firmware or 1.0x firmwares it would not include those API functions. That has now been fixed in a revised upload of the same release version number (3.3.8.9 and 1.2.1 r4).

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: Bricxcc and firmware test versions

Post by nxtboyiii »

I found out it is because I didn't save the file. I can't compile untitled files.
Thanks, and have a nice day,
nxtboy III

programnxt.com
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Bricxcc and firmware test versions

Post by mattallen37 »

nxtboyiii wrote:I found out it is because I didn't save the file. I can't compile untitled files.
I can, now that I updated it again to the latest version (todays version). If you didn't update it, you should. Also, you should re-flash your NXT's FW, if you haven't yet.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc and firmware test versions

Post by afanofosc »

I uploaded a new BricxCC/NBC test release zip to http://bricxcc.sourceforge.net/test_releases/ These have version 3.3.8.10 and 1.2.1r5.

The change here is a set of API functions built into the standard header files for the Dexter Industries GPS device. Here is a sample program:

Code: Select all

task main()
{
  SetSensorLowspeed(S1);
//  while(!SensorDIGPSStatus(S1)) Wait(10);
  while (true)
  {
    // show link status
    NumOut(0, LCD_LINE1, SensorDIGPSStatus(S1), true);
    // show latitude & longitude
    float lat = SensorDIGPSLatitude(S1) / 1000000;
    float lng = SensorDIGPSLongitude(S1) / 1000000;
    NumOut(0, LCD_LINE2, lat);
    NumOut(0, LCD_LINE3, lng);
    // show heading
    NumOut(0, LCD_LINE4, SensorDIGPSHeading(S1));
    // show velocity
    NumOut(0, LCD_LINE5, SensorDIGPSVelocity(S1));
    // show time in UTC
    NumOut(0, LCD_LINE6, SensorDIGPSTime(S1));
    Wait(500);
  }
}
I have had a report which I have confirmed that the SensorTemperature API function does not work. This will be fixed in the next test release. In the meantime you can use this code in a header file that you #include and call SensorTemperature2 instead of SensorTemperature.

Code: Select all

asm {
#define __ReadSensorTemperature2(_port, _temp) \
  compif EQ, isconst(_port), FALSE \
  acquire __RLSBmutex0 \
  acquire __RLSBmutex1 \
  acquire __RLSBmutex2 \
  acquire __RLSBmutex3 \
  mov __RLSReadPort, _port \
  mov __RLSReadBufVar, __RSTempLSBuf \
  set __RLSBytesCountVar, 2 \
  call __ReadLSBytesVar \
  index __RSTempRaw, __RLSReadBufVar, NA \
  index __RLSBytesCountVar, __RLSReadBufVar, 1 \
  mul __RSTempRaw, __RSTempRaw, 256 \
  add __RSTempRaw, __RSTempRaw, __RLSBytesCountVar \
  mul __RSTempRaw, __RSTempRaw, 10 \
  div __RSTempRaw, __RSTempRaw, 16 \
  div _temp, __RSTempRaw, 16 \
  brcmp LTEQ, __RRT_EndIf##__I__, __RSTempRaw, 20470 \
  sub _temp, _temp, 2560 \
  __RRT_EndIf##__I__: \
  __IncI__ \
  brcmp NEQ, __RRT_FloatEndIf##__I__, typeof(_temp), 10 \
  div _temp, _temp, 10 \
  __RRT_FloatEndIf##__I__: \
  __IncI__ \
  release __RLSBmutex0 \
  release __RLSBmutex1 \
  release __RLSBmutex2 \
  release __RLSBmutex3 \
  compelse \
  compchk LT, _port, 0x04 \
  compchk GTEQ, _port, 0x00 \
  acquire __RLSBmutex##_port \
  mov __RLSReadBuf##_port, __RSTempLSBuf \
  set __RLSBytesCount##_port, 2 \
  call __ReadLSBytes##_port \
  index __RSTempRaw, __RLSReadBuf##_port, NA \
  index __RLSBytesCount##_port, __RLSReadBuf##_port, 1 \
  mul __RSTempRaw, __RSTempRaw, 256 \
  add __RSTempRaw, __RSTempRaw, __RLSBytesCount##_port \
  mul __RSTempRaw, __RSTempRaw, 10 \
  div __RSTempRaw, __RSTempRaw, 16 \
  div _temp, __RSTempRaw, 16 \
  brcmp LTEQ, __RRT_EndIf##__I__, __RSTempRaw, 20470 \
  sub _temp, _temp, 2560 \
  __RRT_EndIf##__I__: \
  __IncI__ \
  brcmp NEQ, __RRT_FloatEndIf##__I__, typeof(_temp), 10 \
  div _temp, _temp, 10 \
  __RRT_FloatEndIf##__I__: \
  __IncI__ \
  release __RLSBmutex##_port \
  compend
}

#define SensorTemperature2(_port) asm { __ReadSensorTemperature2(_port, __FLTRETVAL__) }
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Bricxcc and firmware test versions

Post by mattallen37 »

Is the only difference between this test release and 3.3.8.9 (latest official), the added support of the dGPS, and soon to be the temperature sensor?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Bricxcc and firmware test versions

Post by HaWe »

afanofosc wrote:I uploaded a new BricxCC/NBC test release zip to http://bricxcc.sourceforge.net/test_releases/ These have version 3.3.8.10 and 1.2.1r5.
The change here is a set of API functions built into the standard header files for the Dexter Industries GPS device. Here is a sample program:
John Hansen
@John:
is there also planned a test_release including the HTTetrixMux drivers in the soon arriving future? ;)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc and firmware test versions

Post by afanofosc »

Adding support for the tetrix motor controllers from HiTechnic has long been a goal of mine, as you are well aware. How quickly they are ready is hard to predict. It would be faster if I had the devices to actually test with but so far none have magically appeared on my porch. :-)

I promised John and Steve at HiTechnic something unrelated to the Tetrix drivers almost a year ago and have made very little progress on that project (which is fairly complex) so far even though I have the device in my possession. It is the #1 thing that somehow I need to make more traction on ASAP.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Bricxcc and firmware test versions

Post by HaWe »

Thank you John, I'm gladly looking forward - the hope dies last ;)
But if you'll write some code into a header file and post it I may test it immediately :P
jasonlh
Posts: 7
Joined: 12 May 2011, 05:39

Re: Bricxcc and firmware test versions

Post by jasonlh »

I installed Bricxcc last night, and was getting this same "Compile/Download Failed Compile Failure." message. I searched, and found this thread, but didn't really see an answer. So I just started trying different options in the Compiler Preferences until I got it working. Unchecking the "Use internal compiler" check box under the NBC/NXC tab seemed to do the trick. I was pretty happy to finally get everything installed, firmware updated, and finally get my first NXC program compiled and running on my NXT!

This was all on my Windows 7 64 bit computer at home last night. Today I installed everything on a Vista 32 bit computer at work (in case it was an OS issue) and had the same results on both computers.

Here is exactly what I did today.
- Downloaded and installed bricxcc_setup_3389.exe
- Noted the installed nbc.exe was version 1.2.1.4, and when I pressed the Version button in compiler preferences it listed the same
- Downloaded and uzipped test_release20110316.zip over the same directory
- Noted that installed nbc.exe was version 1.2.1.5, and when I pressed the Version button in compiler preferences it still listed 1.2.1r4
- Opened the 3_spiral.nxc sample program, and pressed the compile button (F5)
- Got the "Compile/Download Failed" message
- Unchecked "Use internal compiler" in preferences
- Successfully compiled program.

Is the problem because the internal compiler is still 1.2.1r4 and the external file 1.2.1r5? At any rate, hopefully this will help out the next person with this problem. :)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BTW, why can't I post to this board in Firefox? When I try to post, I get a "The page isn't redirecting properly" error? Using FF4.0.1. Next I tried IE, but couldn't even stay logged in! It seemed to accept my login credentials, but then would just reload the page still as a guest? Finally I started to search the problem and saw that Google owns SourceForge, so I tried Chrome, which works and is where I'm posting this from. What do I have to change in FF to be able to post? I'm thinking it's some cookie setting, but not really sure?

Thanks!
Jason
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Bricxcc and firmware test versions

Post by sidneys1 »

jasonlh wrote:...and saw that Google owns SourceForge...
Incorrect, SourceForge is owned and operated by Geeknet, Inc.

Have a nice day,
~Sidneys1
My Mindstorms website: http://sidneys1.com
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests