Go Down

Topic: 1284P & 1.6.9 Boards Manager (Read 6869 times) previous topic - next topic

CrossRoads

How do 1284P boards get added in 1.6.9?  I'm totally new to that.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

#1
May 23, 2016, 05:22 am Last Edit: May 23, 2016, 05:22 am by CrossRoads
Looks like it may be as simple as downloading
Jack Christensen's v1.6.3 branch into the
arduino1.6.9/hardware/folder.
https://github.com/JChristensen/mighty-1284p/tree/v1.6.3

Nice to see a font size adjustment under File:Preferences too.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Took me a while to find this bookmark, hid it on myself:
https://github.com/MCUdude/MightyCore

Looks Bobuino pinout is supported as well for those that have purchased one of my Bobuino boards in it's different form factors (gotta thank LarryD for coining that name!) Some examples:
http://www.crossroadsfencing.com/BobuinoRev17/

or

or

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

#3
May 23, 2016, 05:45 am Last Edit: May 23, 2016, 05:46 am by CrossRoads
MightyCore looks to make it easier to select the clock speed, brownout level, and board type too.
Haven't done much but get it loaded so far, looking forward to trying 1.6.9 out.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

My most recent 1284P sketch using both serial ports to talk to USB and a GSM/GPS module, and SPI to control shift registers (to control transistors) and read temps from MAX31865 RTD chips still compiles ok, so that's a good sign ...
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

mrburnette

My most recent 1284P sketch using both serial ports to talk to USB and a GSM/GPS module, and SPI to control shift registers (to control transistors) and read temps from MAX31865 RTD chips still compiles ok, so that's a good sign ...
Yes, that is a good sign.  Thanks for sharing your experience, I am a big fan of the 1284 uC (have a few of your Bob's too) but have been off playing in 32-bit land for a while.  Will eventually work my way back to these 8-bit workhorses!

Ray

hansibull

Stay tuned! Implementation of Majek's modified Optiboot bootloader are in the works! It's still less than 512/1024 bytes, and allow the microcontroller to write to its own flash. Interesting feature, huh?  :)
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

CrossRoads

