所需E币: 3
时间: 2019-12-24 19:14
大小: 139.91KB
Itisoftennecessarytooutputafloatingpointnumbertoadisplay.Forexample,tocheckcalculations,onemightwanttooutputfloatingpointnumbersusingthePICmicro®microcontrollersserialport,orusegeneralpurposeI/Otooutputtoaliquidcrystaldisplay(LCD).Eitherway,thefloatingpointnumbermustbecon-vertedtoitsASCIIequivalent.Thisdocumentshowsaspecificexampleofconvertinga32-bitfloatingpointnumbertoASCII.ApplicationnoteAN575contains24-bitand32-bitfloatingpointroutines.AsubroutineisprovidedherethatdoestheconversionandreturnstheASCIIequivalentinRAM.Anexample“main”programisprovidedtoshowhowtousethesubroutine.MFloatingPointtoASCIIConversionAN670Table2depictsMicrochip’s32-bitfloatingpointregisterAuthors:RickEvansRAMusage.Thebitlabeled“S”isthesignbit.TheseMicrochipTechnology,Inc.registersarecollectivelycalledAARG.ThefloatingpointroutinesrequirethattheargumentsbeputinAARGandBARG(BARGisthesecondargument,sameformatas……