the land of sun+snow
Offline
Edison Member
Karma: 81
Posts: 2137
|
 |
« Reply #15 on: January 11, 2013, 05:06:34 pm » |
Ok, I'll try building a section for the 1284 chip.
Yeah, from looking at the directories, it looks like you bootstrapped onto maniac-bug's optiboot, but thanks just the same, :-). That's good, so if he updates optiboot, then Bobuino-bootloader variant should still work.
In another section of this forum, I tried to get westfw interested in modifying UNO optiboot to make it more conducive to sketch uploading via XBee, but it didn't take. Would be a great advance, I think, considering how popular XBee is.
I did look at the adafruit and other wireless programming pages, but they don't work with the existing optiboot or avrdude. I did spend some time figuring out how to mod optiboot myself, so it would upload at a slower baudrate [9600,19200] but it was too unreliable, and I ultimately decided that the avrdude transfer protocol would also need to be modded too.
|
|
|
|
« Last Edit: January 11, 2013, 05:09:23 pm by oric_dan(333) »
|
Logged
|
|
|
|
|
vermont
Offline
Full Member
Karma: 3
Posts: 121
|
 |
« Reply #16 on: January 13, 2013, 12:53:04 am » |
I take that to mean the 1284P has 2 8 bit timers and 2 16 bit times, where as the non-P has two 8 bit timers but only one 16 bit timer. You disagree, if so why? because i have both chips and assure you both have a timer3. unbelievers will find the code below blinks any leds attached to port d. reset: ldi r23,0xff out ddrd,r23 ldi r23,0b00000101 sts tccr3b,r23 l1: lds r22,tcnt3l lds r23,tcnt3h out portd,r23 rjmp l1
atmel data sheets are rife with misinformation. there was an almost identical situation with the 328 couple years back. another interesting but related issue is they use the same die for supposedly radically different parts. ie many of the low end 6 pin are actually relabeled higher end parts. in that case i dont complain because i get 2x or 4x the memory for a few cents less.
|
|
|
|
« Last Edit: January 13, 2013, 01:17:30 am by john1993 »
|
Logged
|
|
|
|
|
Upstate NY
Offline
Full Member
Karma: 2
Posts: 167
|
 |
« Reply #17 on: January 13, 2013, 11:03:40 am » |
I take that to mean the 1284P has 2 8 bit timers and 2 16 bit times, where as the non-P has two 8 bit timers but only one 16 bit timer. You disagree, if so why? because i have both chips and assure you both have a timer3. unbelievers will find the code below blinks any leds attached to port d. reset: ldi r23,0xff out ddrd,r23 ldi r23,0b00000101 sts tccr3b,r23 l1: lds r22,tcnt3l lds r23,tcnt3h out portd,r23 rjmp l1
atmel data sheets are rife with misinformation. there was an almost identical situation with the 328 couple years back. another interesting but related issue is they use the same die for supposedly radically different parts. ie many of the low end 6 pin are actually relabeled higher end parts. in that case i dont complain because i get 2x or 4x the memory for a few cents less. In the early days of microprocessors, 8080 and 6800, there were unused opcodes. That is, there were combinations of 8 bit codes that were not documented. People began exploring them, testing what they did and started using the undocumented opcodes. They was a lot of supposition that there were problems with the unused opcodes and the manufacterer just did not want to support them. Later processors locked out the unused opcodes so that they were just noops. I suspect that the non-P timer3 may have a problem with the timer. Rather than make a new die masks, they just removed it from the spec. An engineer would be foolish to use an unsupported feature. A hobbyist can do anything they want. Regarding the extra memory. The manufacturer probably had extra of the high end parts and needed low end parts. Rather than firing up the fab line for those parts, they took the higher end parts and just branded them with a lower end part number.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15325
Measurement changes behavior
|
 |
« Reply #18 on: January 13, 2013, 12:07:12 pm » |
I asked over at the avrfreaks site (brave of me, huh!). They seem to be rather bored with that topic presently as they have posted a lot on this timer topic for the 1284 chips in the past and the confusion over the various datasheets. One of their posting has this quote: Answer from Atmel:
"Timer 3 exists in both ATmega1284 and ATmega1284P. It is not available in ATmega164/324/644 devices."
Lefty
|
|
|
|
|
Logged
|
|
|
|
|
the land of sun+snow
Offline
Edison Member
Karma: 81
Posts: 2137
|
 |