Could be. 1284 has tons of room already, never had a space problem.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Anyone seeing a problem with software reset not working in 1.6.9?
I have code that does the assembler reset, works in 1.0.6, not in 1.6.9.  I use it because I have a DF Robot GSM/GPS card that boots up sometimes with incorrect responses to AT, comes back with "Normal Power Down" or a responds with "yyyy" with umlaut over them, only way to recover seems to be to reset the code. (which you wouldn't think would reset the GPS/GSM card, yet seems to solve the problem).
With 1.6.9, the software reset just hangs the 1284. With 1.0.6, everything restarts as expected.
Code: [Select]


 Serial.println("resetting...");

 asm volatile ("jmp 0");

 while(1);


Now that  I think about it, I don't recall seeing "resetting" in the Serial Monitor, so maybe it's something else.
It definitely hangs in 1.6.9 tho.
Code: [Select]


// check incoming messages

 //NORMAL POWER DOWN - 17 - need a reset if get this

 //

 //RDY

 //+CFUN: 1 - 8

 //+CPIN: READY - 12

 //+PACSP: 1 - 9

 //Call Ready - 10

 //GPS Ready - 9 - these two may be swapped

 delay(500);

 Serial.println("");

 Serial.print ("Starting GPS/GSM 'warmup' delay");

 Serial.print(" ");

 for (x=1; x<=12; x=x+1){

 Serial.print (x);

 delay(1000);

 }

 //

 // losing some data during the delay?

 //

 Serial.println("");

 Serial.println ("GPS ready for AT?");

 y =0;

 for (x=0; x<64; x=x+1){

 inGPS = Serial1.read();

 // 13, 10, 32 ignore CR, LF, Space

 if ((inGPS !=13) && (inGPS !=10) && (inGPS !=32)){

 dataGPS[y] = inGPS;

 y=y+1;

 }

 }

 Serial.print ("received: ");

 for (x=0; x<50; x=x+1){

 Serial.print (dataGPS[x]);

 }

 Serial.println("");

 Serial.println("");

 // FIXed THIS? - waSN'T CATCHing NORMAL POWER DOWN as a failure mode. The R passes the current test. Added check for not-N at the start

 

 if((((dataGPS[0] == 'R') || (dataGPS[0] == '+')) ||((dataGPS[1] == 'R') || (dataGPS[1] == '+')) || ((dataGPS[2] == 'R') || (dataGPS[2] == '+'))) && (dataGPS[0]!='N') ){

 

 Serial.println("yes - sending AT");

 Serial1.write((uint8_t*)at,strlen(at));

 Serial.print("received: ");

 y = 0;

 delay(2000);

 while (Serial1.available()>0){

 inGPS = Serial1.read();

 // 13, 10, 32 ignore CR, LF, Space

 if ((inGPS !=13) && (inGPS !=10) && (inGPS !=32)){

 dataGPS[y] = inGPS;

 y=y+1;

 }

 }

// print response

 for (x=0; x<4; x=x+1){

 Serial.print (dataGPS[x]);

 }

 Serial.println("");

 Serial.println("");

 Serial.println("sending at+cgpspwr=1");

 Serial1.write((uint8_t*)cgpspwr, strlen(cgpspwr));

 y = 0;

 delay(2000);

 while (Serial1.available()>0){

 inGPS = Serial1.read();

 // 13, 10, 32 ignore CR, LF, Space

 if ((inGPS !=13) && (inGPS !=10) && (inGPS !=32)){

 dataGPS[y] = inGPS;

 y=y+1;

 }

 }

 // print response

 Serial.print("received: ");

 for (x=0; x<14; x=x+1){

 Serial.print (dataGPS[x]);

 }

 Serial.println("");

 Serial.println("");

 Serial.println("sending at+cgpsrst=1");

 Serial1.write((uint8_t*)cgpsrst, strlen(cgpsrst));

 y = 0;

 delay(2000);

 while (Serial1.available()>0){

 inGPS = Serial1.read();

 // 13, 10, 32 ignore CR, LF, Space

 if ((inGPS !=13) && (inGPS !=10) && (inGPS !=32)){

 dataGPS[y] = inGPS;

 y=y+1;

 }

 }

 // print response

 Serial.print("received: ");

 for (x=0; x<14; x=x+1){

 Serial.print (dataGPS[x]);

 }

 Serial.println("");

 }

 

 else{

 Serial.println("resetting...");

 asm volatile ("jmp 0");

 while(1);

 }


The code is looking for a couple of things:
R (implies RDY received)
+ (implies +CFUN received)
yR (implies RDY received) (y is the y umlaut character)
y+ (implies +CFUN received)
yyR (implies RDY received), but not NOR
yy+  (implies +CFUN received)
My testing/monitoring shows these 6 will allow normal commands to be sent, anything else comm's are either hosed, or the device is going into some power down mode. The Reset in 1.0.6 works to recover comm's usually with the next set of messages, sometimes two. With 1.6.9, there is no recovery, the code just stops outputting stuff with
"received: NORMA" if I recall correctly. I'll have to enumerate the "received"s a little more so I can tell which one is sending that out, maybe it's hanging sooner than I thought.

This is the card, the browser I'm on right now won't open any further for me unfortunately.  There's links to a Wiki page with some sample code that stinks for this SIM908 module that combines GPS and GSM for location info and texting. I use the 1284P's Serial1 port to talk to it, and Serial to talk to the PC for debugging (on a custom card).
http://www.dfrobot.com/index.php?route=product/search&description=true&search=sim908
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Hmm, reads like I'm hijacking my own topic, doesn't it!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DrAzzy

I had problems with asm("jmp 0") too (1.6.5 IDE)

I don't think you can count on it being safe (ie, not leaving shit in the cpu registers that would break assumptions about the startup state of said registers - plus ofc leaving things in the hardware registers, which could cause unexpected behavior). I put a bunch of effort into this, and eventually said fuck this and used the watchdog, which works right every time.

If you write to serial, and immediately try to reset the board, you may not get any output, depending on what the code that you've jumped to does to it, since writing to serial under the default core is non-blocking, if you get it into a bad enough state before it's finished outputting what you told it to, you can lose the output.
ATTinyCore and megaTinyCore for all ATtiny, DxCore for DA/DB-series! github.com/SpenceKonde
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

CrossRoads

The sequence is: after power up, 12 seconds elapse (by experimenting it seems to take that long for the module to 'boot up' or whatever it does), I watch for its post boot-up message, if it looks ok I send it an AT and continue.
When it doesn't look normal (anything other then RDY or the +CFUN message, or those two proceeded by  y or yy) then the software reset seems to work. Another 12 seconds elapses, and it talks normally.
With 1.6.9, I can't seem to reset tho. I'm not even writing to serial1 yet at that point, just receiving.

I have a test program that I can manually enter commands, I'll try that again when I get home and see if just waiting another 12 seconds does anything in 1.6.9.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

tf68

If you are using Optiboot and you jump to the booloader address you will get a mcu (watchdog) reset.

asm ("jmp 0x7e00"); // m328p Uno

Should work for the 1284p, with the correct address.

CrossRoads

Thanks, I can give that a try too. Probably tomorrow, I get home later after golf on Tuesdays.
Note to self:
Size, start address, BootSize bits
256 words = 3F00 BOOTSIZE1/0 =11
512 words = 3E00 BOOTSIZE1/0 =10
1024 words = 3C00 BOOTSIZE1/0 =01
2048 words = 3800 BOOTSIZE1/0 =00
Bits 2, 1 of High Fuse Byte

(offtopic: have been thinking of simple golf score tracker, button to press on each stroke an update running total, button to change briefly to show running total, button to reset hole score. Auto sleep after a couple seconds of showing hole or total, press any button to wake up.  Stupid really, I think of things like that when I get bored. Not too keen on GPS devices that show hole layout and have score capability for 4 built in, don't want to take my reading glasses when I'm golfing just to see a little screen that I have to remember to recharge.  Paper score card works well, I can add notes about a particularly bad shot or something, or 'chart' my fairway drives, greens in regulation, how many putts, whatever I feel like that day. No recharging needed.)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bperrybap

#14
Jun 07, 2016, 11:18 pm Last Edit: Jun 07, 2016, 11:32 pm by bperrybap
If I were going to do that type of jump to zero kludge, I'd mask interrupts before doing the jump to zero.

But why bother trying to do a soft "reset" using a kludge that doesn't really reset anything and is prone to problems when it is so easy to use the watchdog timeout and do it correctly?

Code: [Select]
/*
 * Function to cause the AVR to reset
 */
#include <avr/wdt.h>
void resetArduino()
{
 noInterrupts();
 wdt_enable(WDTO_15MS);
 while(1); // wait to die and be reborn....
}


--- bill

Go Up