Initially I even thought it was an ATMEga128, but in the end it is something similar, or rather it contains more features. At the pinout level they seem equivalent to me, maybe at the internal level they work differently. I also followed this page that contains something that interests me, instructions for programming with FTDI in Arduino IDE. I want to use this AT90CAN128 with Arduino IDE, basic programming, just a port manipulation, it would be useful because it has quite a few pins and I had in mind a project with several LEDs.
I donāt really understand everything, Iām a hobbyist, for programming in Arduino IDE would I need anything else besides FTDI? Strictly speaking about this AT90CAN128. A bootloader is mentioned, possibly, I can use a programmer like AVR USB like this one:
The schematic for the AST-CAN485 development board contains about two more ICs besides the AT90CAN128, so I donāt think it would be useful to me.
Do you think I can use the millis() or delay() functions on this AT90CAN128? Maybe even other common libraries, for a 16x2 LCD with I2C or common sensors.
For programming this microcontroller in Arduino IDE, youāll need:
FTDI Programmer (for serial communication/programming)
if your board does not have a bootloader, you might need an AVR programmer like the AVR USB programmer to flash a bootloader first (like the USBasp you showed, for initial bootloader and fuse setting)
Arduino IDE with appropriate board support for AT90CAN128 (add a custom board definition for AT90CAN128)
Set appropriate fuses
Regarding libraries and functions:
millis() and delay() should work
Most Arduino libraries compatible with AVR should function
I2C and LCD libraries likely compatible
Sensor libraries should work with standard interfaces
Just make sure interrupts/timers donāt interfere!
ā4. Set appropriate fusesā here I donāt really know what itās about, I havenāt worked with something like that, but at the moment I donāt have time to deal with this chip and thereās no point in insisting. But I will soon make an attempt for programming the IC using that tool I have.
Thank you for your reply.
Hi!
Following the instructions from Sparkfun I installed the AST CAN485 āboardā in the Arduino IDE. I had a first attempt at programming the AT90CAN128 following this configuration (I succeeded in the same manner on an ATMega8):
AT90CAN128 ā USBasp
PE0(MOSI/PDI) ā MOSI
PE1(MISO/PDO) ā MISO
SCK ā SCK
RST ā RST
VCC ā VCC
GND ā GND
But the flashing did not complete successfully, I was getting some SCK error. I tried a āBlinkā sketch by attaching an LED to pin 7 (PE7), if this picture is correct:
Then I followed the instructions here , roughly, I copied the files from the āat90canā archive into the Arduino IDE (Iām running v1.8.15) but I canāt find the [usbtinyisp]AT90CAN128 or [JTAG ICE mk1]AT90CAN128 board available in Boards Manager. However, using the data above, I clicked Burn Bootloader, and something happened, the flashing shows as āDone uploadingā but the LED still doesnāt light up. There are definitely some missing parts behind it because there are traces left:
Warning: Board arduino:avr:uat90can128 doesnāt define a ābuild.boardā preference. Auto-set to: AVR_UAT90CAN128
Warning: Board arduino:avr:at90can128 doesnāt define a ābuild.boardā preference. Auto-set to: AVR_AT90CAN128
Warning: Board arduino:avr:jat90can128 doesnāt define a ābuild.boardā preference. Auto-set to: AVR_JAT90CAN128
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
I donāt have a PCB for the AT90CAN128 IC, I have a delicate setup with wires soldered to the IC pins, if I succeed in programming then I will make a PCB as well.
Correct me if Iām wrong. It sounds like you are ādead buggingā the IC, and since it wasnāt mentioned, Iām guessing you arenāt using an external crystal oscillator? Iām speculating here based on the information provided, so if this isnāt the case, please disregard. If it is, then, continue.
From the link you provided, those instructions have you set the low nibble of the low fuse byte to 0xF which per the datasheet selects the crystal oscillator. This would be appropriate for the AST-CAN485, but in your case, the low nibble should be 0x2 to select the internal 8 MHz clock. Might also need to adjust F_CPU, but that shouldnāt keep the LED from blinking.
void setup() {
// initialize digital pin 7 as an output.
pinMode(7, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(7, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
I disconnected the Reset pin of the MCU from USBasp, as well as MOSI&MISO, so I kept only the power supply part.
Iām a hobbyist/beginner, I havenāt had to deal with fuse settings before (Iāve heard about it in principle, from documents), so I donāt have much experience in practice.