« Reply #19 on: January 13, 2013, 02:23:41 pm » |
A quick question about servos and the 1284P. Looking at Servo.h in the libraries directory shows there is no line entry for 1284P chips [unless I have an obsolete version]. It also says that 1 timer can control up to 12 servos. Other chips like 2560 have multiple timers available, and can therefore control a lot servos.
So, now that we've decided the 1284 and 1284P have one extra available timer, that means the Servo library could be patched so the 1284/P chips could control up to 24 servos.
Or am I missing something?
|
|
|
|
|
Logged
|
|
|
|
|
vermont
Offline
Full Member
Karma: 3
Posts: 121
|
 |
« Reply #20 on: January 14, 2013, 12:03:41 pm » |
i was using the m1284 to generate 8 servo signals which is why i noticed that there were 4 instead of 3 like the datasheet said. i prefer to do it with oc registers so that NO cpu time or interrupts are used. about 1/10th the code too. set and forget.
and that was very brave indeed to go over there lefty. if you dont genuflect properly or they are in a bad mood it aint pretty. lol! unfotunately a couple are moderators so it can get kinda nasty. this site is much better in that respect and seems far more helpful anyway. specially when it comes to bootloaders and arduino stuff. its nice when guys like you and the others are both experienced and willing to help. a good combo.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15325
Measurement changes behavior
|
 |
« Reply #21 on: January 14, 2013, 12:12:58 pm » |
A quick question about servos and the 1284P. Looking at Servo.h in the libraries directory shows there is no line entry for 1284P chips [unless I have an obsolete version]. It also says that 1 timer can control up to 12 servos. Other chips like 2560 have multiple timers available, and can therefore control a lot servos.
So, now that we've decided the 1284 and 1284P have one extra available timer, that means the Servo library could be patched so the 1284/P chips could control up to 24 servos.
Or am I missing something?
That would seem to be the case. I extracted this from the Servo.h which would seem where to make an entry for the 1284P would be required. // Say which 16 bit timers can be used and in what order #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #define _useTimer5 #define _useTimer1 #define _useTimer3 #define _useTimer4 typedef enum { _timer5, _timer1, _timer3, _timer4, _Nbr_16timers } timer16_Sequence_t ;
#elif defined(__AVR_ATmega32U4__) #define _useTimer1 typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) #define _useTimer3 #define _useTimer1 typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
#elif defined(__AVR_ATmega128__) ||defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__) #define _useTimer3 #define _useTimer1 typedef enum { _timer3, _timer1, _Nbr_16timers } timer16_Sequence_t ;
#else // everything else #define _useTimer1 typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ; #endif
Lefty
|
|
|
|
« Last Edit: January 14, 2013, 01:22:11 pm by retrolefty »
|
Logged
|
|
|
|
|
the land of sun+snow
Offline
Edison Member
Karma: 81
Posts: 2137
|
 |
« Reply #22 on: January 14, 2013, 01:19:51 pm » |
Yeah, 24 servos and you're still using the other timers for their regular purposes.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 73
Posts: 6638
Arduino rocks
|
 |
« Reply #23 on: January 14, 2013, 07:14:27 pm » |
Thanks, I looked at the 584 page d/s, and decided it was easier to ask the experts!
BTW, out of stupidity, I bought a couple of the atmega1284-PU chips instead of the atmega1284P-PU chips, and to burn the bootloader, I found I had to track down the avrdude.conf file and change to the chip-signature to that for the 1284. Then, it burned the bootloader ok using the ArduinoISP sketch from a UNO chip.
However, to download sketches into the 1284 bootloader chip using the IDE, I then had to change avrdude.conf back to the original 1284P chip-signature. Interesting.
That's because the Arduino bootloader doesn't use the hardware signature in its sketch-loading protocol, it uses the signature bytes compiled into the bootloader binary when it was compiled. If you use ICSP to burn a bootloader you have to match the hardware signature...
|
|
|
|
|
Logged
|
|
|
|
|
the land of sun+snow
Offline
Edison Member
Karma: 81
Posts: 2137
|
 |
« Reply #24 on: January 14, 2013, 09:02:16 pm » |
That's because the Arduino bootloader doesn't use the hardware signature in its sketch-loading protocol, it uses the signature bytes compiled into the bootloader binary when it was compiled.
If you use ICSP to burn a bootloader you have to match the hardware signature... Yes, exactly what I discovered via T&E.
|
|
|
|
|
Logged
|
|
|
|
|
|